/// <summary>Tries to retrieve the rate for the specified currency pair, performing a triangulation if necessary.</summary> /// <param name="currencyPair">The <see cref="T:InitialMargin.Core.CurrencyPair"/> object defining the base and counter currencies.</param> /// <param name="rate">A <see cref="T:System.Decimal"/> representing the rate or <c>0</c>.</param> /// <returns><c>true</c> if the rate was successfully retrieved; otherwise, <c>false</c>.</returns> public Boolean TryGetRate(CurrencyPair currencyPair, out Decimal rate) { return(TryGetRate(currencyPair, true, out rate)); }
/// <summary>Adds the specified rate for the specified currency pair, updating the lookup table if the currency pair already exists.</summary> /// <param name="currencyPair">The <see cref="T:InitialMargin.Core.CurrencyPair"/> object defining the base and counter currencies.</param> /// <param name="rate">A <see cref="T:System.Decimal"/> representing the rate.</param> /// <exception cref="T:System.ArgumentException">Thrown when <paramref name="rate">rate</paramref> is less than or equal to <c>0</c>.</exception> /// <exception cref="T:System.ArgumentNullException">Thrown when <paramref name="currencyPair">currencyPair</paramref> is <c>null</c>.</exception> public void AddRate(CurrencyPair currencyPair, Decimal rate) { AddRate(currencyPair, rate, true); }
/// <summary>Retrieves the rate for the specified currency pair, performing a triangulation if necessary.</summary> /// <param name="currencyPair">The <see cref="T:InitialMargin.Core.CurrencyPair"/> object defining the base and counter currencies.</param> /// <returns>A <see cref="T:System.Decimal"/> representing the rate.</returns> /// <exception cref="T:System.ArgumentNullException">Thrown when <paramref name="currencyPair">currencyPair</paramref> is <c>null</c>.</exception> /// <exception cref="T:System.InvalidOperationException">Thrown when the rate cannot be retrieved.</exception> public Decimal GetRate(CurrencyPair currencyPair) { return(GetRate(currencyPair, true)); }