示例#1
0
 public static void BindListeners(System.Windows.Forms.Control control)
 {
     if (control is BaseControl)
     {
         BaseControl bcontrol = (BaseControl)control;
         if (bcontrol.Logic != null &&
             !ListenerRegistry.Registry.Contains(bcontrol))
         {
             ListenerRegistry.Registry.Add(bcontrol, "");
             bcontrol.Logic.StateChanged += new StateChangedDelegate(bcontrol.StateChanged);
         }
         foreach (object listener in bcontrol.Controls)
         {
             if (listener is BaseControl)
             {
                 ListenerRegistry.BindListeners((System.Windows.Forms.Control)listener);
             }
             else
             {
                 ListenerRegistry.BindListeners((System.Windows.Forms.Control)listener, bcontrol.Logic);
             }
         }
     }
     else
     {
         foreach (System.Windows.Forms.Control passThrough in control.Controls)
         {
             ListenerRegistry.BindListeners(passThrough);
         }
     }
 }
示例#2
0
 protected virtual void ControlLoad(object sender, EventArgs args)
 {
     if (LicenseManager.UsageMode != LicenseUsageMode.Designtime)
     {
         InitializeBO();
         ListenerRegistry.BindListeners(this);
         BindControlData();
         if (Logic != null)
         {
             Logic.StateChanged += new StateChangedDelegate(this.StateChanged);
         }
     }
 }