Exemple #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;
            }
        }
Exemple #2
0
        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;
            }
        }
Exemple #3
0
 public void CloseContent(IViewContent viewcontent)
 {
     if (_documentCollection.Remove(viewcontent))
     {
         viewcontent.Dispose();
     }
 }
Exemple #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;
        }
        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);
        }
Exemple #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();
        }
Exemple #7
0
 public override void Dispose()
 {
     content.ContentChanged -= content_ContentChanged;
     content.DirtyChanged   -= content_DirtyChanged;
     IdeApp.Workbench.ActiveDocumentChanged -= Workbench_ActiveDocumentChanged;
     content.Dispose();
     base.Dispose();
 }
Exemple #8
0
 public virtual void CloseView(IViewContent content)
 {
     if (ViewContentCollection.Contains(content))
     {
         ViewContentCollection.Remove(content);
     }
     content.Dispose();
     content = null;
 }
        public void CloseContent(IViewContent content)
        {
            if (views.Contains(content))
            {
                views.Remove(content);
            }

            content.Dispose();
        }
        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);
        }
Exemple #11
0
        public void CloseContent(IViewContent content)
        {
            if (ViewContentCollection.Contains(content))
            {
                ViewContentCollection.Remove(content);
            }

            OnViewClosed(new ViewContentEventArgs(content));

            content.Dispose();
            content = null;
        }
Exemple #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();
        }
Exemple #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();
        }
 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;
 }
Exemple #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);
        }
Exemple #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();
            }
        }
        /// <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();
                }
            }
        }
 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;
 }
		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;
		}
Exemple #20
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();
                }
            }
        }
Exemple #21
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;
			}
		}
		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();
			
		}
 public virtual void CloseView(IViewContent content)
 {
     if (ViewContentCollection.Contains(content))
     {
         ViewContentCollection.Remove(content);
     }
     content.Dispose();
     content = null;
 }
Exemple #24
0
		public void CloseContent(IViewContent content)
		{
			if (views.Contains(content)) {
				views.Remove(content);
			}
			
			content.Dispose();
		}