public EditVariableForm(Variable Variable) { InitializeComponent(); this.Variable = Variable; LoadVariable(); }
/// <summary> /// Adds a new variable. /// </summary> private void AddVariable() { Variable newVariable = new Variable("", ""); Variables.Add(newVariable); variablesListBox.Items.Add(newVariable); variablesListBox.SelectedItem = newVariable; EditVariable(); }
private static List<Variable> LoadVariables(XmlNodeList xnodes) { List<Variable> variables = new List<Variable>(); foreach (XmlNode xnode in xnodes) { string key = xnode.Attributes["key"].Value; string value = xnode.InnerText; //make a new variable Variable newVar = new Variable(key, value); variables.Add(newVar); } return variables; }