Ejemplo n.º 1
0
        protected override HandlerBase DoCreate(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionConfiguration c)
        {
            var a = c.GetType().GetTypeInfo().GetCustomAttribute <HandlerTypeAttribute>();

            if (a == null)
            {
                throw new CKException("A [HandlerType(typeof(H))] attribute (where H is a CK.Monitoring.GrandOutputHandlers.HandlerBase class) is missing on class '{0}'.", c.GetType().FullName);
            }
            return((HandlerBase)Activator.CreateInstance(a.HandlerType, c));
        }
Ejemplo n.º 2
0
            protected override ITestIt DoCreate(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionConfiguration c)
            {
                ActionTypeAttribute a = c.GetType().GetTypeInfo().GetCustomAttribute <ActionTypeAttribute>();

                return((ITestIt)Activator.CreateInstance(a.ActionType, monitor, c));
            }