public FormSettings(GVSettings s) { InitializeComponent(); settings = s; tbHostname.Text = settings.Hostname.Trim(); tbUsername.Text = settings.Username.Trim(); tbPassword.Text = settings.Password; }
private void LoadSettings() { if (!File.Exists(Env.SettingsFile)) { SaveSettings(); } // Deserialize settings from file using (StreamReader sr = new StreamReader(Env.SettingsFile)) { XmlSerializer x = new XmlSerializer(settings.GetType()); settings = x.Deserialize(sr) as GVSettings; } }