Dynamicweb 8 Documentation
Standard.Paragraph.ParagraphModuleNotificationArgs Class
Members  Example 

Provides information about the module which has been attached to/detached from the paragraph.
Object Model
Standard.Paragraph.ParagraphModuleNotificationArgs ClassParagraph Class
Syntax
'Declaration
 
Public Class Standard.Paragraph.ParagraphModuleNotificationArgs 
   Inherits Dynamicweb.Extensibility.NotificationArgs
public class Standard.Paragraph.ParagraphModuleNotificationArgs : Dynamicweb.Extensibility.NotificationArgs 
Remarks
Arguments passed to: Dynamicweb.Notifications.Standard.Paragraph.ModuleAttached notification, Dynamicweb.Notifications.Standard.Paragraph.ModuleDetached notification
Example
Overriding paragraph module attached in DynamicwebOverriding paragraph module attached in Dynamicweb
namespace Dynamicweb.Examples.CSharp.Notifications.Standard
{
    [Extensibility.Subscribe(Dynamicweb.Notifications.Standard.Paragraph.ModuleAttached)]
    public class ParagraphModuleAttachedObserver : Dynamicweb.Extensibility.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
        {
            if (args == null)
                return;

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

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

            //Pass attached module name to the notification e-mail
            string emailBody = string.Format("The module ({0}) has been attached.", item.ModuleSystemName);
            Dynamicweb.Modules.Common.Email.SendMail("user name", "username@somedomain.dk", "ParagraphModuleAttachedObserver",
                "admin", "noreply@dynamicweb.dk", emailBody, "UTF-8");
        }
    }
}
Namespace Notifications.Standard
    <Extensibility.Subscribe(Global.Dynamicweb.Notifications.Standard.Paragraph.ModuleAttached)> _
    Public Class ParagraphModuleAttachedObserver
        Inherits Global.Dynamicweb.Extensibility.NotificationSubscriber

        Public Overrides Sub OnNotify(ByVal notification As String, ByVal args As Global.Dynamicweb.Extensibility.NotificationArgs)
            If args Is Nothing Then
                Return
            End If

            If Not (TypeOf args Is Global.Dynamicweb.Notifications.Standard.Paragraph.ParagraphModuleNotificationArgs) Then
                Return
            End If

            Dim item As Global.Dynamicweb.Notifications.Standard.Paragraph.ParagraphModuleNotificationArgs = DirectCast(args, Global.Dynamicweb.Notifications.Standard.Paragraph.ParagraphModuleNotificationArgs)

            'Pass attached module name to the notification e-mail
            Dim emailBody As String = String.Format("The module ({0}) has been attached.", item.ModuleSystemName)
            Global.Dynamicweb.Modules.Common.Email.SendMail("user name", "username@somedomain.dk", "ParagraphModuleAttachedObserver", "admin", "noreply@dynamicweb.dk", emailBody, "UTF-8")
        End Sub
    End Class
End Namespace
Inheritance Hierarchy

System.Object
   Dynamicweb.Extensibility.NotificationArgs
      Dynamicweb.Notifications.Standard.Paragraph.ParagraphModuleNotificationArgs

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Standard.Paragraph.ParagraphModuleNotificationArgs Members
Dynamicweb.Notifications Namespace

Send Feedback