Exemplo n.º 1
0
 public void Push(ActivationImpuls impuls)
 {
     if (m_target != null && m_target.Enabled)
     {
         m_target.Execute(impuls);
     }
 }
Exemplo n.º 2
0
        public override void Execute(ActivationImpuls impuls)
        {
            if (Monitor.TryEnter(m_lock))
            {
                bool successResult = false;

                while (Load() || Unload())
                {
                    successResult = true;
                }

                impuls.Result = successResult ? ImpulsResult.ExecSuccess : ImpulsResult.ExecFailed;

                Monitor.Exit(m_lock);
            }
            else
            {
                impuls.Result = ImpulsResult.EnterFailed;
            }
        }
Exemplo n.º 3
0
        public override void Execute(ActivationImpuls impuls)
        {
            if (Monitor.TryEnter(m_lock))
            {
                bool successResult;
                do
                {
                    successResult = false;

                    if (!load && !work && !unload)
                    {
                        load = Load();
                    }

                    if (load && !work && !unload)
                    {
                        work = Work();
                    }

                    if (load && work && !unload)
                    {
                        unload = Unload();
                    }

                    if (load && work && unload)
                    {
                        successResult = true;
                        unload        = work = load = false;
                    }
                }while (successResult);

                impuls.Result = successResult ? ImpulsResult.ExecSuccess : ImpulsResult.ExecFailed;

                Monitor.Exit(m_lock);
            }
            else
            {
                impuls.Result = ImpulsResult.EnterFailed;
            }
        }
Exemplo n.º 4
0
 public virtual void Execute(ActivationImpuls impuls)
 {
 }