コード例 #1
0
        protected override IEnumerable <int> GetInterestingElementIds(IContainerElement element)
        {
            IMacroCommand c = element.InnerElement as IMacroCommand;

            yield return(c.Id);

            if (c.Condition != null)
            {
                yield return(c.Condition.ConditionalId);
            }
            IWaitConditionCommand wc = c as IWaitConditionCommand;

            if (wc != null && wc.AwaitedCondition != null)
            {
                yield return(wc.AwaitedCondition.ConditionalId);
            }
            IStartCommand sc = c as IStartCommand;

            if (sc != null)
            {
                yield return(sc.StartedElementId);
            }
            IStopCommand sc2 = c as IStopCommand;

            if (sc2 != null)
            {
                yield return(sc2.StoppedElementId);
            }
        }
コード例 #2
0
 public void VisitStopCommand(IStopCommand stopCommand)
 {
     CheckCondition(stopCommand);
     if (stopCommand.StoppedElement == null || Data.DataModule.ElementRepository.GetElement(stopCommand.StoppedElement.Id) == null)
     {
         AddError(m_ModelErrors, ModelError.ErrorSeverity.Error, StringResources.StoppedElementNotFound, stopCommand);
     }
 }
コード例 #3
0
ファイル: MacroPlayer.cs プロジェクト: monstrim/Ares
 public void VisitStopCommand(IStopCommand stopCommand)
 {
     if (Client.Stopped)
     {
         return;
     }
     if (IsConditionFulfilled(stopCommand.Condition))
     {
         if (MacroPlayers.Instance.IsElementRunning(stopCommand.StoppedElementId))
         {
             PlayingModule.ProjectPlayer.SwitchElement(stopCommand.StoppedElementId);
         }
     }
 }
コード例 #4
0
ファイル: Service.cs プロジェクト: elpollouk/servie
        // Parse tthe stop command
        private void ParseStop(XElement node)
        {
            foreach (XElement n in node.Descendants())
            {
                if (n.Name == "signal")
                {
                    // Send a signal to the child process
                    m_StopCommand = new StoppieStopCommand(n.Value);
                    break;
                }
                else if (n.Name == "kill")
                {
                    // Plain old kill of the child process
                    m_StopCommand = new KillStopCommand();
                    break;
                }
                else if (n.Name == "exec")
                {
                    // Execute an external command to stop the child process
                    Process         stopCommand = null;
                    ExecStopCommand esc         = m_StopCommand as ExecStopCommand;

                    // Check if we already have a stop command so that we can update it with this parsed info
                    if (esc == null)
                    {
                        stopCommand   = CreateStandardProccess();
                        m_StopCommand = new ExecStopCommand(stopCommand);
                    }
                    else
                    {
                        stopCommand = esc.Command;
                    }

                    ParseExec(stopCommand.StartInfo, n);

                    break;
                }
            }

            XElement x;

            // Time out before prompting to kill the process
            x = node.Element("timeout");
            if (x != null)
            {
                m_StopTimeOut = int.Parse(x.Value);
            }
        }