コード例 #1
0
        /// <summary>
        /// Forces initialization of the specified view.
        /// </summary>
        public virtual void ForceInitializeView(IViewContent view)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }

            try {
                if (currentView != view)
                {
                    if (currentView == null)
                    {
                        SwitchedToView(view);
                    }
                    else
                    {
                        try {
                            inLoadOperation = true;
                            using (Stream sourceStream = OpenRead()) {
                                view.Load(this, sourceStream);
                            }
                        } finally {
                            inLoadOperation = false;
                        }
                    }
                }
            } catch (Exception) {
                view.Dispose();
                throw;
            }
        }
コード例 #2
0
ファイル: SdiWorkspaceWindow.cs プロジェクト: ywscr/Pinta
        protected override void OnDestroyed()
        {
            if (present_timeout != 0)
            {
                GLib.Source.Remove(present_timeout);
            }

            base.OnDestroyed();
            if (viewContents != null)
            {
                foreach (IAttachableViewContent sv in SubViewContents)
                {
                    sv.Dispose();
                }
                viewContents = null;
            }

            if (content != null)
            {
                content.ContentNameChanged -= new EventHandler(SetTitleEvent);
                content.DirtyChanged       -= HandleDirtyChanged;
                content.BeforeSave         -= new EventHandler(BeforeSave);
                content.ContentChanged     -= new EventHandler(OnContentChanged);
                content.WorkbenchWindow     = null;
                content.Dispose();
                content = null;
            }

            if (subViewToolbar != null)
            {
                subViewToolbar.Dispose();
                subViewToolbar = null;
            }
        }
コード例 #3
0
ファイル: AltaxoWorkbench.cs プロジェクト: olesar/Altaxo
 public void CloseContent(IViewContent viewcontent)
 {
     if (_documentCollection.Remove(viewcontent))
     {
         viewcontent.Dispose();
     }
 }
コード例 #4
0
        protected override void OnDestroyed()
        {
            base.OnDestroyed();
            if (viewContents != null)
            {
                foreach (IAttachableViewContent sv in SubViewContents)
                {
                    sv.Dispose();
                }
                viewContents = null;
            }

            if (content != null)
            {
                content.ContentNameChanged -= new EventHandler(SetTitleEvent);
                content.DirtyChanged       -= HandleDirtyChanged;
                content.BeforeSave         -= new EventHandler(BeforeSave);
                content.ContentChanged     -= new EventHandler(OnContentChanged);
                content.WorkbenchWindow     = null;
                content.Dispose();
                content = null;
            }

            DetachFromPathedDocument();
            commandHandler   = null;
            document         = null;
            extensionContext = null;
        }
コード例 #5
0
        public bool CloseWindow(bool force, bool animate)
        {
            bool wasActive = workbench.ActiveWorkbenchWindow == this;
            WorkbenchWindowEventArgs args = new WorkbenchWindowEventArgs(force, wasActive);

            args.Cancel = false;
            OnClosing(args);
            if (args.Cancel)
            {
                return(false);
            }

            workbench.RemoveTab(tab.Index, animate);

            OnClosed(args);

            foreach (IAttachableViewContent sv in SubViewContents)
            {
                sv.Dispose();
            }

            content.ContentNameChanged -= new EventHandler(SetTitleEvent);
            content.DirtyChanged       -= HandleDirtyChanged;
            content.BeforeSave         -= new EventHandler(BeforeSave);
            content.ContentChanged     -= new EventHandler(OnContentChanged);
            content.WorkbenchWindow     = null;
            content.Dispose();

            DetachFromPathedDocument();
            Destroy();
            return(true);
        }
コード例 #6
0
        public override void Dispose()
        {
            content.ContentChanged -= new EventHandler(OnTextContentChanged);
            content.DirtyChanged   -= new EventHandler(OnTextDirtyChanged);
            IdeApp.Workbench.ActiveDocumentChanged -= new EventHandler(OnActiveDocumentChanged);
            content.Dispose();

            // Remove and destroy the contents of the Notebook, since the destroy event is
            // not propagated to pages in some gtk versions.

            foreach (Gtk.Widget cw in notebook.Children)
            {
                Gtk.Widget lw = notebook.GetTabLabel(cw);
                notebook.Remove(cw);
                cw.Destroy();
                if (lw != null)
                {
                    lw.Destroy();
                }
            }
            content = null;
            box     = null;

            base.Dispose();
        }
コード例 #7
0
ファイル: EditorView.cs プロジェクト: wnf0000/Eto
 public override void Dispose()
 {
     content.ContentChanged -= content_ContentChanged;
     content.DirtyChanged   -= content_DirtyChanged;
     IdeApp.Workbench.ActiveDocumentChanged -= Workbench_ActiveDocumentChanged;
     content.Dispose();
     base.Dispose();
 }
コード例 #8
0
 public virtual void CloseView(IViewContent content)
 {
     if (ViewContentCollection.Contains(content))
     {
         ViewContentCollection.Remove(content);
     }
     content.Dispose();
     content = null;
 }
コード例 #9
0
        public void CloseContent(IViewContent content)
        {
            if (views.Contains(content))
            {
                views.Remove(content);
            }

            content.Dispose();
        }
コード例 #10
0
        public bool CloseWindow(bool force, bool fromMenu, int pageNum)
        {
            bool wasActive = workbench.ActiveWorkbenchWindow == this;
            WorkbenchWindowEventArgs args = new WorkbenchWindowEventArgs(force, wasActive);

            args.Cancel = false;
            OnClosing(args);
            if (args.Cancel)
            {
                return(false);
            }
            if (fromMenu == true)
            {
                workbench.RemoveTab(tabControl.PageNum(this));
            }
            else
            {
                workbench.RemoveTab(pageNum);
            }
            OnClosed(args);

            content.ContentNameChanged -= new EventHandler(SetTitleEvent);
            content.DirtyChanged       -= new EventHandler(SetTitleEvent);
            content.BeforeSave         -= new EventHandler(BeforeSave);
            content.ContentChanged     -= new EventHandler(OnContentChanged);
            content.WorkbenchWindow     = null;

            if (subViewContents != null)
            {
                foreach (IAttachableViewContent sv in subViewContents)
                {
                    subViewNotebook.Remove(sv.Control);
                    sv.Dispose();
                }
                this.subViewContents = null;
                subViewNotebook.Remove(content.Control);
            }
            DetachFromPathedDocument();
            content.Dispose();
            box.Destroy();

            this.subViewToolbar = null;
            this.separatorItem  = null;

            this.content         = null;
            this.subViewNotebook = null;
            this.tabControl      = null;
            tabLabel.Destroy();
            this.tabLabel = null;
            this.tabPage  = null;

            Destroy();
            return(true);
        }
コード例 #11
0
        public void CloseContent(IViewContent content)
        {
            if (ViewContentCollection.Contains(content))
            {
                ViewContentCollection.Remove(content);
            }

            OnViewClosed(new ViewContentEventArgs(content));

            content.Dispose();
            content = null;
        }
コード例 #12
0
        public override void Dispose()
        {
            content.ContentChanged -= new EventHandler(OnTextContentChanged);
            content.DirtyChanged   -= new EventHandler(OnTextDirtyChanged);
            IdeApp.Workbench.ActiveDocumentChanged -= new EventHandler(OnActiveDocumentChanged);
            content.Dispose();

            content = null;
            control = null;

            base.Dispose();
        }
コード例 #13
0
        public void CloseView(IViewContent content)
        {
            bool tempProperties = propertyService.GetProperty("NetFocus.DataStructure.LoadDocumentProperties", true);

            if (tempProperties && content is IMementoCapable)
            {
                workbench.StoreMemento(content);
            }
            workbench.ViewContentCollection.Remove(content);

            content.Dispose();
        }
コード例 #14
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;
 }
コード例 #15
0
        public bool CloseWindow(bool force, bool fromMenu, int pageNum)
        {
            bool wasActive = workbench.ActiveWorkbenchWindow == this;
            WorkbenchWindowEventArgs args = new WorkbenchWindowEventArgs(force, wasActive);

            args.Cancel = false;
            OnClosing(args);
            if (args.Cancel)
            {
                return(false);
            }

            if (fromMenu == true)
            {
                workbench.RemoveTab(tabControl.PageNum(this));
            }
            else
            {
                workbench.RemoveTab(pageNum);
            }
            OnClosed(args);

            if (subViewContents != null)
            {
                foreach (IAttachableViewContent sv in subViewContents)
                {
                    sv.Dispose();
                }
            }

            content.ContentNameChanged             -= new EventHandler(SetTitleEvent);
            content.DirtyChanged                   -= new EventHandler(SetTitleEvent);
            content.BeforeSave                     -= new EventHandler(BeforeSave);
            content.ContentChanged                 -= new EventHandler(OnContentChanged);
            content.WorkbenchWindow                 = null;
            IdeApp.Workbench.ActiveDocumentChanged -= ActiveDocumentChanged;
            content.Dispose();

            DetachFromPathedDocument();
            Destroy();
            return(true);
        }
コード例 #16
0
        public void CloseContent(IViewContent content)
        {
            if (PropertyService.Get("FanHai.Gui.Framework.LoadDocumentProperties", true) && content is IMementoCapable)
            {
                StoreMemento(content);
            }
            if (primaryViewContentCollection.Contains(content))
            {
                primaryViewContentCollection.Remove(content);
            }
            OnViewClosed(new ViewContentEventArgs(content));
            content.Dispose();
            content = null;
            int i = primaryViewContentCollection.Count;

            if (i > 0)
            {
                primaryViewContentCollection[i - 1].WorkbenchWindow.SelectWindow();
            }
        }
コード例 #17
0
        /// <summary>
        /// Forces initialization of the specified view.
        /// </summary>
        public virtual void ForceInitializeView(IViewContent view)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }

            bool success = false;

            try {
                if (currentView != view)
                {
                    if (currentView == null)
                    {
                        SwitchedToView(view);
                    }
                    else
                    {
                        try {
                            inLoadOperation = true;
                            using (Stream sourceStream = OpenRead()) {
                                view.Load(this, sourceStream);
                            }
                        } finally {
                            inLoadOperation = false;
                        }
                    }
                }
                success = true;
            } finally {
                // Only in case of exceptions:
                // (try-finally with bool is better than try-catch-rethrow because it causes the debugger to stop
                // at the original error location, not at the rethrow)
                if (!success)
                {
                    view.Dispose();
                }
            }
        }
コード例 #18
0
 public void CloseContent(IViewContent content)
 {
     if (PropertyService.Get<bool>("SharpDevelop.LoadDocumentProperties", true) && (content is IMementoCapable))
     {
         this.StoreMemento(content);
     }
     if (this.ViewContentCollection.Contains(content))
     {
         this.ViewContentCollection.Remove(content);
     }
     this.OnViewClosed(new ViewContentEventArgs(content));
     content.Dispose();
     if (content.WorkbenchWindow != null)
     {
         content.WorkbenchWindow.CloseWindow(false);
     }
     content = null;
 }
コード例 #19
0
		public void CloseContent(IViewContent content)
		{
			if (PropertyService.Get("SharpDevelop.LoadDocumentProperties", true) && content is IMementoCapable) {
				StoreMemento(content);
			}
			if (primaryViewContentCollection.Contains(content)) {
				primaryViewContentCollection.Remove(content);
			}
			OnViewClosed(new ViewContentEventArgs(content));
			content.Dispose();
			content = null;
		}
コード例 #20
0
ファイル: OpenedFile.cs プロジェクト: fanyjie/SharpDevelop
        /// <summary>
        /// Forces initialization of the specified view.
        /// </summary>
        public virtual void ForceInitializeView(IViewContent view)
        {
            if (view == null)
                throw new ArgumentNullException("view");

            bool success = false;
            try {
                if (currentView != view) {
                    if (currentView == null) {
                        SwitchedToView(view);
                    } else {
                        try {
                            inLoadOperation = true;
                            using (Stream sourceStream = OpenRead()) {
                                view.Load(this, sourceStream);
                            }
                        } finally {
                            inLoadOperation = false;
                        }
                    }
                }
                success = true;
            } finally {
                // Only in case of exceptions:
                // (try-finally with bool is better than try-catch-rethrow because it causes the debugger to stop
                // at the original error location, not at the rethrow)
                if (!success) {
                    view.Dispose();
                }
            }
        }
コード例 #21
0
ファイル: OpenedFile.cs プロジェクト: lisiynos/pascalabcnet
		/// <summary>
		/// Forces initialization of the specified view.
		/// </summary>
		public virtual void ForceInitializeView(IViewContent view)
		{
			if (view == null)
				throw new ArgumentNullException("view");
			
			try {
				if (currentView != view) {
					if (currentView == null) {
						SwitchedToView(view);
					} else {
						try {
							inLoadOperation = true;
							using (Stream sourceStream = OpenRead()) {
								view.Load(this, sourceStream);
							}
						} finally {
							inLoadOperation = false;
						}
					}
				}
			} catch (Exception) {
				view.Dispose();
				throw;
			}
		}
コード例 #22
0
		public void CloseView(IViewContent content)
		{
			bool tempProperties = propertyService.GetProperty("NetFocus.DataStructure.LoadDocumentProperties", true);
			if (tempProperties && content is IMementoCapable) 
			{
				workbench.StoreMemento(content);
			}
			workbench.ViewContentCollection.Remove(content);

			content.Dispose();
			
		}
コード例 #23
0
 public virtual void CloseView(IViewContent content)
 {
     if (ViewContentCollection.Contains(content))
     {
         ViewContentCollection.Remove(content);
     }
     content.Dispose();
     content = null;
 }
コード例 #24
0
ファイル: Workbench.cs プロジェクト: Bombadil77/SharpDevelop
		public void CloseContent(IViewContent content)
		{
			if (views.Contains(content)) {
				views.Remove(content);
			}
			
			content.Dispose();
		}