public void Add(AccountTransaction transaction) { AccountPosition accountPosition = this.positionArray[(int)transaction.CurrencyId]; if (accountPosition == null) { accountPosition = new AccountPosition(transaction); this.positionArray[(int)accountPosition.CurrencyId] = accountPosition; this.positions.Add(accountPosition); } else { accountPosition.Add(transaction); } this.transactions.Add(transaction); }