A Control for Editing/Viewing an IBusinessObject.
Inheritance: UserControlWin, IBOPanelEditorControl
 public void Test_ConstructDefaultConstructor_WithUIDefName_ShouldConstructWithName()
 {
     //---------------Set up test pack-------------------
     GetCustomClassDef();
     GlobalUIRegistry.ControlFactory = GetControlFactory();
     //---------------Assert Precondition----------------
     Assert.IsNotNull(GlobalUIRegistry.ControlFactory);
     //---------------Execute Test ----------------------
     IBOPanelEditorControl controlWin = new BOEditorControlWin<OrganisationTestBO>(CUSTOM_UIDEF_NAME);
     //---------------Test Result -----------------------
     Assert.IsNotNull(controlWin);
     Assert.AreEqual(CUSTOM_UIDEF_NAME, controlWin.PanelInfo.UIForm.UIDef.Name);
 }
        ///<summary>
        /// Constructor for the <see cref="BOGridAndEditorControlWin"/>
        ///</summary>
        ///<param name="controlFactory"></param>
        ///<param name="classDef"></param>
        ///<param name="uiDefName"></param>
        ///<exception cref="ArgumentNullException"></exception>
        public BOGridAndEditorControlWin(IControlFactory controlFactory, IClassDef classDef, string uiDefName)
        {
            if (controlFactory == null)
            {
                throw new ArgumentNullException("controlFactory");
            }
            if (classDef == null)
            {
                throw new ArgumentNullException("classDef");
            }
            _classDef = classDef;
            BOEditorControlWin boEditorControlWin = new BOEditorControlWin(controlFactory, classDef, uiDefName);

            SetupGridAndBOEditorControlWin(controlFactory, boEditorControlWin, classDef, uiDefName);

            this.OnAsyncOperationComplete += (sender, e) =>
            {
                lock (this)
                {
                    this._inAsyncOperation = false;
                }
                this.Enabled       = true;
                this.UseWaitCursor = false;
                this.Cursor        = Cursors.Default;
            };
            this.OnAsyncOperationStarted += (sender, e) =>
            {
                lock (this)
                {
                    if (this._inAsyncOperation)
                    {
                        throw new Exception("Already performing an asynchronous operation");
                    }
                    this._inAsyncOperation = true;
                }
                this.Enabled       = false;
                this.UseWaitCursor = true;
                this.Cursor        = Cursors.WaitCursor;
                Application.DoEvents();
            };
        }