private void Button_Clicked(object sender, EventArgs e) { if (string.IsNullOrEmpty(accountName.Text) || string.IsNullOrEmpty(accountPassword.Text)) { DisplayAlert("Failure", "Please insert data into the fields", "Ok!"); return; } buttonSubmit.BackgroundColor = Color.FromRgba(52, 152, 219, 255); Account account = new Account() { Username = accountName.Text, Password = accountPassword.Text, Detail = accountDetail.Text }; if (App.database.Add(ref account)) { DisplayAlert("Success", "Account successfully added", "Great!"); OnAccountChanged?.Invoke(this, new AccountDataEventArgs(account.Id)); } else { DisplayAlert("Failure", "Unable to add account", "Ok!"); } Application.Current.MainPage.Navigation.PopAsync(); }
void accountChanged() { // steam account changed! (login/logout) OnAccountChanged?.Invoke(this, new AccountChangedEventArgs() { SteamID = currentUserId, }); }
private void _worker_OnAccountChanged(object?sender, AccountChangedEventArgs e) { CurrentSteamId = e.SteamID; OnAccountChanged?.Invoke(this, e); if (e.SteamID != "") { // user logged in // need to wait a few seconds otherwise our keybinds are overwritten again?! Task.Delay(5000).ContinueWith(t => { if (!FileUtils.AppData.HasBackup(CurrentSteamId)) { CreateBackup(); } WriteKeybinds(); }); } }
protected override void OnOkClicked() { userWalletManager.SetWalletAccount(currentlySelectedAddress - 1); userWalletManager.SetWalletPath(addressesIndex == 0 ? Wallet.DEFAULT_PATH : Wallet.ELECTRUM_LEDGER_PATH); tradableAssetNotificationManager.LoadNewNotificationList(); lockedPRPSManager.ClearList(); lockedPRPSManager.PeriodicUpdate(); lockPRPSManager.PeriodicUpdate(); ethereumTransactionManager.ClearTransactionList(); ethereumTransactionManager.PeriodicUpdate(); ethereumTransactionButtonManager.ProcessNewAssetList(); tradableAssetButtonManager.ResetButtonNotifications(); tradableAssetManager.PeriodicUpdate(); OnAccountChanged?.Invoke(currentlySelectedAddress - 1); }
private void AccountListView_ItemTapped(object sender, ItemTappedEventArgs e) { OnAccountChanged?.Invoke(this, new AccountDataEventArgs((e.Item as Account).Id)); Application.Current.MainPage.Navigation.PopAsync(); }