Inheritance: RepositoryEventArgs
 private void RouteCancelEvent(RepositoryCancelEvent @event, object sender, Node contextNode, CancellableNodeEventArgs originalArgs)
 {
     var args = new RepositoryCancelEventArgs(contextNode);
     @event.FireEvent(sender, args);
     originalArgs.Cancel = args.Cancel;
     originalArgs.CancelMessage = args.CancelMessage;
 }
Beispiel #2
0
        private void RouteCancelEvent(RepositoryCancelEvent @event, object sender, Node contextNode, CancellableNodeEventArgs originalArgs)
        {
            var args = new RepositoryCancelEventArgs(contextNode);

            @event.FireEvent(sender, args);
            originalArgs.Cancel        = args.Cancel;
            originalArgs.CancelMessage = args.CancelMessage;
        }
        public void FireEvent(object sender, RepositoryCancelEventArgs args)
        {
            var eventHandlers = FindEventHandlerNodes(args.ContextNode);

            base.Fire <RepositoryCancelEventHandler, RepositoryCancelEventArgs>(eventHandlers, sender, args);
        }
Beispiel #4
0
        public override void HandleEvent(object sender, RepositoryCancelEventArgs e)
        {
            if (RepositoryEventFired != null)
                RepositoryEventFired(this, new TestRepositoryEventArgs { ContextPath = e.ContextNode.Path });

            if (this.Name.EndsWith("AppEx"))
                throw new ApplicationException("AppEx");
            if (this.Name.EndsWith("NullRefEx"))
                throw new NullReferenceException("NullRefEx");
            if (this.Name.EndsWith("Ex"))
                throw new Exception("Ex");

            if (this.Name.EndsWith("Cancel"))
            {
                e.Cancel = true;
                e.CancelMessage = this.Name;
                return;
            }
            if (this.Name.EndsWith("Handled"))
            {
                e.Handled = true;
                return;
            }
        }
 public abstract void HandleEvent(object sender, RepositoryCancelEventArgs e);
Beispiel #6
0
 public abstract void HandleEvent(object sender, RepositoryCancelEventArgs e);
Beispiel #7
0
 private void InvokeEventHandler(RepositoryCancelEventHandler eventHandler, object sender, RepositoryCancelEventArgs args, out bool cancel)
 {
     eventHandler.HandleEvent(sender, args);
     cancel = args.Cancel;
 }
 public void FireEvent(object sender, RepositoryCancelEventArgs args)
 {
     var eventHandlers = FindEventHandlerNodes(args.ContextNode);
     base.Fire<RepositoryCancelEventHandler, RepositoryCancelEventArgs>(eventHandlers, sender, args);
 }