protected override void OnNodeCopied(object sender, NodeOperationEventArgs e) { bool invalidated = OnInvalidate(sender, e.SourceNode); if (!invalidated) OnInvalidate(sender, e.TargetNode); }
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); }
protected override void OnNodeMoved(object sender, NodeOperationEventArgs e) { OnInvalidate(sender, e.SourceNode.Path); OnInvalidate(sender, e.TargetNode.Path); }
protected virtual void OnNodeCopied(object sender, NodeOperationEventArgs e) { }
internal static void FireOnNodeCopied(EventHandler <NodeOperationEventArgs> Copied, Node sender, NodeOperationEventArgs e, List <Type> disabledObservers) { InvokeEventHandlers <NodeOperationEventArgs>(Copied, sender, e); var observers = NodeTypeManager.Current.NodeObservers; if (observers == null) { return; } if (disabledObservers == null) { foreach (NodeObserver observer in observers) { observer.OnNodeCopied(sender, e); } } else { foreach (NodeObserver observer in observers) { if (!disabledObservers.Contains(observer.GetType())) { observer.OnNodeCopied(sender, e); } } } }
protected internal virtual void OnNodeMoved(object sender, NodeOperationEventArgs e) { }
internal static void FireOnNodeCopied(EventHandler <NodeOperationEventArgs> Copied, Node sender, NodeOperationEventArgs e, List <Type> disabledObservers) { InvokeEventHandlers <NodeOperationEventArgs>(Copied, sender, e); FireNodeEvent(disabledObservers, observer => { observer.OnNodeCopied(sender, e); }); }
protected override void OnNodeMoved(object sender, NodeOperationEventArgs e) { SNScriptDependencyCache.Instance.RemovePath(e.OriginalSourcePath); }
internal static void FireOnNodeMoved(EventHandler <NodeOperationEventArgs> Moved, Node sender, NodeOperationEventArgs e, List <Type> disabledObservers) { InvokeEventHandlers <NodeOperationEventArgs>(Moved, sender, e); var observers = Providers.Instance.NodeObservers; if (observers == null) { return; } if (disabledObservers == null) { foreach (NodeObserver observer in observers) { observer.OnNodeMoved(sender, e); } } else { foreach (NodeObserver observer in observers) { if (!disabledObservers.Contains(observer.GetType())) { observer.OnNodeMoved(sender, e); } } } }
protected override void OnNodeMoved(object sender, NodeOperationEventArgs e) { RouteEvent(RepositoryEvent.Moved, sender, e.SourceNode); }
protected override void OnNodeMoved(object sender, NodeOperationEventArgs e) { base.OnNodeMoved(sender, e); if (e.OriginalSourcePath.StartsWith(SkinObserver.SkinStartPath)) SkinManager.Instance.RemoveFromMap(e.OriginalSourcePath); if (e.TargetNode.Path.StartsWith(SkinObserver.SkinStartPath)) { var targetPath = RepositoryPath.Combine(e.TargetNode.Path, e.SourceNode.Name); SkinManager.Instance.AddToMap(targetPath); } }
protected override void OnNodeCopied(object sender, NodeOperationEventArgs e) { Log(e, null, e.TargetNode); }
protected override void OnNodeMoved(object sender, NodeOperationEventArgs e) { Log(e, e.OriginalSourcePath, e.TargetNode); }
protected override void OnNodeMoved(object sender, NodeOperationEventArgs e) { base.OnNodeMoved(sender, e); InvalidateCache(sender, e); }