Пример #1
0
        /// <summary>
        /// Helper to load Settings and populate the form elements
        /// <see cref="Settings"/>
        /// </summary>
        public void LoadSettings()
        {
            // line
            LineThickness                   = Settings.LineThickness;
            tB_LineThickness.Text           = LineThickness.ToString();
            LineMaxLength                   = Settings.LineMaxLength;
            tB_LineMaxLength.Text           = LineMaxLength.ToString();
            LineDividerLengthFactor         = Settings.LineSubdividerLengthFactor;
            tB_LineDividerLengthFactor.Text = LineDividerLengthFactor.ToString();
            ScaleStyle = Settings.Style;
            lB_ScaleStyle.DataStore = Enum.GetNames(typeof(ScaleOverlay.ScaleStyle));

            // text
            TextHeight         = Settings.TextHeight;
            tB_TextHeight.Text = TextHeight.ToString();
            TextFont           = Settings.TextFont;
            fP_TextFont.Value  = TextFont.ToEtoFont();

            // position
            OffsetX         = Settings.OffsetX;
            tB_OffsetX.Text = OffsetX.ToString();
            OffsetY         = Settings.OffsetY;
            tB_OffsetY.Text = OffsetY.ToString();
            TextGap         = Settings.TextGap;
            tB_TextGap.Text = TextGap.ToString();

            // color
            LineColor = Settings.LineColor;
            btn_LineColor.BackgroundColor = LineColor.ToEto();
            TextColor = Settings.TextColor;
            btn_TextColor.BackgroundColor = TextColor.ToEto();
        }
Пример #2
0
 private void tB_LineMaxLength_TextChanged(object sender, EventArgs e)
 {
     if (int.TryParse(tB_LineMaxLength.Text, out int result))
     {
         LineMaxLength = result;
         if (result < Settings.MinLineMaxLength)
         {
             LineMaxLength = Settings.MinLineMaxLength;
         }
         if (result > Settings.MaxLineMaxLength)
         {
             LineMaxLength = Settings.MaxLineMaxLength;
         }
         tB_LineMaxLength.Text = LineMaxLength.ToString();
     }
 }