Example #1
0
        bool SaveLineAnnotationPage(CadastralMapModel cmm)
        {
            LineAnnotationStyle anno = EditingController.Current.LineAnnotationStyle;

            // Annotation scale threshold

            double showScale;

            if (!Double.TryParse(annoScaleTextBox.Text, out showScale))
            {
                tabControl.SelectedTab = LineAnnotationTabPage;
                annoScaleTextBox.Focus();
                MessageBox.Show("Cannot parse scale threshold for line annotations");
                return(false);
            }

            if (Math.Abs(showScale - anno.ShowScale) > 0.001)
            {
                anno.ShowScale = showScale;
            }

            // Annotation height

            double height;

            if (!Double.TryParse(annoHeightTextBox.Text, out height))
            {
                tabControl.SelectedTab = LineAnnotationTabPage;
                annoHeightTextBox.Focus();
                MessageBox.Show("Cannot parse height for line annotations");
                return(false);
            }

            if (Math.Abs(height - anno.Height) > 0.001)
            {
                anno.Height = height;
            }

            // What needs to be shown...

            anno.ShowAdjustedLengths = false;
            anno.ShowObservedLengths = false;

            if (annoAdjustedLengthsRadioButton.Checked)
            {
                anno.ShowAdjustedLengths = true;
            }
            else if (annoObservedLengthsRadioButton.Checked)
            {
                anno.ShowObservedLengths = true;
            }

            anno.ShowObservedAngles = observedAnglesCheckBox.Checked;

            return(true);
        }
Example #2
0
        void ShowLineAnnotationPage()
        {
            LineAnnotationStyle anno = EditingController.Current.LineAnnotationStyle;

            annoScaleTextBox.Text  = String.Format("{0:F0}", anno.ShowScale);
            annoHeightTextBox.Text = String.Format("{0:F2}", anno.Height);

            if (anno.ShowAdjustedLengths)
            {
                annoAdjustedLengthsRadioButton.Checked = true;
            }
            else if (anno.ShowObservedLengths)
            {
                annoObservedLengthsRadioButton.Checked = true;
            }
            else
            {
                annoNothingRadioButton.Checked = true;
            }

            observedAnglesCheckBox.Checked = anno.ShowObservedAngles;
        }