/// <summary> /// Closes the document and removes any views of it from the UI</summary> /// <param name="document">Document to close</param> public void Close(IDocument document) { EditingContext context = document.As <EditingContext>(); // close all active EditingContexts in the document foreach (DomNode node in context.DomNode.Subtree) { foreach (EditingContext editingContext in node.AsAll <EditingContext>()) { m_contextRegistry.RemoveContext(editingContext); } } // close the document m_documentRegistry.Remove(document); // finally unregister the control ViewingContext viewingContext = document.Cast <ViewingContext>(); m_controlHostService.UnregisterControl(viewingContext.Control); viewingContext.Control.Dispose(); viewingContext.Control = null; }
/// <summary> /// Makes the document visible to the user</summary> /// <param name="document">Document to show</param> public void Show(IDocument document) { var viewingContext = document.Cast <ViewingContext>(); m_controlHostService.Show(viewingContext.Control); }
/// <summary> /// Makes the document visible to the user</summary> /// <param name="document">Document to show</param> public void Show(IDocument document) { var viewingContext = document.Cast<ViewingContext>(); m_controlHostService.Show(viewingContext.Control); }