示例#1
0
 public void ShowMessage(string message)
 {
     if (this.defaultService != null)
     {
         this.defaultService.ShowMessage(message);
     }
     else
     {
         this.defaultService = this.GetDefaultService();
         if (this.defaultService != null)
         {
             this.defaultService.ShowMessage(message);
         }
     }
 }
示例#2
0
 public void ShowError(Exception ex)
 {
     if (this.defaultService != null)
     {
         this.defaultService.ShowError(ex);
     }
     else
     {
         this.defaultService = this.GetDefaultService();
         if (this.defaultService != null)
         {
             this.defaultService.ShowError(ex);
         }
     }
 }
示例#3
0
 public void SetUIDirty()
 {
     if (this.defaultService != null)
     {
         this.defaultService.SetUIDirty();
     }
     else
     {
         this.defaultService = this.GetDefaultService();
         if (this.defaultService != null)
         {
             this.defaultService.SetUIDirty();
         }
     }
 }
示例#4
0
        protected override void OnLoad(EventArgs e)
        {
            ToolStripRenderer renderer = null;

            System.Windows.Forms.Design.IUIService ds = Context.GetService <System.Windows.Forms.Design.IUIService>();
            if (ds != null)
            {
                renderer = ds.Styles["VsToolWindowRenderer"] as ToolStripRenderer;
            }

            if (renderer != null)
            {
                diffControl1.ToolStripRenderer = renderer;
            }

            base.OnLoad(e);
        }
        protected override void OnThemeChanged(EventArgs e)
        {
            base.OnThemeChanged(e);

            ToolStripRenderer renderer = null;

            System.Windows.Forms.Design.IUIService ds = Context.GetService <System.Windows.Forms.Design.IUIService>();
            if (ds != null)
            {
                renderer = ds.Styles["VsRenderer"] as ToolStripRenderer;
            }

            if (renderer != null)
            {
                pendingChangesTabs.Renderer = renderer;
            }

            if (VSVersion.VS2008OrOlder && !SystemInformation.HighContrast)
            {
                // We should use the VS colors instead of the ones provided by the OS
                IAnkhVSColor colorSvc = Context.GetService <IAnkhVSColor>();

                Color color;
                if (colorSvc.TryGetColor(__VSSYSCOLOREX.VSCOLOR_COMMANDBAR_GRADIENT_MIDDLE, out color))
                {
                    pendingChangesTabs.BackColor = color;
                    pendingChangesTabs.OverflowButton.BackColor = color;
                }

                if (renderer == null && colorSvc.TryGetColor(__VSSYSCOLOREX.VSCOLOR_COMMANDBAR_HOVEROVERSELECTED, out color))
                {
                    pendingChangesTabs.ForeColor = color;
                    pendingChangesTabs.OverflowButton.ForeColor = color;
                }
            }

            foreach (PendingChangesPage p in _pages)
            {
                p.OnThemeChanged(e);
            }

            pendingChangesTabs.Invalidate();
        }
示例#6
0
 public bool ShowToolWindow(Guid toolWindow)
 {
     if (this.defaultService != null)
     {
         return(this.defaultService.ShowToolWindow(toolWindow));
     }
     else
     {
         this.defaultService = this.GetDefaultService();
         if (this.defaultService != null)
         {
             return(this.defaultService.ShowToolWindow(toolWindow));
         }
         else
         {
             return(false);
         }
     }
 }
示例#7
0
 public System.Windows.Forms.DialogResult ShowMessage(string message, string caption, System.Windows.Forms.MessageBoxButtons buttons)
 {
     if (this.defaultService != null)
     {
         return(this.defaultService.ShowMessage(message, caption, buttons));
     }
     else
     {
         this.defaultService = this.GetDefaultService();
         if (this.defaultService != null)
         {
             return(this.defaultService.ShowMessage(message, caption, buttons));
         }
         else
         {
             return(System.Windows.Forms.DialogResult.Cancel);
         }
     }
 }
示例#8
0
 public bool ShowComponentEditor(object component, System.Windows.Forms.IWin32Window parent)
 {
     if (this.defaultService != null)
     {
         return(this.defaultService.ShowComponentEditor(component, parent));
     }
     else
     {
         this.defaultService = this.GetDefaultService();
         if (this.defaultService == null)
         {
             return(false);
         }
         else
         {
             return(this.defaultService.ShowComponentEditor(component, parent));
         }
     }
 }
示例#9
0
 public System.Windows.Forms.IWin32Window GetDialogOwnerWindow()
 {
     if (this.defaultService != null)
     {
         return(this.defaultService.GetDialogOwnerWindow());
     }
     else
     {
         this.defaultService = this.GetDefaultService();
         if (this.defaultService == null)
         {
             return(null);
         }
         else
         {
             return(this.defaultService.GetDialogOwnerWindow());
         }
     }
 }
示例#10
0
 public QueuePathDialog(System.Windows.Forms.Design.IUIService uiService)
 {
     throw new NotImplementedException();
 }
示例#11
0
 public QueuePathDialog(System.Windows.Forms.Design.IUIService uiService)
 {
 }
示例#12
0
        public System.Windows.Forms.DialogResult ShowDialog(System.Windows.Forms.Form form)
        {
            Type propGridType = typeof(System.Windows.Forms.PropertyGrid);

            System.Reflection.FieldInfo gvInfo = propGridType.GetField("gridView", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
            //获取gridView实例
            object gridViewRef = gvInfo.GetValue(this.markProperty);

            System.Reflection.FieldInfo edInfo = gvInfo.FieldType.GetField("errorDlg", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
            if (form.GetType() == edInfo.FieldType)
            {
                //获取errorDlg实例
                object errorDlgRef = edInfo.GetValue(gridViewRef);

                System.Windows.Forms.MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("请正确设置数值"));

                if (this.defaultService != null)
                {
                    return(this.defaultService.ShowDialog(form));
                }
                else
                {
                    this.defaultService = this.GetDefaultService();
                    if (this.defaultService == null)
                    {
                        return(System.Windows.Forms.DialogResult.Cancel);
                    }
                    else
                    {
                        return(this.defaultService.ShowDialog(form));
                    }
                }

                //return System.Windows.Forms.DialogResult.OK;


                //System.Reflection.PropertyInfo msgInfo = edInfo.FieldType.GetProperty("Message");
                //System.Reflection.PropertyInfo detInfo = edInfo.FieldType.GetProperty("Details");

                //string det = ""; detInfo.SetValue(errorDlgRef, "sfd", null);//(errorDlgRef, System.Reflection.BindingFlags.NonPublic, null, null, null);
                //string msg = ""; msgInfo.SetValue(errorDlgRef, "ss", null);//(errorDlgRef, null));

                //IUIService iUI = m_PropertyGrid.GetServiceExInternal(typeof(IUIService)) as IUIService;
                //if (iUI == null)
                //    return DialogResult.Cancel;


                //return iUI.ShowDialog(form);

                //MessageBox.Show(m_PropertyGrid, msg + ": " + det, "Invalid PropertyValue");

                //return DialogResult.OK;
            }

            if (this.defaultService != null)
            {
                return(this.defaultService.ShowDialog(form));
            }
            else
            {
                this.defaultService = this.GetDefaultService();
                if (this.defaultService == null)
                {
                    return(System.Windows.Forms.DialogResult.Cancel);
                }
                else
                {
                    return(this.defaultService.ShowDialog(form));
                }
            }
        }