Пример #1
0
        public override void Execute(params object[] executeArgs)
        {
            conditionalTree = new ConditionalTree();
            ConditionalTreeNode node = new ConditionalTreeNode();

            conditionalTree.RootNode = node;

            IScriptCommand lastCommand = null;

            foreach (var subCommand in SubCommands)
            {
                if (subCommand is ConditionalCheckScriptCommand)
                {
                    if (!(lastCommand is ConditionalCheckScriptCommand))
                    {
                        ConditionalTreeNode newNode = new ConditionalTreeNode();
                        newNode.Statements.Add(subCommand);
                        node.SubNodes.Add(newNode);
                        node = newNode;
                    }
                    else
                    {
                        node.Conditions.Add(subCommand);
                    }
                }
                else
                {
                    node.Statements.Add(subCommand);
                }

                lastCommand = subCommand;
            }

            conditionalTree.Execute(executeArgs);
        }
Пример #2
0
 public ConditionalTree()
 {
     RootNode = new ConditionalTreeNode();
 }