/// <summary> /// Shows the form as a dialog with the specified object. /// </summary> /// <param name="owner">The owner window.</param> /// <param name="obj">The database object to display.</param> /// <returns>The dialog result.</returns> public DialogResult ShowDialog(IWin32Window owner, DbObject obj) { // Select the server an table. this.control.Object = obj; // Set the dialog name. this.Text = "{0} Object Properties".FormatWith(obj.GetName()); // Open the dialog. return base.ShowDialog(owner); }
// Protected methods. /// <summary> /// An event handler called when a new object has been set. /// </summary> /// <param name="oldObject">The old object.</param> /// <param name="newObject">The new object.</param> protected virtual void OnObjectSet(DbObject oldObject, DbObject newObject) { // If the object has not changed, do nothing. if (oldObject == newObject) return; if (null == newObject) { this.labelTitle.Text = "No object selected"; this.tabControl.Visible = false; } else { this.labelTitle.Text = newObject.GetName(); this.propertyGrid.SelectedObject = newObject; this.tabControl.Visible = true; } this.tabControl.SelectedTab = this.tabPageProperties; if (this.Focused) { this.propertyGrid.Select(); } }