public InformationForm(Form inputForm)
 {
     InitializeComponent();
     _move = new Draggable(this, FormBorder.Size.Height);
     _move.SetMovable(FormBorder);
     form = inputForm;
 }
Beispiel #2
0
        public PreferencesForm(Form inputForm)
        {
            InitializeComponent();
            _move = new Draggable(this, FormBorder.Size.Height);
            _move.SetMovable(FormBorder);
            form = inputForm;



            string check       = File.ReadAllText(@"Preferences.json");
            var    JsonConfigs = JsonConvert.DeserializeObject <ConfigJson>(check);


            oldCurrentFolder = JsonConfigs.GetCurrentPath();

            MapsetPathTextBox.Text = oldCurrentFolder;

            if (JsonConfigs.GetOrientation() == "1")
            {
                Horizontal.Checked = true;
            }
            else
            {
                SqareMini.Checked = true;
            }

            List <int> BO = MainScreen.JsonButtonOrderToList(JsonConfigs.GetButtonOrder());

            for (int i = 0; i < BO.Count; i = i + 1)
            {
                switch (i)
                {
                case 0:
                    numericUpDown1.Value = BO[i];
                    break;

                case 1:
                    numericUpDown2.Value = BO[i];
                    break;

                case 2:
                    numericUpDown3.Value = BO[i];
                    break;

                case 3:
                    numericUpDown4.Value = BO[i];
                    break;
                }
            }

            Color[] colors = JsonConfigs.GetColorArray();

            for (int i = 0; i < colors.Length; i = i + 1)
            {
                switch (i)
                {
                case 0:
                    FormBorderTextBox.Text = string.Format("#{0:X2}{1:X2}{2:X2}",
                                                           colors[i].R,
                                                           colors[i].G,
                                                           colors[i].B);
                    PreviewFormBorder.BackColor = Color.FromArgb(colors[i].ToArgb());
                    break;

                case 1:
                    MainButtonColorTextbox.Text = string.Format("#{0:X2}{1:X2}{2:X2}",
                                                                colors[i].R,
                                                                colors[i].G,
                                                                colors[i].B);
                    PreviewMainButtons.BackColor = Color.FromArgb(colors[i].ToArgb());
                    break;

                case 2:
                    SubButtonColorTextBox.Text = string.Format("#{0:X2}{1:X2}{2:X2}",
                                                               colors[i].R,
                                                               colors[i].G,
                                                               colors[i].B);
                    PreviewSubButtons.BackColor = Color.FromArgb(colors[i].ToArgb());
                    break;

                case 3:
                    BackgroundColorTextbox.Text = string.Format("#{0:X2}{1:X2}{2:X2}",
                                                                colors[i].R,
                                                                colors[i].G,
                                                                colors[i].B);
                    PreviewBackground.BackColor = Color.FromArgb(colors[i].ToArgb());
                    break;
                }
            }
        }