예제 #1
0
 /// <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);
 }
예제 #2
0
 /// <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);
 }
예제 #3
0
        private void ControlsCollection_Removed(int index, object value)
        {
            ODFFormControl ctrl = value as ODFFormControl;

            this.Node.RemoveChild(ctrl.Node);

            ctrl.RemoveFromContentCollection();
        }
예제 #4
0
        private void ControlsCollection_Inserted(int index, object value)
        {
            ODFFormControl ctrl = value as ODFFormControl;

            this.Node.AppendChild(ctrl.Node);

            ctrl.AddToContentCollection();
        }
예제 #5
0
        private static void ControlsCollection_Removed(int index, object value)
        {
            ODFFormControl ctrl = (ODFFormControl)value;

            ctrl.Node.Remove();

            ctrl.RemoveFromContentCollection();
        }
예제 #6
0
        private void ControlsCollection_Inserted(int index, object value)
        {
            ODFFormControl ctrl = (ODFFormControl)value;

            Node.Add(ctrl.Node);

            ctrl.AddToContentCollection();
        }
예제 #7
0
 /// <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);
 }
예제 #8
0
 /// <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);
 }
예제 #9
0
 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();
         }
     }
 }
예제 #10
0
 private void ControlsCollection_Clearing()
 {
     for (int i = 0; i < Controls.Count; i++)
     {
         ODFFormControl ctrl = Controls[i];
         if (ctrl != null)
         {
             ctrl.Node.Remove();
             ctrl.RemoveFromContentCollection();
         }
     }
 }