Table of Contents

Class Standard.Paragraph

Namespace
Dynamicweb.Notifications
Assembly
Dynamicweb.dll

Provides notification names for paragraphs.

public sealed class Standard.Paragraph
Inheritance
Standard.Paragraph
Inherited Members

Examples

using Dynamicweb.Extensibility.Notifications;

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

            var item = (Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRenderArgs) args;
        }
    }
}

Fields

ActiveStateChanged

Paragraph active state changed notification. Occurs after the "Active" state of the paragraph has been changed.

public const string ActiveStateChanged = "DWN_STANDARD_PARAGRAPH_ACTIVESTATECHANGED"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;

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

            var item = (Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs) args;

            if (!item.Target.ShowParagraph)
            {
                //Pass paragraph Id to the notification e-mail
                var emailBody = string.Format("The paragraph (ID:{0}) has been disabled.", item.Target.ID);
            }
        }
    }
}

Remarks

Deleted

Paragraph deleted notification. Occurs after the paragraph has been deleted.

public const string Deleted = "DWN_STANDARD_PARAGRAPH_DELETED"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;

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

            var item = (Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs) args;

            //Pass paragraph Id to the notification e-mail
            var emailBody = string.Format("The paragraph (ID:{0}) has been deleted.", item.Target.ID);
        }
    }
}

Remarks

ModuleAttached

Paragraph module attached notification. Occurs after the module has been attached to the paragraph.

public const string ModuleAttached = "DWN_STANDARD_PARAGRAPH_MODULEATTACHED"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;

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

            if (!(args is Dynamicweb.Notifications.Standard.Paragraph.ParagraphModuleNotificationArgs))
                return;

            var item = (Dynamicweb.Notifications.Standard.Paragraph.ParagraphModuleNotificationArgs) args;

            //Pass attached module name to the notification e-mail
            var emailBody = string.Format("The module ({0}) has been attached.", item.ModuleSystemName);
        }
    }
}

Remarks

ModuleDetached

Paragraph module detached notification. Occurs after the module has been detached from the paragraph.

public const string ModuleDetached = "DWN_STANDARD_PARAGRAPH_MODULEDETACHED"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;

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

            if (!(args is Dynamicweb.Notifications.Standard.Paragraph.ParagraphModuleNotificationArgs))
                return;

            var item = (Dynamicweb.Notifications.Standard.Paragraph.ParagraphModuleNotificationArgs) args;

            //Pass attached module name to the notification e-mail
            var emailBody = string.Format("The module ({0}) has been detached.", item.ModuleSystemName);
        }
    }
}

Remarks

OnBeforeRender

Paragraph before render notification. Occurs before the paragraph will be rendered.

public const string OnBeforeRender = "DWN_STANDARD_PARAGRAPH_ONBEFORERENDER"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;

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

            var item = (Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRenderArgs) args;
        }
    }
}

Remarks

OnBeforeSave

Paragraph before save notification. Occurs before the paragraph is saved.

public const string OnBeforeSave = "DWN_STANDARD_PARAGRAPH_ONBEFORESAVE"

Field Value

string

Remarks

Restored

Paragraph restored notification. Occurs after the paragraph has been restored from trashbin.

public const string Restored = "DWN_STANDARD_PARAGRAPH_RESTORED"

Field Value

string

Remarks

Saved

Paragraph saved notification. Occurs after the paragraph has been saved.

public const string Saved = "DWN_STANDARD_PARAGRAPH_SAVED"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;

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

            var item = (Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs) args;

            //Pass paragraph Id and text to save to the notification e-mail
            var emailBody =
                string.Format("The paragraph (ID:{0}) has been saved.<hr/><fieldset>{1}</fieldset>",
                    item.Target.ID, item.Target.Text);
        }
    }
}

Remarks

To top