protected virtual void ShowTemplatingOptionsDialog()
        {
            IComponentChangeService changeService =
                (IComponentChangeService)GetService(typeof(IComponentChangeService));

            if (changeService != null)
            {
                try
                {
                    changeService.OnComponentChanging(_control, null);
                }
                catch (CheckoutException ex)
                {
                    if (ex == CheckoutException.Canceled)
                    {
                        return;
                    }
                    throw;
                }
            }

            try
            {
                TemplatingOptionsDialog dialog = new TemplatingOptionsDialog(
                    this,
                    _control.Site,
                    MobileControlDesigner.MergingContextTemplates);
                dialog.ShowDialog();
            }
            finally
            {
                if (changeService != null)
                {
                    changeService.OnComponentChanged(_control, null, null, null);

                    if (IMobileWebFormServices != null)
                    {
                        IMobileWebFormServices.ClearUndoStack();
                    }
                }
            }
        }
        protected virtual void ShowTemplatingOptionsDialog()
        {
            IComponentChangeService changeService =
                (IComponentChangeService)GetService(typeof(IComponentChangeService));
            if (changeService != null)
            {
                try
                {
                    changeService.OnComponentChanging(_control, null);
                }
                catch (CheckoutException ex)
                {
                    if (ex == CheckoutException.Canceled)
                    {
                        return;
                    }
                    throw;
                }
            }

            try
            {
                TemplatingOptionsDialog dialog = new TemplatingOptionsDialog(
                    this,
                    _control.Site,
                    MobileControlDesigner.MergingContextTemplates);
                dialog.ShowDialog();
            }
            finally
            {
                if (changeService != null)
                {
                    changeService.OnComponentChanged(_control, null, null, null);

                    if (IMobileWebFormServices != null)
                    {
                        IMobileWebFormServices.ClearUndoStack();
                    }
                }
            }
        }