/// <summary>
        /// Starts the user interface for this command.
        /// </summary>
        /// <returns>True if command started ok.</returns>
        internal override bool Run()
        {
            // Don't run more than once.
            if (m_Dialog != null || m_UpDial != null)
            {
                throw new Exception("LineSubdivisionUI.Run - Command is already running.");
            }

            // Are we doing an update?
            UpdateUI pup = this.Update;

            // Create modeless dialog.
            if (pup != null)
            {
                m_UpDial = new LineSubdivisionUpdateForm(pup);
                m_UpDial.Show();
            }
            else
            {
                Debug.Assert(m_Parent != null);
                m_Dialog = new LineSubdivisionControl(this, m_Parent, this.Recall);
                this.Container.Display(m_Dialog);
            }

            return(true);
        }
        /// <summary>
        /// Constructor for doing an update.
        /// </summary>
        /// <param name="editId">The ID of the edit this command deals with.</param>
        /// <param name="updcmd">The update command.</param>
        internal LineSubdivisionUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
            : base(cc, editId, updcmd)
        {
            // The dialog will be created by Run()
            m_Dialog = null;
            m_UpDial = null;

            // The line being subdivided is known via the update.
            m_Parent = null;
        }
        /// <summary>
        /// Destroys any dialogs that are currently displayed.
        /// </summary>
        void KillDialogs()
        {
            this.Container.Clear();

            if (m_Dialog != null)
            {
                m_Dialog.Dispose();
                m_Dialog = null;
            }

            if (m_UpDial != null)
            {
                m_UpDial.Close();
                m_UpDial.Dispose();
                m_UpDial = null;
            }
        }