예제 #1
0
        private void InitFormat(IFrame frame)
        {
            MultipleChoiceSetting formattingSystem = frame.GetSetting("Formatting.System") as MultipleChoiceSetting;

            if (formattingSystem != null && formattingSystem.CurrentSelection >= 0)
            {
                displayCoordinateSystem = (DisplayCoordinateSystem)formattingSystem.CurrentSelection;
            }
            else
            {
                displayCoordinateSystem = DisplayCoordinateSystem.local;
            }
            MultipleChoiceSetting formattingZValue = frame.GetSetting("Formatting.Coordinate.ZValue") as MultipleChoiceSetting;

            if (formattingZValue != null && formattingZValue.CurrentSelection >= 0)
            {
                displayZComponent = formattingZValue.CurrentSelection == 0;
            }
            else
            {
                displayZComponent = true;
            }
            alwaysAbsoluteCoordinateSystem = false;
            alwaysZComponent = false;
            displayMode      = (DisplayMode)frame.GetIntSetting("Formatting.Vector.Mode", 0);
            numberFormatInfo = (NumberFormatInfo)CultureInfo.CurrentCulture.NumberFormat.Clone();
            int decsym = Settings.GlobalSettings.GetIntValue("Formatting.Decimal", 0); // Systemeinstellung | Punkt | Komma

            // wenn 0, dann unverändert
            if (decsym == 1)
            {
                numberFormatInfo.NumberDecimalSeparator = ".";
            }
            else if (decsym == 2)
            {
                numberFormatInfo.NumberDecimalSeparator = ",";
            }
            numberFormatInfo.NumberDecimalDigits = frame.GetIntSetting("Formatting.Coordinate.Digits", 3);
            componentsDigits = frame.GetIntSetting("Formatting.Coordinate.ComponentsDigits", 3);
            angleMode        = (AngleMode)frame.GetIntSetting("Formatting.Angle.Mode", 0);
            angleDigits      = frame.GetIntSetting("Formatting.Angle.Digits", 3);
            this.Frame       = frame;
        }