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 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();
        }