示例#1
0
        static Mediator CreateMediator(IMediatorTarget target, Type targetType)
        {
            Mediator m = (Mediator)Activator.CreateInstance(ClassMediatorMappings [targetType], target);

            DIUtil.InjectProps(m as IInjectingTarget);
            MediatorAssignments [target] = m;
            m.Register();
            return(m);
        }
示例#2
0
        public void Invoke(InvokerArgs args = null)
        {
            foreach (Type command in CommandTypes)
            {
                Command c = (Command)Activator.CreateInstance(command);
                DIUtil.InjectProps(c);
                c.Execute(args);
            }

            Invoked(this, new InvokedEventArgs(args));
        }
示例#3
0
        public virtual void Invoke(InvokerArgs args = null)
        {
            foreach (Type command in CommandTypes)
            {
                Command c = (Command)Activator.CreateInstance(command);
                DIUtil.InjectProps(c);

                if (c.Detained)
                {
                    c.Released += HandleCommandRelease;
                    detainedCommands.Add(c);
                }

                c.Execute(args);
            }

            Invoked(this, new InvokedEventArgs(args));
        }
示例#4
0
 void InjectPropsFromDI()
 {
     DIUtil.InjectProps(this);
 }