Beispiel #1
0
 // update the ip and port of the settings model.
 public void UpdateIpPort(string ip, int infoPort, int commandPort)
 {
     settingsModel.FlightCommandPort = commandPort;
     settingsModel.FlightInfoPort    = infoPort;
     settingsModel.FlightServerIP    = ip;
     settingsModel.SaveSettings();
 }
Beispiel #2
0
 public void SaveChanges(UserAccount account, ISettingsModel settings)
 {
     if (!isLoggedOut && !string.IsNullOrEmpty(account.Username))
     {
         settings.AddOrUpdate("currentUser", account.Username);
         settings.SaveSettings();
         this.SubmitChanges();
     }
 }
 public void SaveSettings()
 {
     model.SaveSettings();
 }
Beispiel #4
0
 public void Logout(ISettingsModel settings)
 {
     isLoggedOut = true;
     bool result = settings.Remove("currentUser");
     settings.SaveSettings();
 }
 private void OnOKClick()
 {
     model.SaveSettings();
     this.settingsWindow.Close();
 }
 private void OnOkClicked()
 {
     model.SaveSettings();
     closeAction?.Invoke();
 }
 /// <summary>
 /// Saves the changes.
 /// </summary>
 public void SaveSettings()
 {
     settingsModel.SaveSettings();
 }
Beispiel #8
0
        public async Task<UserAccount> LoadCurrentUser(ISettingsModel settings)
        {
            string currentUser = settings.GetValueOrDefault<string>("currentUser", string.Empty);
            UserAccount currentAccount = UserAccounts
                .Where(item => item.Username.Equals(currentUser))
                .SingleOrDefault();

            if (currentAccount == null)
            {
                // return an anonymous, public user.
                settings.AddOrUpdate("currentUser", string.Empty);
                settings.SaveSettings();
                currentAccount = new UserAccount();
            }
            else
            {
                // attach tokens and favorites
                currentAccount = await AttachAssociationsAsync(currentAccount);

                if (!currentAccount.AsForumAccessToken().IsActiveAccount)
                {
                    settings.AddOrUpdate("currentUser", string.Empty);
                    settings.SaveSettings();
                }
            }

            return currentAccount;
        }
Beispiel #9
0
 public async Task SaveChangesAsync(UserAccount account, ISettingsModel settings)
 {
     if (!isLoggedOut && !string.IsNullOrEmpty(account.Username))
     {
         settings.AddOrUpdate("currentUser", account.Username);
         settings.SaveSettings();
         await StorageModelFactory.GetStorageModel().SaveToStorageAsync(ConnectionString, this);
     }
 }
 /// <summary>
 /// The Model handles saving of the changed settings and closes the window
 /// </summary>
 /// <param name="window">The settings windows</param>
 public void SaveSettings(SettingsWindow window)
 {
     model.SaveSettings();
     window.Close();
 }
 // Send command for save settings to model.
 public void SaveSettings() => model.SaveSettings();
 public void Save()
 {
     _settings.SaveSettings();
 }
Beispiel #13
0
 // the logic of the ok buttom
 private void ClickOk()
 {
     model.SaveSettings();
     settings.Close();
 }