/// <summary> /// Update the inputs from the client /// </summary> /// <param name="cgivars">name-value pairs</param> private void OnPost(Dictionary <string, string> cgivars) { foreach (var pair in cgivars) { if (inputs.ContainsKey(pair.Key)) { // try to set the value of the input try { InputBase input = inputs[pair.Key]; input.SetValue(pair.Value); } catch (Exception e) { Debug.WriteLine(e.ToString()); } } } }
/// <summary> /// Add an input to the dictionary /// </summary> /// <param name="input">form input</param> public void AddInput(InputBase input) { if (!inputs.ContainsKey(input.UniqueID)) { if (null != restoredInputs) { foreach (SavedValue i in restoredInputs) { if (i.UniqueID == input.UniqueID) { // restore value input.SetValue(i.Value); break; } } } inputs.Add(input.UniqueID, input); } }