/// <summary>
        /// Creates an instance of a dialog form.
        /// </summary>
        /// <param name="infoHolder"> <c ref="CommandBarStripInfoHolder"/> object that contains information about strips.</param>
        /// <returns>A refference to the created form.</returns>
        public virtual Form ShowCustomizeDialog(object sender, CommandBarStripInfoHolder infoHolder)
        {
            CommandBarCustomizeDialog dialog = new CommandBarCustomizeDialog(infoHolder);
            RadElement senderElement         = sender as RadElement;
            RadControl senderControl         = sender as RadControl;

            if (senderControl == null && senderElement != null && senderElement.ElementTree != null)
            {
                senderControl = senderElement.ElementTree.Control as RadControl;
            }

            if (sender is CommandBarStripElement)
            {
                dialog.stripsListControl.SelectedValue = sender;
                dialog.radPageView.SelectedPage        = dialog.toolstripItemsPage;
            }
            else if (sender is RadCommandBar)
            {
                dialog.radPageView.SelectedPage = dialog.toolstripsPage;
            }

            if (senderControl != null)
            {
                dialog.ThemeName   = senderControl.ThemeName;
                dialog.RightToLeft = senderControl.RightToLeft;
            }
            else if (senderElement != null)
            {
                dialog.RightToLeft = senderElement.RightToLeft ? RightToLeft.Yes : RightToLeft.No;
            }

            if (OnDialogOpening(dialog))
            {
                return(null);
            }

            OnDialogOpened(dialog);
            dialog.ShowDialog();

            return(dialog);
        }
        public virtual Form ShowCustomizeDialog(object sender, CommandBarStripInfoHolder infoHolder)
        {
            CommandBarCustomizeDialog barCustomizeDialog = new CommandBarCustomizeDialog(infoHolder);
            RadElement radElement = sender as RadElement;
            RadControl radControl = sender as RadControl;

            if (radControl == null && radElement != null && radElement.ElementTree != null)
            {
                radControl = radElement.ElementTree.Control as RadControl;
            }
            if (sender is CommandBarStripElement)
            {
                barCustomizeDialog.stripsListControl.SelectedValue = sender;
                barCustomizeDialog.radPageView.SelectedPage        = barCustomizeDialog.toolstripItemsPage;
            }
            else if (sender is RadCommandBar)
            {
                barCustomizeDialog.radPageView.SelectedPage = barCustomizeDialog.toolstripsPage;
            }
            if (radControl != null)
            {
                barCustomizeDialog.ThemeName   = radControl.ThemeName;
                barCustomizeDialog.RightToLeft = radControl.RightToLeft;
            }
            else if (radElement != null)
            {
                barCustomizeDialog.RightToLeft = radElement.RightToLeft ? RightToLeft.Yes : RightToLeft.No;
            }
            if (CommandBarCustomizeDialogProvider.OnDialogOpening((object)barCustomizeDialog))
            {
                return((Form)null);
            }
            CommandBarCustomizeDialogProvider.OnDialogOpened((object)barCustomizeDialog);
            int num = (int)barCustomizeDialog.ShowDialog();

            return((Form)barCustomizeDialog);
        }