/// <summary>
        /// Initializes a new instance of the <see cref="InteractionAreaAppearanceManagerForm"/> class.
        /// </summary>
        /// <param name="selectedTabIndex">The selected tab page index.</param>
        public InteractionAreaAppearanceManagerForm(int selectedTabIndex)
        {
            InitializeComponent();

            // Resize point
            resizePointsInteractionRadiusNumericUpDown.Minimum  = decimal.MinValue;
            resizePointsInteractionRadiusNumericUpDown.Maximum  = decimal.MaxValue;
            resizePointsRadiusNumericUpDown.Minimum             = decimal.MinValue;
            resizePointsRadiusNumericUpDown.Maximum             = decimal.MaxValue;
            resizePointsBorderPenWidthNumericUpDown.Minimum     = decimal.MinValue;
            resizePointsBorderPenWidthNumericUpDown.Maximum     = decimal.MaxValue;
            resizePointsBackgroundColorPanelControl.CanSetColor = true;
            resizePointsBorderColorPanelControl.CanSetColor     = true;

            // Polygon point
            polygonPointBorderPenWidthNumericUpDown.Minimum             = decimal.MinValue;
            polygonPointBorderPenWidthNumericUpDown.Maximum             = decimal.MaxValue;
            polygonPointInteractionRadiusNumericUpDown.Minimum          = decimal.MinValue;
            polygonPointInteractionRadiusNumericUpDown.Maximum          = decimal.MaxValue;
            polygonPointRadiusNumericUpDown.Minimum                     = decimal.MinValue;
            polygonPointRadiusNumericUpDown.Maximum                     = decimal.MaxValue;
            polygonPointBackgroundColorPanelControl.CanSetColor         = true;
            selectedPolygonPointBackgroundColorPanelControl.CanSetColor = true;
            polygonPointBorderColorPanelControl.CanSetColor             = true;

            // Rotation point
            rotationPointBorderPenWidthNumericUpDown.Minimum     = decimal.MinValue;
            rotationPointBorderPenWidthNumericUpDown.Maximum     = decimal.MaxValue;
            rotationPointInteractionRadiusNumericUpDown.Minimum  = decimal.MinValue;
            rotationPointInteractionRadiusNumericUpDown.Maximum  = decimal.MaxValue;
            rotationPointRadiusNumericUpDown.Minimum             = decimal.MinValue;
            rotationPointRadiusNumericUpDown.Maximum             = decimal.MaxValue;
            rotationPointDistanceNumericUpDown.Minimum           = int.MinValue;
            rotationPointDistanceNumericUpDown.Maximum           = int.MaxValue;
            rotationPointBackgroundColorPanelControl.CanSetColor = true;
            rotationPointBorderColorPanelControl.CanSetColor     = true;

            // Rotation assistant
            rotationAssistantBorderPenWidthNumericUpDown.Minimum     = decimal.MinValue;
            rotationAssistantBorderPenWidthNumericUpDown.Maximum     = decimal.MaxValue;
            rotationAssistantRadiusNumericUpDown.Minimum             = decimal.MinValue;
            rotationAssistantRadiusNumericUpDown.Maximum             = decimal.MaxValue;
            rotationAssistantBackgroundColorPanelControl.CanSetColor = true;
            rotationAssistantBorderColorPanelControl.CanSetColor     = true;

            // Text box
            textBoxForeColorPanelControl.CanSetColor = true;
            textBoxBackColorPanelControl.CanSetColor = true;

            _fontDialog = new FontDialog();

            InteractionAreaSettings = new InteractionAreaAppearanceManager();
            mainPanel.Enabled       = false;
            okButton.Enabled        = mainPanel.Enabled;

            tabControl1.SelectedIndex = Math.Min(Math.Max(0, selectedTabIndex), tabControl1.TabCount - 1);
        }
        /// <summary>
        /// Updates the user interface of this form.
        /// </summary>
        private void UpdateUI()
        {
            InteractionAreaAppearanceManager settings = _interactionAreaSettings;

            if (settings == null)
            {
                return;
            }

            // Resize points
            resizePointsRadiusNumericUpDown.Value             = Convert.ToDecimal(settings.ResizePointsRadius);
            resizePointsInteractionRadiusNumericUpDown.Value  = Convert.ToDecimal(settings.ResizePointsInteractionRadius);
            resizePointsBackgroundColorPanelControl.Color     = settings.ResizePointsBackgroundColor;
            resizePointsBorderColorPanelControl.Color         = settings.ResizePointsBorderColor;
            resizePointsBorderPenWidthNumericUpDown.Value     = Convert.ToDecimal(settings.ResizePointsBorderPenWidth);
            resizePointsNwseCursorPanelControl.SelectedCursor = settings.NorthwestSoutheastResizePointCursor;
            resizePointsNeswCursorPanelControl.SelectedCursor = settings.NortheastSouthwestResizePointCursor;
            resizePointsNsCursorPanelControl.SelectedCursor   = settings.NorthSouthResizePointCursor;
            resizePointsWeCursorPanelControl.SelectedCursor   = settings.WestEastResizePointCursor;

            // Polygon point
            polygonPointRadiusNumericUpDown.Value                 = Convert.ToDecimal(settings.PolygonPointRadius);
            polygonPointInteractionRadiusNumericUpDown.Value      = Convert.ToDecimal(settings.PolygonPointInteractionRadius);
            polygonPointBackgroundColorPanelControl.Color         = settings.PolygonPointBackgroundColor;
            selectedPolygonPointBackgroundColorPanelControl.Color = settings.SelectedPolygonPointBackgroundColor;
            polygonPointBorderColorPanelControl.Color             = settings.PolygonPointBorderColor;
            polygonPointBorderPenWidthNumericUpDown.Value         = Convert.ToDecimal(settings.PolygonPointBorderPenWidth);
            polygonPointCursorPanelControl.SelectedCursor         = settings.PolygonPointCursor;

            // Rotation point
            rotationPointRadiusNumericUpDown.Value            = Convert.ToDecimal(settings.RotationPointRadius);
            rotationPointInteractionRadiusNumericUpDown.Value = Convert.ToDecimal(settings.RotationPointInteractionRadius);
            rotationPointBackgroundColorPanelControl.Color    = settings.RotationPointBackgroundColor;
            rotationPointBorderColorPanelControl.Color        = settings.RotationPointBorderColor;
            rotationPointBorderPenWidthNumericUpDown.Value    = Convert.ToDecimal(settings.RotationPointBorderPenWidth);
            rotationPointDistanceNumericUpDown.Value          = Convert.ToDecimal(settings.RotationPointDistance);
            rotationPointCursorPanelControl.SelectedCursor    = settings.RotationPointCursor;

            // Rotation assistant
            rotationAssistantRadiusNumericUpDown.Value         = Convert.ToDecimal(settings.RotationAssistantRadius);
            rotationAssistantBackgroundColorPanelControl.Color = settings.RotationAssistantBackgroundColor;
            rotationAssistantBorderColorPanelControl.Color     = settings.RotationAssistantBorderColor;
            rotationAssistantBorderPenWidthNumericUpDown.Value = Convert.ToDecimal(settings.RotationAssistantBorderPenWidth);
            rotationAssistantDiscreteAngleNumericUpDown.Value  = Convert.ToDecimal(settings.RotationAssistantDiscreteAngle);

            // text box
            _fontDialog.Font = (Font)settings.TextBoxFont.Clone();
            textBoxForeColorPanelControl.Color       = settings.TextBoxForeColor;
            textBoxBackColorPanelControl.Color       = settings.TextBoxBackColor;
            textBoxCursorPanelControl.SelectedCursor = settings.TextBoxCursor;

            // move area
            moveAreaCursorPanelControl.SelectedCursor = settings.MoveAreaCursor;
        }
        /// <summary>
        /// Updates the user interface of this form.
        /// </summary>
        private void UpdateUI()
        {
            InteractionAreaAppearanceManager settings = _interactionAreaSettings;

            mainPanel.Enabled = settings != null;

            if (settings == null)
            {
                return;
            }

            // spell check manager
            spellCheckMnagerUnderlineColorColorPanelControl.Color  = settings.SpellCheckManagerUnderlineColor;
            spellCheckManagerUnderlineThicknessNumericUpDown.Value = (decimal)settings.SpellCheckManagerUnderlineThickness;
            spellCheckManagerUnderlineTypeComboBox.SelectedItem    = settings.SpellCheckManagerUnderlineType;
            spellCheckManagerSuggestMenuEnabledCheckBox.Checked    = settings.SpellCheckManagerSuggestMenuEnabled;
        }