private void InitCivilEngineering()
        {
            Name = "Civil Engineering";

            DrawingScales = new NDrawingScale[]
            {
                new NDrawingScale("1\" = 100\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.01f, false),
                new NDrawingScale("1\" = 90\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.0111111111f, false),
                new NDrawingScale("1\" = 80\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.0125f, false),
                new NDrawingScale("1\" = 70\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.0142857143f, false),
                new NDrawingScale("1\" = 60\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.01666666667f, false),
                new NDrawingScale("1\" = 50\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.02f, false),
                new NDrawingScale("1\" = 40\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.025f, false),
                new NDrawingScale("1\" = 30\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.03333333333f, true),
                new NDrawingScale("1\" = 20\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.05f, false),
                new NDrawingScale("1\" = 10\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.1f, false),
                new NDrawingScale("1\" = 1\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 12, false)
            };
        }
        private void InitMechanicalEngineering()
        {
            Name = "Mechanical Engineering";

            DrawingScales = new NDrawingScale[]
            {
                new NDrawingScale("1/32:1", NMetricUnit.Millimeter, NMetricUnit.Millimeter, 0.03125f, false),
                new NDrawingScale("1/16:1", NMetricUnit.Millimeter, NMetricUnit.Millimeter, 0.0625f, false),
                new NDrawingScale("1/8:1", NMetricUnit.Millimeter, NMetricUnit.Millimeter, 0.125f, false),
                new NDrawingScale("1/4:1", NMetricUnit.Millimeter, NMetricUnit.Millimeter, 0.25f, false),
                new NDrawingScale("1/2:1", NMetricUnit.Millimeter, NMetricUnit.Millimeter, 0.5f, false),
                new NDrawingScale("1:1", NMetricUnit.Millimeter, NMetricUnit.Millimeter, 1.0f, true),
                new NDrawingScale("2:1", NMetricUnit.Millimeter, NMetricUnit.Millimeter, 2.0f, false),
                new NDrawingScale("4:1", NMetricUnit.Millimeter, NMetricUnit.Millimeter, 4.0f, false),
                new NDrawingScale("6:1", NMetricUnit.Millimeter, NMetricUnit.Millimeter, 6.0f, false),
                new NDrawingScale("8:1", NMetricUnit.Millimeter, NMetricUnit.Millimeter, 8.0f, false),
                new NDrawingScale("10:1", NMetricUnit.Millimeter, NMetricUnit.Millimeter, 10.0f, false),
            };
        }
        private void InitArchitectural()
        {
            Name = "Architectural";

            DrawingScales = new NDrawingScale[]
            {
                new NDrawingScale("3/32\" = 1\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.09375f, false),
                new NDrawingScale("1/8\" = 1\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.125f, false),
                new NDrawingScale("3/16\" = 1\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.1875f, false),
                new NDrawingScale("1/4\" = 1\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.25f, false),
                new NDrawingScale("3/8\" = 1\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.375f, false),
                new NDrawingScale("1/2\" = 1\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.5f, true),
                new NDrawingScale("3/4\" = 1\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 0.75f, false),
                new NDrawingScale("1\" = 1\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 1f, false),
                new NDrawingScale("1 1/2\" = 1\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 1.5f, false),
                new NDrawingScale("3\" = 1\'0\"", NEnglishUnit.Inch, NEnglishUnit.Foot, 3f, false),
                new NDrawingScale("1\' = 1\'0\"", NEnglishUnit.Foot, NEnglishUnit.Foot, 1f, false)
            };
        }
        private void CreateSampleDocument(NDrawingScaleSystem system, NDrawingScale scale)
        {
            // begin init
            document.Reset();
            document.BeginInit();

            // setup drawing scale
            document.DrawingScaleMode           = DrawingScaleMode.CustomScale;
            document.MeasurementUnit            = scale.MeasurementUnit;
            document.CustomWorldMeasurementUnit = scale.WorldMeasurementUnit;
            document.CustomScale = scale.ScaleFactor;

            // create drawing content
            switch (system.Type)
            {
            case DrawingScaleSystemType.Architectural:
                CreateArchitecturalDocument();
                break;

            case DrawingScaleSystemType.CivilEngineering:
                CreateCivilEngineeringDocument();
                break;

            case DrawingScaleSystemType.Metric:
                CreateMetricDocument();
                break;

            case DrawingScaleSystemType.MechanicalEngineering:
                CreateMechanicalEngineeringDocument();
                break;

            default:
                Debug.Assert(false, "New drawing scale system?");
                break;
            }

            // end init
            document.EndInit();
            document.UpdateAllViews();
        }
        private void InitMetric()
        {
            Name = "Metric";

            DrawingScales = new NDrawingScale[]
            {
                new NDrawingScale("1:1000", NMetricUnit.Millimeter, NMetricUnit.Meter, 1f, true),
                new NDrawingScale("1:500", NMetricUnit.Millimeter, NMetricUnit.Meter, 2f, false),
                new NDrawingScale("1:200", NMetricUnit.Millimeter, NMetricUnit.Meter, 5f, false),
                new NDrawingScale("1:100", NMetricUnit.Centimeter, NMetricUnit.Meter, 1f, false),
                new NDrawingScale("1:50", NMetricUnit.Centimeter, NMetricUnit.Meter, 2f, false),
                new NDrawingScale("1:25", NMetricUnit.Centimeter, NMetricUnit.Meter, 4f, false),
                new NDrawingScale("1:20", NMetricUnit.Centimeter, NMetricUnit.Meter, 5f, false),
                new NDrawingScale("1:10", NMetricUnit.Centimeter, NMetricUnit.Meter, 10f, false),
                new NDrawingScale("1:5", NMetricUnit.Centimeter, NMetricUnit.Meter, 20f, false),
                new NDrawingScale("1:2.5", NMetricUnit.Centimeter, NMetricUnit.Meter, 40f, false),
                new NDrawingScale("1:2", NMetricUnit.Centimeter, NMetricUnit.Meter, 50f, false),
                new NDrawingScale("1:1", NMetricUnit.Meter, NMetricUnit.Meter, 1f, false),
                new NDrawingScale("10:1", NMetricUnit.Meter, NMetricUnit.Meter, 10f, false),
                new NDrawingScale("20:1", NMetricUnit.Meter, NMetricUnit.Meter, 20f, false),
                new NDrawingScale("50:1", NMetricUnit.Meter, NMetricUnit.Meter, 50f, false),
                new NDrawingScale("100:1", NMetricUnit.Meter, NMetricUnit.Meter, 100f, false),
            };
        }
        private void drawingScaleComboBox_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (EventsHandlingPaused)
            {
                return;
            }

            PauseEventsHandling();

            NDrawingScale scale = (drawingScaleComboBox.SelectedItem as NDrawingScale);

            // update the drawing scale
            document.MeasurementUnit            = scale.MeasurementUnit;
            document.CustomWorldMeasurementUnit = scale.WorldMeasurementUnit;
            document.CustomScale = scale.ScaleFactor;

            // update the document bounds text boxes
            UpdateDocumentBoundsTextBoxes();

            // update the selection bounds text boxes
            UpdateSelectionBoundsTextBoxes();

            ResumeEventsHandling();
        }
        private void drawingScaleSystemComboBox_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (EventsHandlingPaused)
            {
                return;
            }

            PauseEventsHandling();

            // get the current system
            NDrawingScaleSystem system = (drawingScaleSystemComboBox.SelectedItem as NDrawingScaleSystem);

            // refill the drawing scale combo
            drawingScaleComboBox.Items.Clear();
            foreach (NDrawingScale drawingScale in system.DrawingScales)
            {
                drawingScaleComboBox.Items.Add(drawingScale);
            }

            // select the default drawing scale
            NDrawingScale scale = system.DefaultDrawingScale;

            drawingScaleComboBox.SelectedItem = scale;

            // create sample document
            view.Selection.DeselectAll();
            CreateSampleDocument(system, scale);

            // update the document bounds text boxes
            UpdateDocumentBoundsTextBoxes();

            // update the selection bounds text boxes
            UpdateSelectionBoundsTextBoxes();

            ResumeEventsHandling();
        }