public SimpleWorkbenchWindow()
            {
                viewContents = new ViewContentCollection(this);

                OnTitleNameChanged(this, EventArgs.Empty);
                //				this.TabPageContextMenuStrip = MenuService.CreateContextMenu(this, contextMenuPath);
            }
Example #2
0
        public virtual void ShowView(IViewContent content)
        {
            System.Diagnostics.Debug.Assert(layout != null);

            ViewContentCollection.Add(content);
            layout.ShowView(content);
            content.WorkbenchWindow.SelectWindow();
        }
Example #3
0
 public virtual void CloseView(IViewContent content)
 {
     if (ViewContentCollection.Contains(content))
     {
         ViewContentCollection.Remove(content);
     }
     content.Dispose();
     content = null;
 }
Example #4
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));
        }
        public SdiWorkspaceWindow()
        {
            viewContents = new ViewContentCollection(this);

            this.DockAreas       = DockAreas.Document;
            this.DockPadding.All = 2;

            OnTitleNameChanged(this, EventArgs.Empty);
            this.TabPageContextMenuStrip = MenuService.CreateContextMenu(this, contextMenuPath);
        }
Example #6
0
        public void CloseContent(IViewContent content)
        {
            if (ViewContentCollection.Contains(content))
            {
                ViewContentCollection.Remove(content);
            }

            OnViewClosed(new ViewContentEventArgs(content));

            content.Dispose();
            content = null;
        }
Example #7
0
        public AvalonWorkbenchWindow(AvalonDockLayout dockLayout)
        {
            if (dockLayout == null)
            {
                throw new ArgumentNullException("dockLayout");
            }

            CustomFocusManager.SetRememberFocusedChild(this, true);
            this.IsFloatingAllowed = true;
            this.dockLayout        = dockLayout;
            viewContents           = new ViewContentCollection(this);

            ResourceService.LanguageChanged += OnTabPageTextChanged;
        }
Example #8
0
 public void CloseContent(IViewContent content)
 {
     if (PropertyService.Get("SharpDevelop.LoadDocumentProperties", true) && content is IMementoCapable)
     {
         StoreMemento(content);
     }
     if (ViewContentCollection.Contains(content))
     {
         ViewContentCollection.Remove(content);
     }
     OnViewClosed(new ViewContentEventArgs(content));
     content.Dispose();
     content = null;
 }
Example #9
0
        private void NewSolution(string solutionID, string solution)
        {
            FormContent form = new FormContent();

            form.Solution              = SolutionInstance.GetInstance().Solution;
            form.Solution.SolutionID   = solutionID;
            form.Solution.SolutionName = solution;
            form.Text    = solution + "*";
            form.TabText = solution + "*";
            form.Init();
            form.Show(dockPanel);
            ViewContentCollection.Add(form);
            this.InitDockForm();
        }
Example #10
0
        public void ShowView(IViewContent content, bool switchToOpenedView)
        {
            WorkbenchSingleton.AssertMainThread();
            if (content == null)
            {
                throw new ArgumentNullException("content");
            }
            if (ViewContentCollection.Contains(content))
            {
                throw new ArgumentException("ViewContent was already shown");
            }
            System.Diagnostics.Debug.Assert(WorkbenchLayout != null);

            LoadViewContentMemento(content);

            WorkbenchLayout.ShowView(content, switchToOpenedView);
        }
Example #11
0
 private void OpenSolution(string fileName)
 {
     if (File.Exists(fileName))
     {
         FormContent form = new FormContent();
         form.FileName = fileName;
         form.Init();
         if (form.Controls.Count == 0)
         {
             MessageBox.Show("该文件可能是版本过旧,无法识别");
             return;
         }
         form.Show(dockPanel);
         ViewContentCollection.Add(form);
         this.InitDockForm();
     }
 }
Example #12
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));
        }