Пример #1
0
        public FxServiceProxy(ILoginRulesProvider loginRulesProvider, ITradingSettingsProvider tradingSettingsProvider,
                              IPermissionChecker permissionChecker, IRequestProvider requestProvider, ITableManager tableManager, ISessionProvider sessionProvider)
        {
            var feedback = new SessionFeedbackContext();

            feedback.SetLoginRulesProvider      = this.SetLoginRules;
            feedback.SetPermissionChecker       = this.SetPermissionChecker;
            feedback.SetRequestProvider         = this.SetRequests;
            feedback.SetTableManager            = this.SetTableManager;
            feedback.SetTradingSettingsProvider = this.SetTradingSettings;

            this.Session = sessionProvider ??
                           new SessionProvider(loginRulesProvider, tradingSettingsProvider, permissionChecker, requestProvider,
                                               tableManager, new SessionProviderValidator(), feedback);

            this.LoginRules        = loginRulesProvider;
            this.PermissionChecker = permissionChecker;
            this.Requests          = requestProvider;
            this.TableManager      = tableManager;
            this.TradingSettings   = tradingSettingsProvider;
        }
Пример #2
0
        public SessionProvider(ILoginRulesProvider loginRules, ITradingSettingsProvider tradingSettings,
                               IPermissionChecker permissionChecker, IRequestProvider requests, ITableManager tableManager,
                               ISessionProviderValidator validator, SessionFeedbackContext feedbackContext)
        {
            if (feedbackContext == null)
            {
                throw new ArgumentNullException("feedbackContext");
            }

            this.InitialLoginRulesProvider      = loginRules;
            this.InitialPermissionChecker       = permissionChecker;
            this.InitialTableManager            = tableManager;
            this.InitialTradingSettingsProvider = tradingSettings;
            this.InitialRequestProvider         = requests;

            this.Validator       = validator;
            this.FeedbackContext = feedbackContext;

            this.InitSession();
            this.MarketDataRequests = new Dictionary <string, MarketDataRequestItem>(StringComparer.OrdinalIgnoreCase);
        }
Пример #3
0
 private void SetTradingSettings(ITradingSettingsProvider provider)
 {
     this.TradingSettings = provider;
 }