public FormMain() { InitializeComponent(); using (FormUserSelection formUserSelection = new FormUserSelection()) { formUserSelection.ShowDialog(this); if (formUserSelection.DialogResult == DialogResult.OK) { this.userProfiles = formUserSelection.userProfiles; this.currentUser = formUserSelection.selectedUser; this.selectedUser = true; this.dataManager = new DataManager(currentUser); this.entityManager = new EntityManager(currentUser); this.currentUser.applicationSettingsField = dataManager.ReadUserSettingsFile(this.currentUser); if (this.currentUser.applicationSettingsField.DefaultsRestored) { dataManager.SaveUserSettings(); this.currentUser.applicationSettingsField.DefaultsRestored = false; } } } }
public FormMain() { InitializeComponent(); using (FormUserSelection formUserSelection = new FormUserSelection()) { formUserSelection.ShowDialog(this); if (formUserSelection.DialogResult == DialogResult.OK) { this.userProfiles = formUserSelection.userProfiles; this.currentUser = formUserSelection.selectedUser; this.selectedUser = true; this.dataManager = new DataManager(currentUser); this.entityManager = new EntityManager(currentUser); this.currentUser.applicationSettingsField = dataManager.ReadUserSettingsFile(this.currentUser); if (this.currentUser.applicationSettingsField.DefaultsRestored) { dataManager.SaveUserSettings(); this.currentUser.applicationSettingsField.DefaultsRestored = false; } } } }