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
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
The passed NotificationArgs is Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs
Deleted
Paragraph deleted notification. Occurs after the paragraph has been deleted.
public const string Deleted = "DWN_STANDARD_PARAGRAPH_DELETED"
Field Value
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
The passed NotificationArgs is Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs
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
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
The passed NotificationArgs is Dynamicweb.Notifications.Standard.Paragraph.ParagraphModuleNotificationArgs
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
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
The passed NotificationArgs is Dynamicweb.Notifications.Standard.Paragraph.ParagraphModuleNotificationArgs
OnBeforeRender
Paragraph before render notification. Occurs before the paragraph will be rendered.
public const string OnBeforeRender = "DWN_STANDARD_PARAGRAPH_ONBEFORERENDER"
Field Value
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
The passed NotificationArgs is Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRenderArgs
OnBeforeSave
Paragraph before save notification. Occurs before the paragraph is saved.
public const string OnBeforeSave = "DWN_STANDARD_PARAGRAPH_ONBEFORESAVE"
Field Value
Remarks
The passed NotificationArgs is Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs
Restored
Paragraph restored notification. Occurs after the paragraph has been restored from trashbin.
public const string Restored = "DWN_STANDARD_PARAGRAPH_RESTORED"
Field Value
Remarks
The passed ParagraphRestoredEventArgs is Dynamicweb.Notifications.Standard.Paragraph.ParagraphRestoredEventArgs
Saved
Paragraph saved notification. Occurs after the paragraph has been saved.
public const string Saved = "DWN_STANDARD_PARAGRAPH_SAVED"
Field Value
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
The passed NotificationArgs is Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs