/// <summary> /// Attach the Menu control to the dialog object. /// </summary> /// <param name="dialog">the target dialog</param> internal override void Attach(IFileDialogCustomize dialog) { Debug.Assert(dialog != null, "CommonFileDialogMenu.Attach: dialog parameter can not be null"); // Add the menu control dialog.AddMenu(this.Id, this.Text); // Add the menu items foreach (CommonFileDialogMenuItem item in this.items) dialog.AddControlItem(this.Id, item.Id, item.Text); // Make prominent as needed if (IsProminent) dialog.MakeProminent(this.Id); // Sync unmanaged properties with managed properties SyncUnmanagedProperties(); }
/// <summary> /// Attach the Menu control to the dialog object. /// </summary> /// <param name="dialog">the target dialog</param> internal override void Attach(IFileDialogCustomize dialog) { Debug.Assert(dialog != null, "CommonFileDialogMenu.Attach: dialog parameter can not be null"); // Add the menu control dialog.AddMenu(this.Id, this.Text); // Add the menu items foreach (CommonFileDialogMenuItem item in this.items) { dialog.AddControlItem(this.Id, item.Id, item.Text); } // Make prominent as needed if (IsProminent) { dialog.MakeProminent(this.Id); } // Sync unmanaged properties with managed properties SyncUnmanagedProperties(); }