internal LineSubdivisionControl(LineSubdivisionUI cmd, LineFeature line, Operation recall)
        {
            InitializeComponent();

            // Remember the command.
            m_Cmd = cmd;

            // Remember the line involved & its length (in meters)
            m_Line = line;
            m_GroundLength = line.GroundLength.Meters;

            // No distances so far.
            m_Distances = null;
            m_FromStart = true;

            // If we are recalling a previous operation, grab the observed distances from there (only the primary face)
            LineSubdivisionOperation op = (recall as LineSubdivisionOperation);

            if (op!=null)
            {
                LineFeature[] sections = op.Face.Sections;
                m_Distances = new List<Distance>(sections.Length);
                foreach (LineFeature s in sections)
                    m_Distances.Add(new Distance(s.ObservedLength));
            }
        }
Ejemplo n.º 2
0
        private void LineSubdivideLine(IUserAction action)
        {
            try
            {
                IControlContainer cc = CreateContainer(action);
                CommandUI cmd = new LineSubdivisionUI(cc, action);
                m_Controller.StartCommand(cmd);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }