/// <summary>
 /// When New symbol is Subscribed
 /// Saving its Permissions in a dictionary
 /// </summary>
 /// <param name="securityPermissions"></param>
 public void OnSymbolSubscribed(SecurityPermissions securityPermissions)
 {
     if (Logger.IsDebugEnabled)
     {
         Logger.Info(securityPermissions.ToString(), _oType.FullName, "OnSymbolSubscribed");
     }
     try
     {
         SecurityPermissionDictionary.Add(securityPermissions.Security.Symbol, securityPermissions);
     }
     catch (Exception exception)
     {
         Logger.Error(exception, _oType.FullName, "OnSymbolSubscribed");
     }
 }
Beispiel #2
0
 /// <summary>
 /// When User Subscribe to New Symbol.
 /// </summary>
 /// <param name="security"></param>
 private void SubscribeToNewSymbol(SecurityPermissions security)
 {
     if (Logger.IsInfoEnabled)
     {
         Logger.Info(security.ToString(), _oType.FullName, "SubscribeToNewSymbol");
     }
     if (!SecurityStatDictionary[SelectedProvider.ProviderName].Any(x => x.Symbol == security.Security.Symbol))
     {
         SecutiryList.Add(security);
         SecurityStatDictionary[SelectedProvider.ProviderName].Add(new SecurityStatisticsViewModel
         {
             Symbol = security.Security.Symbol, Id = security.Id, ProviderName = SelectedProvider.ProviderName
         });
         ReloadList(SelectedProvider);
     }
 }
Beispiel #3
0
        /// <summary>
        /// Get Requset From User And forwards it to MarketDataEngine
        /// </summary>
        /// <param name="subscribe"></param>
        public void RequestDataFromMarketDataEngine(SecurityPermissions subscribe)
        {
            try
            {
                if (Logger.IsDebugEnabled)
                {
                    Logger.Debug(subscribe.ToString(), _oType.FullName, "RequestDataFromMarketDataEngine");
                }
                _responseHandler.OnSymbolSubscribed(subscribe);

                // Send Tick Subscription Request
                _marketDataService.Subscribe(subscribe);
            }
            catch (Exception exception)
            {
                Logger.Error(exception, _oType.FullName, "RequestDataFromMarketDataEngine");
            }
        }
 /// <summary>
 /// Chnage Permission of Symbol
 /// </summary>
 /// <param name="securityPermissions"></param>
 public void ChangeSecurityPermission(SecurityPermissions securityPermissions)
 {
     try
     {
         if (Logger.IsInfoEnabled)
         {
             Logger.Info(securityPermissions.ToString(), _oType.FullName, "ChangeSecurityPermission");
         }
         if (SecurityPermissionDictionary[securityPermissions.Security.Symbol] != null)
         {
             SecurityPermissionDictionary[securityPermissions.Security.Symbol] = securityPermissions;
         }
     }
     catch (Exception exception)
     {
         Logger.Error(exception, _oType.FullName, "ChangeSecurityPermission");
     }
 }