Пример #1
0
        /// <summary>
        /// Constructor for performing a sideshot from the currently selected point.
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        /// <exception cref="InvalidOperationException">If a specific point is not currently selected</exception>
        internal RadialUI(IControlContainer cc, IUserAction action)
            : base(cc, action)
        {
            PointFeature from = EditingController.SelectedPoint;
            if (from == null)
                throw new InvalidOperationException("You must initially select the point the sideshot radiates from.");

            m_Dialog = null;
            m_From = from;
        }
Пример #2
0
        public override void Dispose()
        {
            base.Dispose(); // removes any controls from container

            if (m_Dialog!=null)
            {
                m_Dialog.Dispose();
                m_Dialog = null;
            }
        }
Пример #3
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 RadialUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
     : base(cc, editId, updcmd)
 {
     m_Dialog = null;
     m_From = null;
 }
Пример #4
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("RadialUI.Run - Command is already running.");

            UpdateUI pup = this.Update;

            if (pup!=null)
                m_Dialog = new RadialControl(pup);
            else
            {
                if (m_From==null)
                {
                    RadialOperation recall = (RadialOperation)this.Recall;
                    m_From = recall.From;
                }

                m_Dialog = new RadialControl(this, m_From);
            }

            this.Container.Display(m_Dialog);
            return true;
        }