private void SetMajorCurrencies(string Currency) { var newReporter = new CurrencyReporter(Currency); newReporter.Reporter = this.InverseCurrencyCompare ? RporterType.Reverse : RporterType.Direct; this.CurrencyGrid.ReportToCurrency = newReporter; }
public CurrencySelectorItem(string itemCurrency, CurrencyReporter Reporter = null) { if (Reporter?.Reporter == RporterType.Reverse) { this.Unit = "1 "; } Currency = itemCurrency; if (Reporter != null) { var inputCurrency = IsoCurrencyCodes.AllCurrencies().ToList().SingleOrDefault(x => x.ISOCode == itemCurrency); var outputCurrency = IsoCurrencyCodes.AllCurrencies().ToList().SingleOrDefault(x => x.ISOCode == Reporter.Currency); this.ReporterValue = Math.Round(Reporter.Reporter == RporterType.Direct ? CurrencyHelper.GetCurrencyRate(outputCurrency, inputCurrency) : CurrencyHelper.GetCurrencyRate(inputCurrency, outputCurrency), 4); } }