Ejemplo n.º 1
0
 public void AddFXForecast(IFXSource fxForecastCurve)
 {
     if (numeraireCurrency.GetHashCode() == Currency.ANY.GetHashCode())
     {
         throw new ArgumentException("If the model provides multiple currencies then the discounting currency cannot be 'ANY'.");
     }
     if (!fxCurves.ContainsKey(fxForecastCurve.GetCurrencyPair()))
     {
         fxCurves.Add(fxForecastCurve.GetCurrencyPair(), fxForecastCurve);
     }
     else
     {
         throw new ArgumentException(fxForecastCurve.GetCurrencyPair().ToString() + " has already been added to the model.");
     }
 }
Ejemplo n.º 2
0
 public void AddFXForecast(IFXSource fxForecastCurve)
 {
     if (fxForecastCurve == null)
     {
         return;
     }
     if (!fxCurves.ContainsKey(fxForecastCurve.GetCurrencyPair().ToString()))
     {
         fxCurves.Add(fxForecastCurve.GetCurrencyPair().ToString(), fxForecastCurve);
     }
     else
     {
         throw new ArgumentException(fxForecastCurve.GetCurrencyPair() +
                                     " has already been added to the model.");
     }
 }