Skip to content

Commit

Permalink
Begin Loop Command
Browse files Browse the repository at this point in the history
  • Loading branch information
openbots-ff committed Mar 18, 2020
1 parent b6ab704 commit d5644a4
Show file tree
Hide file tree
Showing 7 changed files with 966 additions and 5 deletions.
958 changes: 958 additions & 0 deletions taskt/Core/Automation/Commands/BeginLoopCommand.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions taskt/Core/Automation/Commands/ScriptCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ namespace taskt.Core.Automation.Commands
[XmlInclude(typeof(BeginListLoopCommand))]
[XmlInclude(typeof(NextLoopCommand))]
[XmlInclude(typeof(BeginContinousLoopCommand))]
[XmlInclude(typeof(BeginLoopCommand))]
[XmlInclude(typeof(SequenceCommand))]
[XmlInclude(typeof(StopTaskCommand))]
[XmlInclude(typeof(RunTaskCommand))]
Expand Down
2 changes: 1 addition & 1 deletion taskt/Core/Automation/Engine/AutomationEngineInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public void ExecuteCommand(Core.Script.ScriptAction command)
try
{
//determine type of command
if ((parentCommand is Core.Automation.Commands.BeginNumberOfTimesLoopCommand) || (parentCommand is Core.Automation.Commands.BeginContinousLoopCommand) || (parentCommand is Core.Automation.Commands.BeginListLoopCommand) || (parentCommand is Core.Automation.Commands.BeginIfCommand) || (parentCommand is Core.Automation.Commands.BeginMultiIfCommand) || (parentCommand is Core.Automation.Commands.BeginExcelDatasetLoopCommand) || (parentCommand is Commands.TryCommand))
if ((parentCommand is Core.Automation.Commands.BeginNumberOfTimesLoopCommand) || (parentCommand is Core.Automation.Commands.BeginContinousLoopCommand) || (parentCommand is Core.Automation.Commands.BeginListLoopCommand) || (parentCommand is Core.Automation.Commands.BeginIfCommand) || (parentCommand is Core.Automation.Commands.BeginMultiIfCommand) || (parentCommand is Core.Automation.Commands.BeginExcelDatasetLoopCommand) || (parentCommand is Commands.TryCommand) || (parentCommand is Core.Automation.Commands.BeginLoopCommand))
{
//run the command and pass bgw/command as this command will recursively call this method for sub commands
parentCommand.RunCommand(this, command);
Expand Down
2 changes: 1 addition & 1 deletion taskt/Core/Script.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static Script SerializeScript(ListView.ListViewItemCollection scriptComma
var command = (Core.Automation.Commands.ScriptCommand)commandItem.Tag;
command.LineNumber = lineNumber;

if ((command is Core.Automation.Commands.BeginNumberOfTimesLoopCommand) || (command is Core.Automation.Commands.BeginContinousLoopCommand) || (command is Core.Automation.Commands.BeginListLoopCommand) || (command is Core.Automation.Commands.BeginIfCommand) || (command is Core.Automation.Commands.BeginMultiIfCommand) || (command is Core.Automation.Commands.BeginExcelDatasetLoopCommand) || (command is Core.Automation.Commands.TryCommand))
if ((command is Core.Automation.Commands.BeginNumberOfTimesLoopCommand) || (command is Core.Automation.Commands.BeginContinousLoopCommand) || (command is Core.Automation.Commands.BeginListLoopCommand) || (command is Core.Automation.Commands.BeginIfCommand) || (command is Core.Automation.Commands.BeginMultiIfCommand) || (command is Core.Automation.Commands.BeginExcelDatasetLoopCommand) || (command is Core.Automation.Commands.TryCommand) || (command is Core.Automation.Commands.BeginLoopCommand))
{
if (subCommands.Count == 0) //if this is the first loop
{
Expand Down
1 change: 1 addition & 0 deletions taskt/UI/CustomControls/CustomControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ public static Dictionary<string, Image> UIImageDictionary()
uiImages.Add("BeginContinousLoopCommand", taskt.Properties.Resources.command_startloop);
uiImages.Add("BeginExcelDatasetLoopCommand", taskt.Properties.Resources.command_startloop);
uiImages.Add("BeginNumberOfTimesLoopCommand", taskt.Properties.Resources.command_startloop);
uiImages.Add("BeginLoopCommand", taskt.Properties.Resources.command_startloop);
uiImages.Add("ExitLoopCommand", taskt.Properties.Resources.command_exitloop);
uiImages.Add("SequenceCommand", taskt.Properties.Resources.command_sequence);
uiImages.Add("ReadTextFileCommand", taskt.Properties.Resources.command_files);
Expand Down
6 changes: 3 additions & 3 deletions taskt/UI/Forms/frmScriptBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ public void AddCommandToListView(Core.Automation.Commands.ScriptCommand selected
lstScriptActions.Items.Insert(insertionIndex, command);

//special types also get a following command and comment
if ((selectedCommand is Core.Automation.Commands.BeginExcelDatasetLoopCommand) || (selectedCommand is Core.Automation.Commands.BeginListLoopCommand) || (selectedCommand is Core.Automation.Commands.BeginContinousLoopCommand) || (selectedCommand is Core.Automation.Commands.BeginNumberOfTimesLoopCommand))
if ((selectedCommand is Core.Automation.Commands.BeginExcelDatasetLoopCommand) || (selectedCommand is Core.Automation.Commands.BeginListLoopCommand) || (selectedCommand is Core.Automation.Commands.BeginContinousLoopCommand) || (selectedCommand is Core.Automation.Commands.BeginNumberOfTimesLoopCommand) || (selectedCommand is Core.Automation.Commands.BeginLoopCommand))
{
lstScriptActions.Items.Insert(insertionIndex + 1, CreateScriptCommandListViewItem(new Core.Automation.Commands.CommentCommand() { v_Comment = "Items in this section will run within the loop" }));
lstScriptActions.Items.Insert(insertionIndex + 2, CreateScriptCommandListViewItem(new Core.Automation.Commands.EndLoopCommand()));
Expand Down Expand Up @@ -933,7 +933,7 @@ private void IndentListViewItems()
continue;
}

if ((rowItem.Tag is Core.Automation.Commands.BeginIfCommand) || (rowItem.Tag is Core.Automation.Commands.BeginMultiIfCommand) || (rowItem.Tag is Core.Automation.Commands.BeginExcelDatasetLoopCommand) || (rowItem.Tag is Core.Automation.Commands.BeginListLoopCommand) || (rowItem.Tag is Core.Automation.Commands.BeginContinousLoopCommand) || (rowItem.Tag is Core.Automation.Commands.BeginNumberOfTimesLoopCommand) || (rowItem.Tag is Core.Automation.Commands.TryCommand))
if ((rowItem.Tag is Core.Automation.Commands.BeginIfCommand) || (rowItem.Tag is Core.Automation.Commands.BeginMultiIfCommand) || (rowItem.Tag is Core.Automation.Commands.BeginExcelDatasetLoopCommand) || (rowItem.Tag is Core.Automation.Commands.BeginListLoopCommand) || (rowItem.Tag is Core.Automation.Commands.BeginContinousLoopCommand) || (rowItem.Tag is Core.Automation.Commands.BeginNumberOfTimesLoopCommand) || (rowItem.Tag is Core.Automation.Commands.TryCommand) || (rowItem.Tag is Core.Automation.Commands.BeginLoopCommand))
{
indent += 2;
rowItem.IndentCount = indent;
Expand Down Expand Up @@ -1491,7 +1491,7 @@ private void SaveToFile(bool saveAs)
int tryCatchValidationCount = 0;
foreach (ListViewItem item in lstScriptActions.Items)
{
if ((item.Tag is Core.Automation.Commands.BeginExcelDatasetLoopCommand) || (item.Tag is Core.Automation.Commands.BeginListLoopCommand) || (item.Tag is Core.Automation.Commands.BeginContinousLoopCommand) ||(item.Tag is Core.Automation.Commands.BeginNumberOfTimesLoopCommand))
if ((item.Tag is Core.Automation.Commands.BeginExcelDatasetLoopCommand) || (item.Tag is Core.Automation.Commands.BeginListLoopCommand) || (item.Tag is Core.Automation.Commands.BeginContinousLoopCommand) ||(item.Tag is Core.Automation.Commands.BeginNumberOfTimesLoopCommand) || (item.Tag is Core.Automation.Commands.BeginLoopCommand))
{
beginLoopValidationCount++;
}
Expand Down
1 change: 1 addition & 0 deletions taskt/taskt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
<Compile Include="Core\ApplicationUpdate.cs" />
<Compile Include="Core\ApplicationSettings.cs" />
<Compile Include="Core\Automation\Commands\AddDictionaryCommand.cs" />
<Compile Include="Core\Automation\Commands\BeginLoopCommand.cs" />
<Compile Include="Core\Automation\Commands\CreateDictionaryCommand.cs" />
<Compile Include="Core\Automation\Commands\BeginMutliIfCommand.cs" />
<Compile Include="Core\Automation\Commands\CreateFolderCommand.cs" />
Expand Down

0 comments on commit d5644a4

Please sign in to comment.