示例#1
0
        void OnClosed(object s, EventArgs a)
        {
            isClosed = true;
//			TypeSystemService.DomRegistered -= UpdateRegisteredDom;
            CancelParseTimeout();
            ClearTasks();
            TypeSystemService.RemoveSkippedfile(FileName);
            if (window is SdiWorkspaceWindow)
            {
                ((SdiWorkspaceWindow)window).DetachFromPathedDocument();
            }
            window.Closed -= OnClosed;
            window.ActiveViewContentChanged -= OnActiveViewContentChanged;
            if (IdeApp.Workspace != null)
            {
                IdeApp.Workspace.ItemRemovedFromSolution -= OnEntryRemoved;
            }

            // Unsubscribe project events
            if (window.ViewContent.Project != null)
            {
                window.ViewContent.Project.Modified -= HandleProjectModified;
            }

            try {
                OnClosed(a);
            } catch (Exception ex) {
                LoggingService.LogError("Exception while calling OnClosed.", ex);
            }

            while (editorExtension != null)
            {
                try {
                    editorExtension.Dispose();
                } catch (Exception ex) {
                    LoggingService.LogError("Exception while disposing extension:" + editorExtension, ex);
                }
                editorExtension = editorExtension.Next as TextEditorExtension;
            }
            editorExtension = null;

            // Parse the file when the document is closed. In this way if the document
            // is closed without saving the changes, the saved compilation unit
            // information will be restored

/*			if (currentParseFile != null) {
 *                              TypeSystemService.QueueParseJob (dom, delegate (string name, IProgressMonitor monitor) {
 *                                      TypeSystemService.Parse (curentParseProject, currentParseFile);
 *                              }, FileName);
 *                      }
 *                      if (isFileDom) {
 *                              TypeSystemService.RemoveFileDom (FileName);
 *                              dom = null;
 *                      }*/

            parsedDocument = null;
            provider       = null;
            Counters.OpenDocuments--;
        }
示例#2
0
        void OnClosed(object s, EventArgs a)
        {
            ProjectDomService.DomRegistered -= UpdateRegisteredDom;
            if (parseTimeout != 0)
            {
                GLib.Source.Remove(parseTimeout);
                parseTimeout = 0;
            }
            ClearTasks();

            string  currentParseFile   = FileName;
            Project curentParseProject = Project;

            if (window is SdiWorkspaceWindow)
            {
                ((SdiWorkspaceWindow)window).DetachFromPathedDocument();
            }
            window.Closed -= OnClosed;
            window.ActiveViewContentChanged -= OnActiveViewContentChanged;
            if (IdeApp.Workspace != null)
            {
                IdeApp.Workspace.ItemRemovedFromSolution -= OnEntryRemoved;
            }

            try {
                OnClosed(a);
            } catch (Exception ex) {
                LoggingService.LogError("Exception while calling OnClosed.", ex);
            }

            while (editorExtension != null)
            {
                try {
                    editorExtension.Dispose();
                } catch (Exception ex) {
                    LoggingService.LogError("Exception while disposing extension:" + editorExtension, ex);
                }
                editorExtension = editorExtension.Next as TextEditorExtension;
            }

            // Parse the file when the document is closed. In this way if the document
            // is closed without saving the changes, the saved compilation unit
            // information will be restored
            if (currentParseFile != null)
            {
                ProjectDomService.QueueParseJob(dom, delegate(string name, IProgressMonitor monitor) {
                    ProjectDomService.Parse(curentParseProject, currentParseFile);
                }, FileName);
            }
            if (isFileDom)
            {
                ProjectDomService.RemoveFileDom(FileName);
                dom = null;
            }

            Counters.OpenDocuments--;
        }
示例#3
0
        void OnClosed(object s, EventArgs a)
        {
            closed = true;
            ClearTasks();

            string  currentParseFile   = FileName;
            Project curentParseProject = Project;

            if (window is SdiWorkspaceWindow)
            {
                ((SdiWorkspaceWindow)window).DetachFromPathedDocument();
            }
            window.Closed -= OnClosed;
            window.ActiveViewContentChanged -= OnActiveViewContentChanged;
            if (IdeApp.Workspace != null)
            {
                IdeApp.Workspace.ItemRemovedFromSolution -= OnEntryRemoved;
            }

            try {
                OnClosed(a);
            } catch (Exception ex) {
                LoggingService.LogError("Exception while calling OnClosed.", ex);
            }

            while (editorExtension != null)
            {
                try {
                    editorExtension.Dispose();
                } catch (Exception ex) {
                    LoggingService.LogError("Exception while disposing extension:" + editorExtension, ex);
                }
                editorExtension = editorExtension.Next as TextEditorExtension;
            }

            // Parse the file when the document is closed. In this way if the document
            // is closed without saving the changes, the saved compilation unit
            // information will be restored
            if (currentParseFile != null)
            {
                System.Threading.ThreadPool.QueueUserWorkItem(delegate {
                    // Don't access Document properties from the thread
                    ProjectDomService.Parse(curentParseProject, currentParseFile, DesktopService.GetMimeTypeForUri(currentParseFile));
                });
            }
            if (fileDom != null)
            {
                ProjectDomService.RemoveFileDom(FileName);
                fileDom = null;
            }

            Counters.OpenDocuments--;
        }
示例#4
0
 void DetachExtensionChain()
 {
     while (editorExtension != null)
     {
         try {
             editorExtension.Dispose();
         } catch (Exception ex) {
             LoggingService.LogError("Exception while disposing extension:" + editorExtension, ex);
         }
         editorExtension = editorExtension.Next as TextEditorExtension;
     }
     editorExtension = null;
 }