Beispiel #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);
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #4
0
 void InjectPropsFromDI()
 {
     DIUtil.InjectProps(this);
 }