コード例 #1
0
        void Dispose()
        {
            DocumentRegistry.Remove(this);
            callbackRegistration?.Dispose();
            var workspace = Runtime.PeekService <RootWorkspace> ();

            if (workspace != null)
            {
                workspace.ItemRemovedFromSolution -= OnEntryRemoved;
            }

            UnsubscribeControllerEvents();
            if (view != null)
            {
                view.ActiveViewInHierarchyChanged -= ActiveViewInHierarchyChanged;
                view.IsRoot = false;
                view.Dispose();                  // This will also dispose the controller
            }

            window.CloseRequested -= Window_CloseRequested;
            window = null;

            contentCallbackRegistry           = null;
            contentActiveViewCallbackRegistry = null;
        }
コード例 #2
0
ファイル: Document.cs プロジェクト: sim756/monodevelop
        internal void DisposeDocument()
        {
            DocumentRegistry.Remove(this);
            UnsubscribeAnalysisDocument();
            UnsubscribeRoslynWorkspace();
            UnloadAdhocProject();
            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;
            }
            window.ViewsChanged += HandleViewsChanged;
            MonoDevelopWorkspace.LoadingFinished -= ReloadAnalysisDocumentHandler;

            window = null;

            parsedDocument = null;
            views          = null;
            viewsRO        = null;
        }
コード例 #3
0
ファイル: Document.cs プロジェクト: leculver/monodevelop
        internal void Dispose()
        {
            DocumentRegistry.Remove(this);
            callbackRegistration?.Dispose();
            var workspace = Runtime.PeekService <RootWorkspace> ();

            if (workspace != null)
            {
                workspace.ItemRemovedFromSolution -= OnEntryRemoved;
            }

            UnsubscribeControllerEvents();
            window.SetRootView(null);
            view.IsRoot = false;
            view.Dispose();              // This will also dispose the controller

            window = null;

            contentCallbackRegistry           = null;
            contentActiveViewCallbackRegistry = null;
        }