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