Dynamicweb 8 Documentation
Standard.Paragraph.OnBeforeRenderArgs Class
Members  Example 

Provides information about the paragraph before render.
Object Model
Standard.Paragraph.OnBeforeRenderArgs ClassTemplate Class
Syntax
'Declaration
 
Public Class Standard.Paragraph.OnBeforeRenderArgs 
   Inherits Dynamicweb.Extensibility.NotificationArgs
public class Standard.Paragraph.OnBeforeRenderArgs : Dynamicweb.Extensibility.NotificationArgs 
Remarks
Arguments passed to Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRender notification
Example
Overriding on before render the paragraph in DynamicwebOverriding on before render the paragraph in Dynamicweb
namespace Dynamicweb.Examples.CSharp.Notifications.Standard
{
    [Extensibility.Subscribe(Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRender)]
    public class ParagraphOnBeforeRenderObserver : Dynamicweb.Extensibility.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
        {
            if (args == null)
                return;

            Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRenderArgs item = (Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRenderArgs)args;
            //Change paragrpah template html
            item.ParagraphTemplate.Html = string.Format("Paragraph ID:{0}<fieldset>{1}</fieldset>", item.Paragraph.Paragraph.ParagraphID, item.ParagraphTemplate.Html);
        }
    }
}

Namespace Notifications.Standard
    <Extensibility.Subscribe(Global.Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRender)> _
    Public Class ParagraphOnBeforeRenderObserver
        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

            Dim item As Global.Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRenderArgs = DirectCast(args, Global.Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRenderArgs)
            'Change paragrpah template html
            item.ParagraphTemplate.Html = String.Format("Paragraph ID:{0}&lt;fieldset&gt;{1}&lt;/fieldset&gt;", item.Paragraph.Paragraph.ParagraphID, item.ParagraphTemplate.Html)
        End Sub
    End Class
End Namespace
Inheritance Hierarchy

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

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.OnBeforeRenderArgs Members
Dynamicweb.Notifications Namespace

Send Feedback