Table of Contents

Class Standard.Admin

Namespace
Dynamicweb.Notifications
Assembly
Dynamicweb.dll
Provides notification names for Admin part of the site.
public sealed class Standard.Admin
Inheritance
Standard.Admin
Inherited Members

Examples

using Dynamicweb.Security.UserManagement;

namespace Dynamicweb.Examples.Notifications.Standard
{
    [Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Notifications.Standard.Admin.Started)]
    public class AdminStartedObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.Notifications.NotificationArgs args)
        {
            if (args == null)
                return;

            if (!(args is Dynamicweb.Notifications.Standard.Admin.StartArgs))
                return;

            Dynamicweb.Notifications.Standard.Admin.StartArgs item = (Dynamicweb.Notifications.Standard.Admin.StartArgs)args;

            User user = User.GetCurrentBackendUser();

            //Pass user name to the notification e-mail
            string emailBody = string.Format("The user ({0}) has been logged-in.", user.Name);
        }
    }
}

Fields

OnBeforeBackendLogOff

Backend LogOff notification. Occurs before the user logged off the website Administration.
public const string OnBeforeBackendLogOff = "DWN_STANDARD_ADMIN_LOGOFF"

Field Value

string

Remarks

PipelineStarted

Admin pipeline started notification. Occurs when the pipeline was launched
public const string PipelineStarted = "DWN_STANDARD_ADMIN_PIPELINESTARTED"

Field Value

string

Examples

namespace Dynamicweb.Examples.Notifications.Standard
{
    [Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Notifications.Standard.Admin.PipelineStarted)]
    public class PipelineStartedObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.Notifications.NotificationArgs args)
        {
            if (args == null)
                return;

            if (!(args is Dynamicweb.Notifications.Standard.Admin.PipelineStartArgs))
                return;

            Dynamicweb.Notifications.Standard.Admin.PipelineStartArgs item = (Dynamicweb.Notifications.Standard.Admin.PipelineStartArgs)args;

            //Add code here

        }
    }
}

Remarks

Started

Admin started notification. Occurs after the user logged in and got to the website Administration.
public const string Started = "DWN_STANDARD_ADMIN_STARTED"

Field Value

string

Examples

using Dynamicweb.Security.UserManagement;

namespace Dynamicweb.Examples.Notifications.Standard
{
    [Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Notifications.Standard.Admin.Started)]
    public class AdminStartedObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.Notifications.NotificationArgs args)
        {
            if (args == null)
                return;

            if (!(args is Dynamicweb.Notifications.Standard.Admin.StartArgs))
                return;

            Dynamicweb.Notifications.Standard.Admin.StartArgs item = (Dynamicweb.Notifications.Standard.Admin.StartArgs)args;

            User user = User.GetCurrentBackendUser();

            //Pass user name to the notification e-mail
            string emailBody = string.Format("The user ({0}) has been logged-in.", user.Name);
        }
    }
}

Remarks

To top