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);
}