コード例 #1
0
ファイル: Editor.cs プロジェクト: zoombapup/ATF
        /// <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;
        }
コード例 #2
0
ファイル: Editor.cs プロジェクト: zoombapup/ATF
        /// <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);
        }
コード例 #3
0
ファイル: Editor.cs プロジェクト: sbambach/ATF
 /// <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);
 }