private void SaveUserPreferences() { UserPrefs prefs = new UserPrefs(); prefs.Server = txtServer.Text; prefs.ExportDirectory = txtExportRootDir.Text; UserPrefsRepository prefsRepository = new UserPrefsRepository(); prefsRepository.SaveUserPrefs(prefs); }
private void LoadUserPreferences() { UserPrefsRepository prefsRepository = new UserPrefsRepository(); UserPrefs prefs = prefsRepository.LoadUserPrefs(); if (!string.IsNullOrEmpty(prefs.ExportDirectory)) { txtExportRootDir.Text = prefs.ExportDirectory; } else { txtExportRootDir.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); } if (!string.IsNullOrEmpty(prefs.Server)) { txtServer.Text = prefs.Server; } else { txtServer.Text = Environment.MachineName; } }