Ejemplo n.º 1
0
 /// <summary>
 /// Hides the smart tag panel of this component.
 /// </summary>
 public void HideDesigner()
 {
     if (m_DesignerService != null)
     {
         m_DesignerService.HideUI(Component);
     }
 }
        // THIS should not stay here, creation of a custom command or of the real thing should be handled in the designeractionpanel itself
        public override MenuCommand FindCommand(CommandID commandId)
        {
            if (_panel != null && _menuService != null)
            {
                // if the command we're looking for is handled by the panel, just tell VS that this command is disabled. otherwise let it through as usual...
                foreach (CommandID candidateCommandId in _panel.FilteredCommandIDs)
                {
                    // VisualStudio shell implements a mutable derived class from the base CommandID. The mutable class compares overridden properties instead of the read-only backing fields when testing equality of command IDs. Thus Equals method is asymmetrical derived class's override that compares properties is the accurate one.
                    if (commandId.Equals(candidateCommandId))
                    {
                        MenuCommand dummyMC = new MenuCommand(delegate
                                                              { }, commandId)
                        {
                            Enabled = false
                        };
                        return(dummyMC);
                    }
                }

                // in case of a ctrl-tab we need to close the DAP
                if (_daUISvc != null && commandId.Guid == s_vSStandardCommandSet97 && commandId.ID == 1124)
                {
                    _daUISvc.HideUI(null);
                }
            }

            return(base.FindCommand(commandId)); // this will route the request to the parent behavior
        }
Ejemplo n.º 3
0
        /// <summary>
        /// hide smart tag for all selected controls
        /// </summary>
        void HideSmartTag(DesignerActionUIService actionUIService, ISelectionService selectionService)
        {
            if (actionUIService != null)
            {
                ICollection collection = selectionService.GetSelectedComponents();

                foreach (var item in collection)
                {
                    actionUIService.HideUI(item as Component);
                }
            }
        }
            public void OnEditColumns()
            {
                ComboBoxColumnEditor editor  = new ComboBoxColumnEditor(this.Owner.Columns);
                IUIService           service = base.Component.Site.GetService(typeof(IUIService)) as IUIService;

                if (service != null)
                {
                    if (service.ShowDialog(editor) == DialogResult.OK)
                    {
                        IComponentChangeService iccs = (IComponentChangeService)GetService(typeof(IComponentChangeService));
                        iccs.OnComponentChanging(this.Owner, null);
                        this.Owner.Columns.AddRange(editor.NewCollection);
                        iccs.OnComponentChanged(this.Owner, null, null, null);
                        designerActionSvc.HideUI(this.Owner);
                    }
                }
                editor.Dispose();
            }
Ejemplo n.º 5
0
        private void DesignVerb(object sender, EventArgs e)
        {
            if (FReport.Dictionary.DataSources.Count == 0 && FReport.Dictionary.Connections.Count == 0)
            {
                SelectDataSourceVerb(sender, e);
            }
            else
            {
                FReport.Dictionary.ReRegisterData();
            }

            try
            {
                using (DesignerForm designerForm = new DesignerForm())
                {
                    designerForm.Designer.Report  = FReport;
                    designerForm.Designer.AskSave = !FReport.StoreInResources;
                    designerForm.ShowInTaskbar    = true;
                    designerForm.ShowDialog();
                    if (designerForm.Designer.Modified && FReport.StoreInResources)
                    {
                        RaiseReportChanged();
                    }
                }
            }
            catch (Exception ex)
            {
                using (ExceptionForm form = new ExceptionForm(ex))
                {
                    form.ShowDialog();
                }
            }

            DesignerActionUIService designerActionUISvc =
                GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;

            if (designerActionUISvc != null)
            {
                designerActionUISvc.HideUI(FReport);
            }
        }