SenseNet.Messaging.Event.CreateAndSave C# (CSharp) Method

CreateAndSave() public static method

public static CreateAndSave ( string contentPath, int creatorId, int lastModifierId, NotificationType type, string who ) : void
contentPath string
creatorId int
lastModifierId int
type NotificationType
who string
return void
        public static void CreateAndSave(string contentPath, int creatorId, int lastModifierId, NotificationType type, string who)
        {
            CreateAndSave(contentPath, creatorId, lastModifierId, type, who, null);
        }
        internal static void CreateAndSave(string contentPath, int creatorId, int lastModifierId, NotificationType type, string who, DateTime? when)

Same methods

Event::CreateAndSave ( System.Data.Node node, NotificationType type, string who ) : void
Event::CreateAndSave ( string contentPath, int creatorId, int lastModifierId, NotificationType type, string who, System.DateTime when ) : void

Usage Example

        protected override void OnNodeMoved(object sender, NodeOperationEventArgs e)
        {
            if (!Configuration.Enabled)
            {
                return;
            }

            var currentUser    = User.Current;
            var srcnode        = e.SourceNode;
            var creatorId      = srcnode.CreatedById;
            var lastModifierId = currentUser.Id;
            var who            = GetUserName(currentUser);

            if (IsInTrash(e.OriginalSourcePath))
            {
                Event.CreateAndSave(srcnode.Path, creatorId, lastModifierId, NotificationType.Restored, who);
                return;
            }
            if (IsInTrash(srcnode.Path))
            {
                Event.CreateAndSave(e.OriginalSourcePath, creatorId, lastModifierId, NotificationType.Deleted, who);
                return;
            }
            Event.CreateAndSave(e.OriginalSourcePath, creatorId, lastModifierId, NotificationType.MovedTo, who);
            Event.CreateAndSave(srcnode.Path, creatorId, lastModifierId, NotificationType.MovedFrom, who);
        }
All Usage Examples Of SenseNet.Messaging.Event::CreateAndSave