예제 #1
0
 /// <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 NewPointUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
     : base(cc, editId, updcmd)
 {
     m_Dialog = null;
 }
예제 #2
0
 /// <summary>
 /// Constructor for command recall.
 /// </summary>
 /// <param name="action">The action that initiated this command</param>
 /// <param name="op">The operation that's being recalled.</param>
 internal NewPointUI(IControlContainer cc, IUserAction action, Operation op)
     : base(cc, action, null, op)
 {
     m_Dialog = null;
 }
예제 #3
0
        /// <summary>
        /// Starts the user interface (if any) 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)
                throw new InvalidOperationException("NewPointUI.Run - Command is already running.");

            UpdateUI pup = this.Update;

            // Create the appropriate sort of dialog.
            switch (this.EditId)
            {
                case EditingActionId.NewPoint:
                {
                    if (pup!=null)
                        m_Dialog = new NewPointForm(pup, "Update Point", null);
                    else
                        m_Dialog = new NewPointForm(this, "Define New Point", this.Recall);

                    break;
                }

                case EditingActionId.GetControl:
                {
                    if (pup!=null)
                    {
                        m_Dialog = new NewPointForm(pup, "Update Control Point", null);
                        break;
                    }

                    // Drop through to default if not making an update.
                    goto default;
                }

                default:
                {
                    throw new Exception("NewPointUI.Run - Unexpected command id.");
                }
            }

            m_Dialog.Show();
            return true;
        }
예제 #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="action">The action that initiated this command</param>
 internal NewPointUI(IControlContainer cc, IUserAction action)
     : base(cc, action)
 {
     m_Dialog = null;
 }
예제 #5
0
 public override void Dispose()
 {
     if (m_Dialog!=null)
     {
         m_Dialog.Dispose();
         m_Dialog = null;
     }
 }