/// <summary> /// Clears the stored data. /// </summary> public void ClearSession() { ScriptTextVariables.Clear(); ScriptUsernameVariables.Clear(); ScriptPasswordVariables.Clear(); ScriptMultiLineVariables.Clear(); ScriptCheckboxVariables.Clear(); ScriptRadiobuttonVariables.Clear(); ScriptVariables.Clear(); _scriptDescription = ""; }
private void uiBtnOK_Click(object sender, EventArgs e) { //remove all variables ScriptVariables.Clear(); //loop each variable and add for (int i = 0; i < _userVariableParentNode.Nodes.Count; i++) { //get name and value var variableName = _userVariableParentNode.Nodes[i].Text.Replace("{", "").Replace("}", ""); var variableValue = _userVariableParentNode.Nodes[i].Nodes[0].Text.Replace(_leadingValue, "").Replace(_emptyValue, ""); //add to list ScriptVariables.Add(new ScriptVariable() { VariableName = variableName, VariableValue = variableValue }); } //return success result DialogResult = DialogResult.OK; }
private void ResetVariables() { //remove all variables ScriptVariables.Clear(); //loop each variable and add for (int i = 0; i < _userVariableParentNode.Nodes.Count; i++) { //get name and value var variableName = _userVariableParentNode.Nodes[i].Text; var variableValue = _userVariableParentNode.Nodes[i].Nodes[0].Text.Replace(_leadingValue, "").Replace(_emptyValue, ""); var variableType = (Type)_userVariableParentNode.Nodes[i].Nodes[1].Tag; //add to list ScriptVariables.Add(new ScriptVariable() { VariableName = variableName, VariableValue = variableValue, VariableType = variableType }); } }