private void OnFillTransactionHistoryData(object sender, ElapsedEventArgs e) { DateTime startTime = e.SignalTime; foreach (XDagTransaction transaction in transactionHistory) { if (startTime + TimeSpan.FromSeconds(15) < DateTime.Now) { return; } if (!string.IsNullOrWhiteSpace(transaction.PartnerAddress)) { continue; } if (fillingTransactionHistory.Contains(transaction)) { continue; } try { fillingTransactionHistory.Add(transaction); XDagTransactionProvider.FillTransactionData(xdagWallet.Address, transaction); this.Dispatcher.Invoke(() => { this.dgdTransactionHistorySimple.Items.Refresh(); }); } catch (Exception) { // Ignore the exception } finally { try { fillingTransactionHistory.Remove(transaction); } catch (Exception) { // Ignore the exception } } } }
private void btnTest_Click(object sender, RoutedEventArgs e) { try { List <XDagTransaction> transactions = XDagTransactionProvider.GetTransactionHistory("1Nwa0TCr5umw5ZLAvKmHCl+SJDP21dyL"); MessageBox.Show(transactions[0].Amount.ToString()); XDagTransactionProvider.FillTransactionData(xdagWallet.Address, transactions[0]); MessageBox.Show(transactions[0].Status.ToString()); MessageBox.Show(transactions[0].PartnerAddress); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void LoadTransactionDataAsync(XDagTransaction transaction) { if (!string.IsNullOrWhiteSpace(transaction.PartnerAddress)) { return; } BackgroundWork.CreateWork( this, () => { }, () => { XDagTransactionProvider.FillTransactionData(xdagWallet.Address, transaction); return(0); }, (taskResult) => { this.dgdTransactionHistorySimple.Items.Refresh(); } ).Execute(); }