Table of Contents

Class CommentNotification

Namespace
Dynamicweb.Notifications
Assembly
Dynamicweb.dll

Notifications for comment module

public sealed class CommentNotification
Inheritance
CommentNotification
Inherited Members

Fields

OnAfterComment

On after comment notification. Occurs on submit of new comments - after the data is in the Comment instance

public const string OnAfterComment = "OnAfterComment"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;
using Dynamicweb.Notifications;

namespace Dynamicweb.Examples.Notifications
{
    [Subscribe(CommentNotification.OnAfterComment)]
    public class OnAfterCommentObserver : NotificationSubscriber
    {
        public override void OnNotify(string notification, NotificationArgs args)
        {
            var commentArgs = args as CommentNotification.CommentArgs;

            //Add code here
        }
    }
}

Remarks

OnAfterSave

Comment after save notification. Occurs just after a comment is saved

public const string OnAfterSave = "OnAfterSave"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;
using Dynamicweb.Notifications;

namespace Dynamicweb.Examples.Notifications
{
    [Subscribe(CommentNotification.OnAfterSave)]
    public class OnAfterSaveObserver : NotificationSubscriber
    {
        public override void OnNotify(string notification, NotificationArgs args)
        {
            var commentArgs = args as CommentNotification.CommentArgs;

            //Add code here
        }
    }
}

Remarks

OnBeforeComment

On before comment notification. Occurs on submit of new comments - before the data is saved

public const string OnBeforeComment = "OnBeforeComment"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;
using Dynamicweb.Notifications;

namespace Dynamicweb.Examples.Notifications
{
    [Subscribe(CommentNotification.OnBeforeComment)]
    public class OnBeforeCommentObserver : NotificationSubscriber
    {
        public override void OnNotify(string notification, NotificationArgs args)
        {
            var commentArgs = args as CommentNotification.CommentArgs;

            //Add code here
        }
    }
}

Remarks

OnBeforeRenderComment

Comment before rendering notification. Occurs just before a comment is rendered in the list

public const string OnBeforeRenderComment = "CommentOnBeforeRenderComment"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;
using Dynamicweb.Notifications;

namespace Dynamicweb.Examples.Notifications
{
    [Subscribe(CommentNotification.OnBeforeRenderComment)]
    public class OnBeforeRenderCommentObserver : NotificationSubscriber
    {
        public override void OnNotify(string notification, NotificationArgs args)
        {
           var onBeforeRenderCommentArgs = args as CommentNotification.OnBeforeRenderCommentArgs;

            //Add code here
        }
    }
}

Remarks

OnBeforeRenderComments

Comments before rendering notification. Occurs just before comments are rendered

public const string OnBeforeRenderComments = "CommentOnBeforeRenderComments"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;
using Dynamicweb.Notifications;

namespace Dynamicweb.Examples.Notifications
{
    [Subscribe(CommentNotification.OnBeforeRenderComments)]
    public class OnBeforeRenderCommentsObserver : NotificationSubscriber
    {
        public override void OnNotify(string notification, NotificationArgs args)
        {
            var onBeforeRenderCommentsArgs = args as CommentNotification.OnBeforeRenderCommentsArgs;

            //Add code here
        }
    }
}

Remarks

OnBeforeSave

Comment before save notification. Occurs just before a comment is saved

public const string OnBeforeSave = "OnBeforeSave"

Field Value

string

Examples

using Dynamicweb.Extensibility.Notifications;
using Dynamicweb.Notifications;

namespace Dynamicweb.Examples.Notifications
{
    [Subscribe(CommentNotification.OnBeforeSave)]
    public class OnBeforeSaveObserver : NotificationSubscriber
    {
        public override void OnNotify(string notification, NotificationArgs args)
        {
            var commentArgs = args as CommentNotification.CommentArgs;            

            //Add code here
        }
    }
}

Remarks

To top