Skip to content

Commit

Permalink
Merge pull request saucepleez#272 from rcktrncn/development-branch
Browse files Browse the repository at this point in the history
ui change, add attributes, etc
  • Loading branch information
saucepleez authored Aug 5, 2021
2 parents a8a76cd + 2d5e445 commit e0c98b7
Show file tree
Hide file tree
Showing 204 changed files with 2,747 additions and 1,877 deletions.
81 changes: 65 additions & 16 deletions taskt/Core/Automation/Attributes/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,8 @@ public sealed class PropertyIsWindowNamesList : System.Attribute
public bool allowCurrentWindow = true;
public bool allowAllWindows = false;
public bool allowDesktop = false;
public PropertyIsWindowNamesList(bool isWindowNameList)
{
this.isWindowNamesList = isWindowNameList;
}
public PropertyIsWindowNamesList(bool isWindowNameList, bool allowCurrent)
{
this.isWindowNamesList = isWindowNameList;
this.allowCurrentWindow = allowCurrent;
}
public PropertyIsWindowNamesList(bool isWindowNameList, bool allowCurrent, bool allowAll)
{
this.isWindowNamesList = isWindowNameList;
this.allowCurrentWindow = allowCurrent;
this.allowAllWindows = allowAll;
}
public PropertyIsWindowNamesList(bool isWindowNameList, bool allowCurrent, bool allowAll, bool allowDesktop)

public PropertyIsWindowNamesList(bool isWindowNameList = false, bool allowCurrent = true, bool allowAll = false, bool allowDesktop = false)
{
this.isWindowNamesList = isWindowNameList;
this.allowCurrentWindow = allowCurrent;
Expand Down Expand Up @@ -224,4 +210,67 @@ public PropertyShowSampleUsageInDescription(bool opt)
this.showSampleUsage = opt;
}
}
[System.AttributeUsage(AttributeTargets.Property)]
public sealed class PropertyTextBoxSetting : System.Attribute
{
public int height = 1;
public bool allowNewLine = true;
public PropertyTextBoxSetting(int height = 1, bool allowNewLine = true)
{
if (height < 0)
{
this.height = 1;
}
else
{
this.height = height;
}
this.allowNewLine = allowNewLine;
}
}
[System.AttributeUsage(AttributeTargets.Property)]
public sealed class PropertyDataGridViewSetting : System.Attribute
{
public bool allowAddRow = true;
public bool allowDeleteRow = true;
public bool allowResizeRow = true;
public int width = 400;
public int height = 250;
public bool autoGenerateColumns = true;
public int headerRowHeight = 1;
public PropertyDataGridViewSetting(bool allowAddRow = true, bool allowDeleteRow =true, bool allowResizeRow =true, int width =400, int height=250, bool autoGenerateColumns=true, int headerRowHeight=1)
{
this.allowAddRow = allowAddRow;
this.allowDeleteRow = allowDeleteRow;
this.allowResizeRow = allowResizeRow;
this.width = width;
this.height = height;
this.autoGenerateColumns = autoGenerateColumns;
this.headerRowHeight = headerRowHeight;
}
}
[System.AttributeUsage(AttributeTargets.Property)]
public sealed class PropertySecondaryLabel : System.Attribute
{
public bool useSecondaryLabel = false;
public PropertySecondaryLabel(bool opt)
{
this.useSecondaryLabel = opt;
}
}
[System.AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public sealed class PropertyAddtionalParameterInfo : System.Attribute
{
public string searchKey = "";
public string description = "";
public string sampleUsage = "";
public string remarks = "";
public PropertyAddtionalParameterInfo(string searchKey, string description, string sampleUsage = "", string remarks = "")
{
this.searchKey = searchKey;
this.description = description;
this.sampleUsage = sampleUsage;
this.remarks = remarks;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public override void RunCommand(object sender)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(v_WebRequestURL.ConvertToUserVariable(sender));
request.Method = "GET";
request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2";
if (v_WebRequestCredentials == "Yes")
{
request.Credentials = CredentialCache.DefaultCredentials;
}

request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2";
if (v_WebRequestCredentials == "Yes")
{
request.Credentials = CredentialCache.DefaultCredentials;
}

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

Stream dataStream = response.GetResponseStream();
Expand Down
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
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
Loading

0 comments on commit e0c98b7

Please sign in to comment.