示例#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);
 }