Exemplo n.º 1
0
        public void Reflect(RunInvokerTree tree, RunInvokerVertex parent, Type t)
        {
            FailedLoadingRunInvoker invoker = new FailedLoadingRunInvoker(
                this,
                this.exception
                );

            tree.AddChild(parent, invoker);
        }
Exemplo n.º 2
0
        protected virtual void PopulateInvokerTree(
            RunInvokerTree tree,
            RunInvokerVertex parent,
            Type t
            )
        {
            if (this.AllowMultiple)
            {
                foreach (MethodInfo mi in
                         TypeHelper.GetAttributedMethods(t, this.AttributeType))
                {
                    try
                    {
                        if (this.Checker != null)
                        {
                            this.Checker.Check(mi);
                        }

                        IRunInvoker      invoker = InstanceInvoker(mi);
                        RunInvokerVertex child   =
                            tree.AddChild(parent, invoker);
                    }
                    catch (Exception ex)
                    {
                        FailedLoadingRunInvoker invoker = new FailedLoadingRunInvoker(
                            this, ex);
                        tree.AddChild(parent, invoker);
                    }
                }
            }
            else
            {
                try
                {
                    MethodInfo mi = TypeHelper.GetAttributedMethod(t, this.AttributeType);
                    if (this.Checker != null)
                    {
                        this.Checker.Check(mi);
                    }

                    tree.AddChild(parent, new MethodRunInvoker(this, mi));
                }
                catch (Exception ex)
                {
                    FailedLoadingRunInvoker invoker = new FailedLoadingRunInvoker(
                        this, ex);
                    tree.AddChild(parent, invoker);
                }
            }
        }
Exemplo n.º 3
0
        public void CallFailedLoading()
        {
            FailedLoadingRunInvoker invoker = new FailedLoadingRunInvoker(new MockRun(), new Exception());

            invoker.Execute(null, new ArrayList());
        }