Ejemplo n.º 1
0
        private void SaveSettings()
        {
            var settings = new Json.Settings();

            settings.Ps4IP              = textBoxPS4IP.Text;
            settings.ServerIP           = comboBoxServerIP.SelectedItem.ToString();
            settings.RecursiveSearch    = checkBoxRecursive.Checked;
            settings.ProgressCheckDelay = this.Settings.ProgressCheckDelay;
            File.WriteAllText("settings.json", JsonConvert.SerializeObject(settings, Formatting.Indented));
        }
Ejemplo n.º 2
0
        private void LoadSettings()
        {
            if (!File.Exists("settings.json"))
            {
                SaveSettings();
            }
            Settings = JsonConvert.DeserializeObject <Json.Settings>(File.ReadAllText("settings.json"));
            int serverIPIndex = this.comboBoxServerIP.FindStringExact(Settings.ServerIP);

            if (serverIPIndex != -1)
            {
                this.comboBoxServerIP.SelectedIndex = serverIPIndex;
            }
            this.textBoxPS4IP.Text    = Settings.Ps4IP;
            checkBoxRecursive.Checked = Settings.RecursiveSearch;
        }