private void ReportsClick(object sender, RoutedEventArgs e) { var security = SelectedSecurity; var isSubscribe = _reportSecurities.TryAdd(security); if (!isSubscribe) { _reportSecurities.Remove(security); } foreach (var report in Enumerator.GetValues <FundamentalReports>()) { Trader.SubscribeFundamentalReport(security, report, isSubscribe); } }
/// <summary> /// Update filter with new subscription. /// </summary> /// <param name="securityId">Security ID.</param> /// <param name="dataType">Data type info.</param> /// <returns>If subscription was just created, return <see langword="true" />, otherwise <see langword="false" />.</returns> public bool Subscribe(SecurityId securityId, DataType dataType) { return(_subscriptions.TryAdd(Tuple.Create(securityId, dataType))); }