Skip to content

Commit

Permalink
fix render data commands
Browse files Browse the repository at this point in the history
  • Loading branch information
rcktrncn committed Jul 31, 2021
1 parent 11b68b4 commit 1119920
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 67 deletions.
24 changes: 15 additions & 9 deletions taskt/Core/Automation/Commands/Data/ConvertListToJSONCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ public class ConvertListToJSONCommand : ScriptCommand
[Attributes.PropertyAttributes.InputSpecification("")]
[Attributes.PropertyAttributes.SampleUsage("**{{{vList}}}**")]
[Attributes.PropertyAttributes.Remarks("")]
[Attributes.PropertyAttributes.PropertyRecommendedUIControl(Attributes.PropertyAttributes.PropertyRecommendedUIControl.RecommendeUIControlType.ComboBox)]
[Attributes.PropertyAttributes.PropertyIsVariablesList(true)]
public string v_InputList { get; set; }

[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Please select the variable to receive the JSON")]
[Attributes.PropertyAttributes.InputSpecification("Select or provide a variable from the variable list")]
[Attributes.PropertyAttributes.SampleUsage("**vSomeVariable**")]
[Attributes.PropertyAttributes.Remarks("If you have enabled the setting **Create Missing Variables at Runtime** then you are not required to pre-define your variables, however, it is highly recommended.")]
[Attributes.PropertyAttributes.PropertyRecommendedUIControl(Attributes.PropertyAttributes.PropertyRecommendedUIControl.RecommendeUIControlType.ComboBox)]
[Attributes.PropertyAttributes.PropertyIsVariablesList(true)]
public string v_applyToVariableName { get; set; }

public ConvertListToJSONCommand()
Expand Down Expand Up @@ -77,15 +81,17 @@ public override List<Control> Render(frmCommandEditor editor)
base.Render(editor);

//create standard group controls
RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_InputList", this));
var TargetListControl = CommandControls.CreateStandardComboboxFor("v_InputList", this).AddVariableNames(editor);
RenderedControls.AddRange(CommandControls.CreateUIHelpersFor("v_InputList", this, new Control[] { TargetListControl }, editor));
RenderedControls.Add(TargetListControl);

RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_applyToVariableName", this));
var VariableNameControl = CommandControls.CreateStandardComboboxFor("v_applyToVariableName", this).AddVariableNames(editor);
RenderedControls.AddRange(CommandControls.CreateUIHelpersFor("v_applyToVariableName", this, new Control[] { VariableNameControl }, editor));
RenderedControls.Add(VariableNameControl);
//RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_InputList", this));
//var TargetListControl = CommandControls.CreateStandardComboboxFor("v_InputList", this).AddVariableNames(editor);
//RenderedControls.AddRange(CommandControls.CreateUIHelpersFor("v_InputList", this, new Control[] { TargetListControl }, editor));
//RenderedControls.Add(TargetListControl);

//RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_applyToVariableName", this));
//var VariableNameControl = CommandControls.CreateStandardComboboxFor("v_applyToVariableName", this).AddVariableNames(editor);
//RenderedControls.AddRange(CommandControls.CreateUIHelpersFor("v_applyToVariableName", this, new Control[] { VariableNameControl }, editor));
//RenderedControls.Add(VariableNameControl);

RenderedControls.AddRange(CommandControls.MultiCreateInferenceDefaultControlGroupFor(this, editor));

return RenderedControls;

Expand Down
37 changes: 23 additions & 14 deletions taskt/Core/Automation/Commands/Data/DateCalculationCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ namespace taskt.Core.Automation.Commands
public class DateCalculationCommand : ScriptCommand
{
[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Please supply the date value or variable (ex. {{{DateTime.Now}}})")]
[Attributes.PropertyAttributes.PropertyDescription("Please supply the date value or variable")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowVariableHelper)]
[Attributes.PropertyAttributes.InputSpecification("Specify either text or a variable that contains the start date.")]
[Attributes.PropertyAttributes.SampleUsage("{{{DateTime.Now}}}} or 1/1/2000")]
[Attributes.PropertyAttributes.SampleUsage("**{{{DateTime.Now}}}** or **1/1/2000**")]
[Attributes.PropertyAttributes.Remarks("You can use known text or variables.")]
[Attributes.PropertyAttributes.PropertyShowSampleUsageInDescription(true)]
public string v_InputValue { get; set; }

[XmlAttribute]
Expand All @@ -42,22 +43,26 @@ public class DateCalculationCommand : ScriptCommand
[Attributes.PropertyAttributes.PropertyUISelectionOption("Subtract Years")]
[Attributes.PropertyAttributes.InputSpecification("Select the necessary operation")]
[Attributes.PropertyAttributes.SampleUsage("Select From Add Seconds, Add Minutes, Add Hours, Add Days, Add Years, Subtract Seconds, Subtract Minutes, Subtract Hours, Subtract Days, Subtract Years ")]
[Attributes.PropertyAttributes.PropertyRecommendedUIControl(Attributes.PropertyAttributes.PropertyRecommendedUIControl.RecommendeUIControlType.ComboBox)]
public string v_CalculationMethod { get; set; }

[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Please supply the increment value (ex. 15, {{{vIncrement}}})")]
[Attributes.PropertyAttributes.PropertyDescription("Please supply the increment value")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowVariableHelper)]
[Attributes.PropertyAttributes.InputSpecification("Enter how many units to increment by")]
[Attributes.PropertyAttributes.SampleUsage("15, {{{vIncrement}}}")]
[Attributes.PropertyAttributes.Remarks("You can use negative numbers which will do the opposite, ex. Subtract Days and an increment of -5 will Add Days.")]
[Attributes.PropertyAttributes.PropertyShowSampleUsageInDescription(true)]
public string v_Increment { get; set; }

[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Optional - Specify String Format")]
[Attributes.PropertyAttributes.PropertyDescription("Specify String Format")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowVariableHelper)]
[Attributes.PropertyAttributes.InputSpecification("Specify if a specific string format is required.")]
[Attributes.PropertyAttributes.SampleUsage("MM/dd/yy, hh:mm, etc.")]
[Attributes.PropertyAttributes.SampleUsage("**MM/dd/yy** or **hh:mm** or etc.")]
[Attributes.PropertyAttributes.Remarks("")]
[Attributes.PropertyAttributes.PropertyShowSampleUsageInDescription(true)]
[Attributes.PropertyAttributes.PropertyIsOptional(true)]
public string v_ToStringFormat { get; set; }

[XmlAttribute]
Expand All @@ -66,6 +71,8 @@ public class DateCalculationCommand : ScriptCommand
[Attributes.PropertyAttributes.InputSpecification("Select or provide a variable from the variable list")]
[Attributes.PropertyAttributes.SampleUsage("**vSomeVariable**")]
[Attributes.PropertyAttributes.Remarks("If you have enabled the setting **Create Missing Variables at Runtime** then you are not required to pre-define your variables, however, it is highly recommended.")]
[Attributes.PropertyAttributes.PropertyRecommendedUIControl(Attributes.PropertyAttributes.PropertyRecommendedUIControl.RecommendeUIControlType.ComboBox)]
[Attributes.PropertyAttributes.PropertyIsVariablesList(true)]
public string v_applyToVariableName { get; set; }

public DateCalculationCommand()
Expand Down Expand Up @@ -152,18 +159,20 @@ public override List<Control> Render(frmCommandEditor editor)
base.Render(editor);

//create standard group controls
RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_InputValue", this, editor));
//RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_InputValue", this, editor));

RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_CalculationMethod", this));
RenderedControls.Add(CommandControls.CreateDropdownFor("v_CalculationMethod", this));
//RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_CalculationMethod", this));
//RenderedControls.Add(CommandControls.CreateDropdownFor("v_CalculationMethod", this));

RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_Increment", this, editor));
RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_ToStringFormat", this, editor));
//RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_Increment", this, editor));
//RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_ToStringFormat", this, editor));

RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_applyToVariableName", this));
var VariableNameControl = CommandControls.CreateStandardComboboxFor("v_applyToVariableName", this).AddVariableNames(editor);
RenderedControls.AddRange(CommandControls.CreateUIHelpersFor("v_applyToVariableName", this, new Control[] { VariableNameControl }, editor));
RenderedControls.Add(VariableNameControl);
//RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_applyToVariableName", this));
//var VariableNameControl = CommandControls.CreateStandardComboboxFor("v_applyToVariableName", this).AddVariableNames(editor);
//RenderedControls.AddRange(CommandControls.CreateUIHelpersFor("v_applyToVariableName", this, new Control[] { VariableNameControl }, editor));
//RenderedControls.Add(VariableNameControl);

RenderedControls.AddRange(CommandControls.MultiCreateInferenceDefaultControlGroupFor(this, editor));

if (editor.creationMode == frmCommandEditor.CreationMode.Add)
{
Expand Down
37 changes: 22 additions & 15 deletions taskt/Core/Automation/Commands/Data/FormatDataCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ namespace taskt.Core.Automation.Commands
public class FormatDataCommand : ScriptCommand
{
[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Please supply the value or variable (ex. {{{DateTime.Now}}}, 2500, {{{vNum}}})")]
[Attributes.PropertyAttributes.PropertyDescription("Please supply the value or variable.")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowVariableHelper)]
[Attributes.PropertyAttributes.InputSpecification("Specify either text or a variable that contains a date or number requiring formatting")]
[Attributes.PropertyAttributes.SampleUsage("{{{DateTime.Now}}}, 1/1/2000, 2500")]
[Attributes.PropertyAttributes.SampleUsage("**{{{DateTime.Now}}}** or **1/1/2000** or **2500** or **{{{vNum}}}** or **C:\\temp\\myfile.txt**")]
[Attributes.PropertyAttributes.Remarks("You can use known text or variables.")]
[Attributes.PropertyAttributes.PropertyShowSampleUsageInDescription(true)]
public string v_InputValue { get; set; }

[XmlAttribute]
Expand All @@ -32,14 +33,16 @@ public class FormatDataCommand : ScriptCommand
[Attributes.PropertyAttributes.InputSpecification("Indicate the source type")]
[Attributes.PropertyAttributes.SampleUsage("Choose **Date** or **Number** or **Path**")]
[Attributes.PropertyAttributes.Remarks("")]
[Attributes.PropertyAttributes.PropertyRecommendedUIControl(Attributes.PropertyAttributes.PropertyRecommendedUIControl.RecommendeUIControlType.ComboBox)]
public string v_FormatType { get; set; }

[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Specify required output format (ex. yy/MM/dd, hh:mm, #.0, file)")]
[Attributes.PropertyAttributes.PropertyDescription("Specify required output format")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowVariableHelper)]
[Attributes.PropertyAttributes.InputSpecification("Specify if a specific string format is required.")]
[Attributes.PropertyAttributes.SampleUsage("**MM/dd/yy**, **hh:mm**, **C2**, **D2**, **file** etc.")]
[Attributes.PropertyAttributes.SampleUsage("**MM/dd/yy** or **hh:mm** or **#.0** or **file** etc.")]
[Attributes.PropertyAttributes.Remarks("Path supports **file**, **folder**, **filewithoutextension**, **extension**, **drive**")]
[Attributes.PropertyAttributes.PropertyShowSampleUsageInDescription(true)]
public string v_ToStringFormat { get; set; }

[XmlAttribute]
Expand All @@ -48,6 +51,8 @@ public class FormatDataCommand : ScriptCommand
[Attributes.PropertyAttributes.InputSpecification("Select or provide a variable from the variable list")]
[Attributes.PropertyAttributes.SampleUsage("**vSomeVariable**")]
[Attributes.PropertyAttributes.Remarks("If you have enabled the setting **Create Missing Variables at Runtime** then you are not required to pre-define your variables, however, it is highly recommended.")]
[Attributes.PropertyAttributes.PropertyRecommendedUIControl(Attributes.PropertyAttributes.PropertyRecommendedUIControl.RecommendeUIControlType.ComboBox)]
[Attributes.PropertyAttributes.PropertyIsVariablesList(true)]
public string v_applyToVariableName { get; set; }


Expand Down Expand Up @@ -149,20 +154,22 @@ public override List<Control> Render(frmCommandEditor editor)
base.Render(editor);

//create standard group controls
RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_InputValue", this, editor));
//RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_InputValue", this, editor));

//RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_FormatType", this));
//RenderedControls.Add(CommandControls.CreateDropdownFor("v_FormatType", this));
var typeCtrls = CommandControls.CreateDefaultDropdownGroupFor("v_FormatType", this, editor);
RenderedControls.AddRange(typeCtrls);
////RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_FormatType", this));
////RenderedControls.Add(CommandControls.CreateDropdownFor("v_FormatType", this));
//var typeCtrls = CommandControls.CreateDefaultDropdownGroupFor("v_FormatType", this, editor);
//RenderedControls.AddRange(typeCtrls);

var formatCtls = CommandControls.CreateDefaultInputGroupFor("v_ToStringFormat", this, editor);
RenderedControls.AddRange(formatCtls);
//var formatCtls = CommandControls.CreateDefaultInputGroupFor("v_ToStringFormat", this, editor);
//RenderedControls.AddRange(formatCtls);

RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_applyToVariableName", this));
var VariableNameControl = CommandControls.CreateStandardComboboxFor("v_applyToVariableName", this).AddVariableNames(editor);
RenderedControls.AddRange(CommandControls.CreateUIHelpersFor("v_applyToVariableName", this, new Control[] { VariableNameControl }, editor));
RenderedControls.Add(VariableNameControl);
//RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_applyToVariableName", this));
//var VariableNameControl = CommandControls.CreateStandardComboboxFor("v_applyToVariableName", this).AddVariableNames(editor);
//RenderedControls.AddRange(CommandControls.CreateUIHelpersFor("v_applyToVariableName", this, new Control[] { VariableNameControl }, editor));
//RenderedControls.Add(VariableNameControl);

RenderedControls.AddRange(CommandControls.MultiCreateInferenceDefaultControlGroupFor(this, editor));

if (editor.creationMode == frmCommandEditor.CreationMode.Add)
{
Expand Down
16 changes: 10 additions & 6 deletions taskt/Core/Automation/Commands/Data/GetListCountCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@ namespace taskt.Core.Automation.Commands
public class GetListCountCommand : ScriptCommand
{
[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Please indicate the List Name (ex. {{{vList}}}, [1,2,3])")]
[Attributes.PropertyAttributes.PropertyDescription("Please indicate the List Name.")]
[Attributes.PropertyAttributes.PropertyUIHelper(Attributes.PropertyAttributes.PropertyUIHelper.UIAdditionalHelperType.ShowVariableHelper)]
[Attributes.PropertyAttributes.InputSpecification("Enter a existing List.")]
[Attributes.PropertyAttributes.SampleUsage("**{{{myData}}}** or **[1,2,3]**")]
[Attributes.PropertyAttributes.Remarks("")]
[Attributes.PropertyAttributes.PropertyShowSampleUsageInDescription(true)]
public string v_ListName { get; set; }

[XmlAttribute]
[Attributes.PropertyAttributes.PropertyDescription("Assign to Variable")]
[Attributes.PropertyAttributes.InputSpecification("Select or provide a variable from the variable list")]
[Attributes.PropertyAttributes.SampleUsage("**vSomeVariable**")]
[Attributes.PropertyAttributes.Remarks("If you have enabled the setting **Create Missing Variables at Runtime** then you are not required to pre-define your variables, however, it is highly recommended.")]
[Attributes.PropertyAttributes.PropertyRecommendedUIControl(Attributes.PropertyAttributes.PropertyRecommendedUIControl.RecommendeUIControlType.ComboBox)]
[Attributes.PropertyAttributes.PropertyIsVariablesList(true)]
public string v_UserVariableName { get; set; }

public GetListCountCommand()
Expand Down Expand Up @@ -105,11 +108,12 @@ public override List<Control> Render(frmCommandEditor editor)
{
base.Render(editor);

RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_ListName", this, editor));
RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_UserVariableName", this));
var VariableNameControl = CommandControls.CreateStandardComboboxFor("v_UserVariableName", this).AddVariableNames(editor);
RenderedControls.AddRange(CommandControls.CreateUIHelpersFor("v_UserVariableName", this, new Control[] { VariableNameControl }, editor));
RenderedControls.Add(VariableNameControl);
//RenderedControls.AddRange(CommandControls.CreateDefaultInputGroupFor("v_ListName", this, editor));
//RenderedControls.Add(CommandControls.CreateDefaultLabelFor("v_UserVariableName", this));
//var VariableNameControl = CommandControls.CreateStandardComboboxFor("v_UserVariableName", this).AddVariableNames(editor);
//RenderedControls.AddRange(CommandControls.CreateUIHelpersFor("v_UserVariableName", this, new Control[] { VariableNameControl }, editor));
//RenderedControls.Add(VariableNameControl);
RenderedControls.AddRange(CommandControls.MultiCreateInferenceDefaultControlGroupFor(this, editor));

return RenderedControls;
}
Expand Down
Loading

0 comments on commit 1119920

Please sign in to comment.