Пример #1
0
 protected override void ExecuteTask()
 {
     if ((this.ConditionsTrue))
     {
         this.Then.Execute();
     }
     else
     {
         bool Executed = false;
         TaskContainerCollection ElseIfList = new TaskContainerCollection();
         ElseIfList.AddRange(this.ElseIfs);
         ElseIfList.AddRange(this.OldElseIf);
         foreach (TaskContainer Possible in ElseIfList)
         {
             if (Possible.IfDefined)
             {
                 Possible.Execute();
                 Executed = true;
                 break;
             }
         }
         if (!Executed & this.Else != null)
         {
             this.Else.Execute();
         }
     }
 }
Пример #2
0
 protected override void ExecuteTask()
 {
     if ((this.ConditionsTrue))
     {
         this.Then.Execute();
     }
     else
     {
         bool Executed = false;
         foreach (TaskContainer Possible in this.ElseIf)
         {
             if (Possible.IfDefined)
             {
                 Possible.Execute();
                 Executed = true;
             }
         }
         if (!Executed & this.Else != null)
         {
             this.Else.Execute();
         }
     }
 }
Пример #3
0
        protected override void ExecuteTask()
        {
            if ((this.ConditionsTrue))
            {
                this.Then.Execute();
            }
            else
            {
                bool Executed = false;

                foreach (TaskContainer Possible in this.OldElseIf)
                {
                    if (Possible.IfDefined)
                    {
                        Possible.Execute();
                        Executed = true;
                        break;
                    }
                }

                foreach (IfTask ifTask in this.ElseIfs)
                {
                    if (bool.Parse(ifTask.Test))
                    {
                        ifTask.Execute();
                        Executed = true;
                        break;
                    }
                }

                if (!Executed & this.Else != null)
                {
                    this.Else.Execute();
                }
            }
        }