Esempio n. 1
0
        /// <summary>
        /// Runs the update for the current update feature.
        /// </summary>
        /// <returns>True if an update command dialog has been started.</returns>
        bool RunUpdate()
        {
            // Get the operation that created the feature selected for update.
            Operation pop = GetOp();

            if (pop == null)
            {
                return(false);
            }

            // There shouldn't already be a command running.
            if (m_Cmd != null)
            {
                MessageBox.Show("UpdateUI.RunUpdate - Update already running?");
                return(false);
            }

            // The IControlContainer is a bit of a dodo.
            IControlContainer cc = new ContainerForm("Update");

            switch (pop.EditId)
            {
            case EditingActionId.LineExtend:
            {
                m_Cmd = new LineExtensionUI(cc, pop.EditId, this);
                break;
            }

            case EditingActionId.LineSubdivision:
            {
                m_Cmd = new LineSubdivisionUI(cc, pop.EditId, this);
                break;
            }

            // SS20101011 - In the past, you were allowed to change the lines that were intersected
            // as part of Direction-Line and Line-Line intersects. This would not be a problem if
            // the lines were left un-split. However, if you split the lines, it is possible that
            // subsequent edits would refer to the resultant sections. So if you later refer to a
            // different line, those edits would become invalid. That's why the ability to change
            // Line-Line intersects has been removed. The Direction-Line option is still valid,
            // because you are allowed to change the direction.

            // In the future, it would be better to modify the Direction-Line and Line-Line edits
            // to prohibit splits. That would probably be better handled by a new edit that would
            // let users split a line at an intersection (although I haven't thought that through -
            // it's possible that such an edit would also be subject to similar issues).

            case EditingActionId.DirIntersect:
            case EditingActionId.DirDistIntersect:
            case EditingActionId.DirLineIntersect:
            case EditingActionId.DistIntersect:
                //case EditingActionId.LineIntersect:
            {
                m_Cmd = new IntersectUI(pop.EditId, this);
                break;
            }

            case EditingActionId.NewPoint:
            case EditingActionId.GetControl:
            {
                m_Cmd = new NewPointUI(cc, pop.EditId, this);
                break;
            }

            case EditingActionId.NewCircle:
            {
                m_Cmd = new NewCircleUI(cc, pop.EditId, this);
                break;
            }

            case EditingActionId.Path:
            {
                m_Cmd = new PathUI(cc, pop.EditId, this);
                break;
            }

            case EditingActionId.Parallel:
            {
                m_Cmd = new ParallelLineUI(cc, pop.EditId, this);
                break;
            }

            case EditingActionId.Radial:
            {
                m_Cmd = new RadialUI(cc, pop.EditId, this);
                break;
            }

            case EditingActionId.SimpleLineSubdivision:
            {
                m_Cmd = new SimpleLineSubdivisionUI(cc, pop.EditId, this);
                break;
            }
            }

            if (m_Cmd != null)
            {
                m_Cmd.Run();
                return(true);
            }

            MessageBox.Show("You cannot update the selected feature this way.");
            return(false);
        }
Esempio n. 2
0
        /// <summary>
        /// Runs the update for the current update feature.
        /// </summary>
        /// <returns>True if an update command dialog has been started.</returns>
        bool RunUpdate()
        {
            // Get the operation that created the feature selected for update.
            Operation pop = GetOp();
            if (pop == null)
                return false;

            // There shouldn't already be a command running.
            if (m_Cmd != null)
            {
                MessageBox.Show("UpdateUI.RunUpdate - Update already running?");
                return false;
            }

            // The IControlContainer is a bit of a dodo.
            IControlContainer cc = new ContainerForm("Update");

            switch (pop.EditId)
            {
                case EditingActionId.LineExtend:
                {
                    m_Cmd = new LineExtensionUI(cc, pop.EditId, this);
                    break;
                }

                case EditingActionId.LineSubdivision:
                {
                    m_Cmd = new LineSubdivisionUI(cc, pop.EditId, this);
                    break;
                }

                // SS20101011 - In the past, you were allowed to change the lines that were intersected
                // as part of Direction-Line and Line-Line intersects. This would not be a problem if
                // the lines were left un-split. However, if you split the lines, it is possible that
                // subsequent edits would refer to the resultant sections. So if you later refer to a
                // different line, those edits would become invalid. That's why the ability to change
                // Line-Line intersects has been removed. The Direction-Line option is still valid,
                // because you are allowed to change the direction.

                // In the future, it would be better to modify the Direction-Line and Line-Line edits
                // to prohibit splits. That would probably be better handled by a new edit that would
                // let users split a line at an intersection (although I haven't thought that through -
                // it's possible that such an edit would also be subject to similar issues).

                case EditingActionId.DirIntersect:
                case EditingActionId.DirDistIntersect:
                case EditingActionId.DirLineIntersect:
                case EditingActionId.DistIntersect:
                //case EditingActionId.LineIntersect:
                {
                    m_Cmd = new IntersectUI(pop.EditId, this);
                    break;
                }

                case EditingActionId.NewPoint:
                case EditingActionId.GetControl:
                {
                    m_Cmd = new NewPointUI(cc, pop.EditId, this);
                    break;

                }

                case EditingActionId.NewCircle:
                {
                    m_Cmd = new NewCircleUI(cc, pop.EditId, this);
                    break;
                }

                case EditingActionId.Path:
                {
                    m_Cmd = new PathUI(cc, pop.EditId, this);
                    break;
                }

                case EditingActionId.Parallel:
                {
                    m_Cmd = new ParallelLineUI(cc, pop.EditId, this);
                    break;
                }

                case EditingActionId.Radial:
                {
                    m_Cmd = new RadialUI(cc, pop.EditId, this);
                    break;
                }

                case EditingActionId.SimpleLineSubdivision:
                {
                    m_Cmd = new SimpleLineSubdivisionUI(cc, pop.EditId, this);
                    break;
                }
            }

            if (m_Cmd != null)
            {
                m_Cmd.Run();
                return true;
            }

            MessageBox.Show("You cannot update the selected feature this way.");
            return false;
        }