Пример #1
0
 /// <summary>
 /// This method is called when a <c>Control</c> created by
 /// <see cref="M:Northwoods.Go.GoControl.CreateControl(Northwoods.Go.GoView)" /> needs to be removed from a view.
 /// </summary>
 /// <param name="comp"></param>
 /// <param name="view"></param>
 /// <remarks>
 /// By default this also calls <c>Control.Dispose()</c>.
 /// If the view is in "edit" mode using this GoControl,
 /// the <c>Control</c> is removed and disposed by the view,
 /// after <see cref="P:Northwoods.Go.GoView.EditControl" /> is set to null.
 /// </remarks>
 public virtual void DisposeControl(Control comp, GoView view)
 {
     if (comp != null && view != null)
     {
         if (view.EditControl != this)
         {
             view.RemoveGoControl(this, comp);
             comp.Dispose();
         }
         else
         {
             comp.Visible = false;
         }
     }
 }