/// <summary> /// Method called to add a new variable-value argument pair to /// the collection. /// </summary> /// <param name="variable">The name of the variable to add.</param> /// <param name="value">The value of the variable.</param> public void Add (string variable, string value) { // Check to see if the variable exists already. If it does, // change the value and return. foreach (VVPair pair in this.List) { if (pair.Variable == variable) { pair.Value = value; return; } } // Otherwise add it. VVPair newPair = new VVPair(variable, value); this.List.Add(newPair); }
/// <summary> /// Method called to add a new variable-value argument pair to /// the collection. /// </summary> /// <param name="variable">The name of the variable to add.</param> /// <param name="value">The value of the variable.</param> public void Add(string variable, string value) { // Check to see if the variable exists already. If it does, // change the value and return. foreach (VVPair pair in this.List) { if (pair.Variable == variable) { pair.Value = value; return; } } // Otherwise add it. VVPair newPair = new VVPair(variable, value); this.List.Add(newPair); }