public void UpdateTransaction(GUITransaction aTransaction) { aTransaction.ParentCurrency = FGUIParentCurrency; if (FTransactions.ContainsKey(aTransaction.RecordId)) { FTransactions[aTransaction.RecordId].CopyFrom(aTransaction); } }
public void AddTransaction(GUITransaction aTransaction) { if (aTransaction.TxType == TransactionDirection.Unknown) { return; } FTransactions.TryAdd(aTransaction.RecordId, aTransaction); aTransaction.ParentCurrency = FGUIParentCurrency; if (!aTransaction.Confirmed) { UnconfirmedBalance += aTransaction.Amount; } else { ConfirmedBalance += aTransaction.Amount; } }
public bool RemoveTransaction(GUITransaction aTransaction) { var lResult = FTransactions.TryRemove(aTransaction.RecordId, out _); if (lResult) { if (!aTransaction.Confirmed) { UnconfirmedBalance -= aTransaction.Amount; } else { ConfirmedBalance -= aTransaction.Amount; } return(lResult); } return(lResult); }