Exemplo n.º 1
0
        /// <summary>
        /// Requests permission to close the client's Control.</summary>
        /// <param name="control">Client control to be closed</param>
        /// <returns>True if the control can close, or false to cancel</returns>
        bool IControlHostClient.Close(Control control)
        {
            bool closed = true;

            SceneDocument document = control.Tag as SceneDocument;

            if (document != null)
            {
                SceneEditingContext context = document.As <SceneEditingContext>();
                if (context != null)
                {
                    m_controlHostService.UnregisterControl(context.TreeEditor.TreeControl);
                }

                closed = m_documentService.Close(document);
                if (closed)
                {
                    //m_currentEditContext = null;
                    m_propertyEditor.PropertyGrid.Bind(null);
                    m_contextRegistry.RemoveContext(document);
                }
            }

            return(closed);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Activates the client control</summary>
        /// <param name="control">Client control to be activated</param>
        void IControlHostClient.Activate(Control control)
        {
            SceneDocument document = control.Tag as SceneDocument;

            if (document != null)
            {
                m_documentRegistry.ActiveDocument = document;

                SceneEditingContext context = document.As <SceneEditingContext>();
                m_contextRegistry.ActiveContext = context;
                //context.TreeEditor.TreeControl.Focus();
            }
        }