コード例 #1
0
        public void GenerateSubjects(TypeContext typeContext)
        {
            var types = typeContext.ClassMethodList.Keys;
            var invokerObjects = new ObjectFactory().GenerateObjects(typeof(SubjectAttribute), types);

            _subjects = invokerObjects.Select(SubjectProxy.Create).ToList();
        }
コード例 #2
0
        public void GenerateObserver(TypeContext typeContext)
        {
            var registerMethods = typeContext.OnlyMethodsWithAttribute(typeof(RegisterObserverAttribute));
            var observerInterfaces = new List<Type>();
            registerMethods.ClassMethodList.Values.ToList().ForEach(m =>
            {
                var parameterType = m.First().GetParameters().First().ParameterType;
                if (!parameterType.IsInterface) throw new ArgumentException("Parameter is no interface");
                observerInterfaces.Add(parameterType);
            });

            _observerProxies = observerInterfaces.Select(ObserverProxy.Create).ToList();
        }
コード例 #3
0
        public void GenerateCommands(TypeContext typeContext)
        {
            var onlyMethodsWithAttribute = typeContext.OnlyMethodsWithAttribute(typeof (InvokeCommandAttribute));
            var invokerInterfaces = new List<Type>();
            onlyMethodsWithAttribute.ClassMethodList.Values.ToList().ForEach(m =>
            {
                var parameterType = m.First().GetParameters().First().ParameterType;
                if(!parameterType.IsInterface) throw new ArgumentException("Parameter is no interface");
                invokerInterfaces.Add(parameterType);
            });

            _commands = invokerInterfaces.Select(CommandProxy.Create).ToList();
        }
コード例 #4
0
 public CommandSteps(TypeContext typeContext, CommandDriver commandDriver) : base(typeContext)
 {
     _typeContext = typeContext;
     _commandDriver = commandDriver;
 }
コード例 #5
0
 public ObserverSteps(ObserverDriver observerContext, TypeContext typeContext) : base(typeContext)
 {
     _observerContext = observerContext;
     _typeContext = typeContext;
 }
コード例 #6
0
 public TypeContextSteps(TypeContext typeContext)
 {
     _typeContext = typeContext;
 }
コード例 #7
0
 public TypeContextSteps(TypeContext typeContext)
 {
     _typeContext = typeContext;
 }
コード例 #8
0
 public void GenerateSingletons(TypeContext typeContext)
 {
     _singletons = typeContext.ClassMethodList.Keys.Select(SingletonProxy.Generate).ToList();
 }
コード例 #9
0
 public SingletonSteps(SingletonDriver singletonDriver, TypeContext typeContext) : base(typeContext)
 {
     _singletonDriver = singletonDriver;
     _typeContext = typeContext;
 }