Exemplo n.º 1
0
        public override void Reflect(RunInvokerTree tree, RunInvokerVertex parent, Type t)
        {
            foreach (MethodInfo method in TypeHelper.GetAttributedMethods(t, typeof(RepeatTestAttribute)))
            {
                try
                {
                    foreach (RepeatTestAttribute rep in method.GetCustomAttributes(typeof(RepeatTestAttribute), true))
                    {
                        for (int i = 0; i < rep.Count; i++)
                        {
                            // Get invoker
                            IRunInvoker invoker = new RepeatMethodRunInvoker(this, method, i + 1);

                            // Decorate invoker
                            invoker = DecoratorPatternAttribute.DecoreInvoker(method, invoker);

                            // Add to tree
                            tree.AddChild(parent, invoker);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MethodFailedLoadingRunInvoker invoker = new MethodFailedLoadingRunInvoker(this, ex, method);
                    tree.AddChild(parent, invoker);
                }
            }
        }
Exemplo n.º 2
0
        public override void Reflect(RunInvokerTree tree, RunInvokerVertex parent, Type t)
        {
            foreach (MethodInfo method in TypeHelper.GetAttributedMethods(t, typeof(RepeatTestAttribute)))
            {
                try
                {
                    foreach (RepeatTestAttribute rep in method.GetCustomAttributes(typeof(RepeatTestAttribute), true))
                    {
                        for (int i = 0; i < rep.Count; i++)
                        {
                            // Get invoker
                            IRunInvoker invoker = new RepeatMethodRunInvoker(this, method, i + 1);

                            // Decorate invoker
                            invoker = DecoratorPatternAttribute.DecoreInvoker(method, invoker);

                            // Add to tree
                            tree.AddChild(parent, invoker);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MethodFailedLoadingRunInvoker invoker = new MethodFailedLoadingRunInvoker(this, ex, method);
                    tree.AddChild(parent, invoker);
                }
            }
        }