private void UpdateSubFunds(XElement fundsNode, out Fund changedFund) { changedFund = null; foreach (XElement eachFundElement in fundsNode.Elements("Fund")) { Guid subCurrencyId = Guid.Parse(eachFundElement.Attribute("CurrencyID").Value); Fund subFund = null; if (!this._subFunds.TryGetValue(subCurrencyId, out subFund)) { subFund = this.CreateFund(this, eachFundElement); this._subFunds.Add(subFund.CurrencyId, subFund); } decimal oldBalance = subFund.Balance; subFund.Update(eachFundElement); if (oldBalance != subFund.Balance) { changedFund = subFund; } } }
public ChangedFund(bool isMainFundChanged, Fund subFund) { this._isMainFundChanged = isMainFundChanged; this._fund = subFund; }