internal override void InternalInitialize() { FormViewDescription viewDescription = base.ViewDescription as FormViewDescription; if (viewDescription == null) { throw new InvalidOperationException(Microsoft.ManagementConsole.Internal.Utility.FormatResourceString("Microsoft.ManagementConsole.ViewDescription.InvalidViewDescription", new object[] { "FormView", "FormViewDescription" })); } this._controlType = viewDescription.ControlType; if (this._controlType != null) { this._containerControl = new FormViewContainerControl(this); if (this._containerControl == null) { throw new InvalidOperationException(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.FormViewControlTypeContainerCreateFailed)); } this._containerControl.Dock = DockStyle.Fill; this._containerControl.HandleCreated += new EventHandler(this.OnHandleCreated); this._control = Activator.CreateInstance(this._controlType) as System.Windows.Forms.Control; IFormViewControl control = this._control as IFormViewControl; if (control != null) { control.Initialize(this); } this._containerControl.CreateControl(); this._containerControl.Controls.Add(this._control); } }
internal override void InternalShutdown() { if (this._control != null) { this._control.Dispose(); } if (this._containerControl != null) { this._containerControl.Dispose(); } this._control = null; this._containerControl = null; this._controlType = null; }