/// <summary> /// Looks up a control by its name /// </summary> /// <param name="name">Control name</param> /// <param name="searchInSubforms">Specifies whether to look in the subforms</param> /// <returns></returns> public ODFFormControl FindControlByName(string name, bool searchInSubforms) { if (searchInSubforms) { foreach (ODFForm f in ChildForms) { ODFFormControl ctrl = f.FindControlByName(name, true); if (ctrl != null) { return(ctrl); } } } foreach (ODFFormControl c in Controls) { if (c != null) { if (c.Name == name) { return(c); } } } return(null); }
/// <summary> /// Looks up a control by its ID /// </summary> /// <param name="id">Control ID</param> /// <param name="searchInSubforms">Specifies whether to look in the subforms</param> /// <returns></returns> public ODFFormControl FindControlById(string id, bool searchInSubforms) { if (searchInSubforms) { foreach (ODFForm f in ChildForms) { ODFFormControl ctrl = f.FindControlById(id, true); if (ctrl != null) { return(ctrl); } } } foreach (ODFFormControl c in Controls) { if (c != null) { if (c.Id == id) { return(c); } } } return(null); }
private void ControlsCollection_Removed(int index, object value) { ODFFormControl ctrl = value as ODFFormControl; this.Node.RemoveChild(ctrl.Node); ctrl.RemoveFromContentCollection(); }
private void ControlsCollection_Inserted(int index, object value) { ODFFormControl ctrl = value as ODFFormControl; this.Node.AppendChild(ctrl.Node); ctrl.AddToContentCollection(); }
private static void ControlsCollection_Removed(int index, object value) { ODFFormControl ctrl = (ODFFormControl)value; ctrl.Node.Remove(); ctrl.RemoveFromContentCollection(); }
private void ControlsCollection_Inserted(int index, object value) { ODFFormControl ctrl = (ODFFormControl)value; Node.Add(ctrl.Node); ctrl.AddToContentCollection(); }
/// <summary> /// Looks for a specific control through all the forms by its name /// </summary> /// <param name="id">Control name</param> /// <returns>The control</returns> public ODFFormControl FindControlByName(string name) { foreach (ODFForm f in Forms) { ODFFormControl fc = f.FindControlByName(name, true); if (fc != null) { return(fc); } } return(null); }
/// <summary> /// Looks for a specific control through all the forms by its ID /// </summary> /// <param name="id">Control ID</param> /// <returns>The control</returns> public ODFFormControl FindControlById(string id) { foreach (ODFForm f in Forms) { ODFFormControl fc = f.FindControlById(id, true); if (fc != null) { return(fc); } } return(null); }
private void ControlsCollection_Clearing() { for (int i = 0; i < _controls.Count; i++) { ODFFormControl ctrl = _controls[i] as ODFFormControl; if (ctrl != null) { this.Node.RemoveChild(ctrl.Node); ctrl.RemoveFromContentCollection(); } } }
private void ControlsCollection_Clearing() { for (int i = 0; i < Controls.Count; i++) { ODFFormControl ctrl = Controls[i]; if (ctrl != null) { ctrl.Node.Remove(); ctrl.RemoveFromContentCollection(); } } }