示例#1
0
        public virtual void ShowView(IViewContent content)
        {
            System.Diagnostics.Debug.Assert(layout != null);

            ViewContentCollection.Add(content);
            layout.ShowView(content);
            content.WorkbenchWindow.SelectWindow();
        }
 public virtual void ShowView(IViewContent content)
 {
     if (layout == null)
     {
         return;
     }
     layout.ShowView(content);
 }
示例#3
0
        public void ShowView(IViewContent content)
        {
            System.Diagnostics.Debug.Assert(_layout != null);
            ViewContentCollection.Add(content);

            _layout.ShowView(content);
            content.WorkbenchWindow.SelectWindow();
            OnViewOpened(new ViewContentEventArgs(content));
        }
示例#4
0
        public void ShowView(IViewContent content, bool switchToOpenedView)
        {
            CloseAllViews();
            if (content == null)
            {
                throw new ArgumentNullException("content");
            }
            if (content.WorkbenchWindow != null)
            {
                throw new ArgumentException("Cannot show view content that is already visible in another workbench window");
            }
            if (layout == null)
            {
                throw new InvalidOperationException("No layout is attached.");
            }

            if (ViewContentCollection.Count >= maxViewContentCount)//如果超过3个则不能再打开。add by
            {
                MessageBox.Show(string.Format("视图界面数量最多只能为\"{0}\"个,请先关闭部分页面。", maxViewContentCount));
                return;
            }
            primaryViewContentCollection.Add(content);

            if (PropertyService.Get("FanHai.Gui.Framework.LoadDocumentProperties", true) && content is IMementoCapable)
            {
                try
                {
                    Core.Properties memento = GetStoredMemento(content);
                    if (memento != null)
                    {
                        ((IMementoCapable)content).SetMemento(memento);
                    }
                }
                catch (Exception e)
                {
                    MessageService.ShowError(e, "Can't get/set memento");
                }
            }

            layout.ShowView(content, switchToOpenedView);
            if (switchToOpenedView)
            {
                content.WorkbenchWindow.SelectWindow();
            }
            OnViewOpened(new ViewContentEventArgs(content));
        }
示例#5
0
        public virtual void ShowView(IViewContent content)
        {
            System.Diagnostics.Debug.Assert(layout != null);
            ViewContentCollection.Add(content);
            if (PropertyService.Get("SharpDevelop.LoadDocumentProperties", true) && content is IMementoCapable)
            {
                try {
                    Properties memento = GetStoredMemento(content);
                    if (memento != null)
                    {
                        ((IMementoCapable)content).SetMemento(memento);
                    }
                } catch (Exception e) {
                    MessageService.ShowError(e, "Can't get/set memento");
                }
            }

            layout.ShowView(content);
            content.WorkbenchWindow.SelectWindow();
            OnViewOpened(new ViewContentEventArgs(content));
        }
示例#6
0
        public void ShowView(IViewContent content, bool switchToOpenedView)
        {
            if (content == null)
            {
                throw new ArgumentNullException("content");
            }
            if (content.WorkbenchWindow != null)
            {
                throw new ArgumentException("Cannot show view content that is already visible in another workbench window");
            }

            if (layout == null)
            {
                throw new InvalidOperationException("No layout is attached.");
            }

            primaryViewContentCollection.Add(content);
            if (PropertyService.Get("SharpDevelop.LoadDocumentProperties", true) && content is IMementoCapable)
            {
                try {
                    Properties memento = GetStoredMemento(content);
                    if (memento != null)
                    {
                        ((IMementoCapable)content).SetMemento(memento);
                    }
                } catch (Exception e) {
                    MessageService.ShowError(e, "Can't get/set memento");
                }
            }

            layout.ShowView(content, switchToOpenedView);
            if (switchToOpenedView)
            {
                content.WorkbenchWindow.SelectWindow();
            }
            OnViewOpened(new ViewContentEventArgs(content));
        }