예제 #1
0
 public OrderListViewModel(ISessionRegister sessionRegister,
                           IShellProvider shellProvider,
                           IOrderArchive orderArchive,
                           IOptions <CurrencySettings> currencyOptions) : this()
 {
     _sessionRegister  = sessionRegister;
     _shellProvider    = shellProvider;
     _orderArchive     = orderArchive;
     _currencySettings = currencyOptions.Value;
 }
예제 #2
0
        public SessionViewModel(IShellProvider shellProvider,
                                ISessionRegister sessionRegister,
                                IOptions <BalanceRange> balanceRangeOptions)
        {
            _shellProvider   = shellProvider;
            _sessionRegister = sessionRegister;
            _balanceRange    = balanceRangeOptions.Value;

            Balance = _balanceRange.Start;
        }
예제 #3
0
 public OrderDetailsViewModel(ISessionRegister sessionRegister,
                              IShellProvider shellProvider,
                              IBarcodeProducer barcodeProducer,
                              IOptions <CurrencySettings> currencyOptions,
                              IOrderArchive orderArchive) : this()
 {
     _sessionRegister  = sessionRegister;
     _shellProvider    = shellProvider;
     _barcodeProducer  = barcodeProducer;
     _currencySettings = currencyOptions.Value;
     _orderArchive     = orderArchive;
 }
예제 #4
0
 public OrderCreationViewModel(ISessionRegister sessionRegister,
                               IProductRack productRack,
                               IWindowManager windowManager,
                               IShoppingCart shoppingCart,
                               IShellProvider shellProvider,
                               IBarcodeProducer barcodeProducer,
                               IOptions <CurrencySettings> currencyOptions)
 {
     _sessionRegister  = sessionRegister;
     _productRack      = productRack;
     _windowManager    = windowManager;
     _shoppingCart     = shoppingCart;
     _shellProvider    = shellProvider;
     _barcodeProducer  = barcodeProducer;
     _currencySettings = currencyOptions.Value;
 }
        public void Initialize(ISessionRegister sessionRegister)
        {
            m_SessionRegister = sessionRegister;

            var appServer = AppContext.CurrentServer;

            m_Log = appServer.Logger;

            var config = appServer.Config;

            if (!int.TryParse(config.Options.GetValue("handshakePendingQueueCheckingInterval"), out m_HandshakePendingQueueCheckingInterval))
            {
                m_HandshakePendingQueueCheckingInterval = 60;// 1 minute default
                m_Log.ErrorFormat("Invalid configuration value handshakePendingQueueCheckingInterval");
            }

            if (!int.TryParse(config.Options.GetValue("openHandshakeTimeOut"), out m_OpenHandshakeTimeOut))
            {
                m_OpenHandshakeTimeOut = 120;// 2 minute default
                m_Log.ErrorFormat("Invalid configuration value openHandshakeTimeOut");
            }
        }
예제 #6
0
        public void Initialize(ISessionRegister sessionRegister)
        {
            m_SessionRegister = sessionRegister;

            var appServer = AppContext.CurrentServer;

            m_Log = appServer.Logger;

            var config = appServer.Config;

            if (!int.TryParse(config.Options.GetValue("handshakePendingQueueCheckingInterval"), out m_HandshakePendingQueueCheckingInterval))
            {
                m_HandshakePendingQueueCheckingInterval = 60;// 1 minute default
                m_Log.ErrorFormat("Invalid configuration value handshakePendingQueueCheckingInterval");
            }

            if (!int.TryParse(config.Options.GetValue("openHandshakeTimeOut"), out m_OpenHandshakeTimeOut))
            {
                m_OpenHandshakeTimeOut = 120;// 2 minute default
                m_Log.ErrorFormat("Invalid configuration value openHandshakeTimeOut");
            }
        }
예제 #7
0
 public LoginViewModel(IUserStorage userStorage, ISessionRegister sessionRegister, IShellProvider shellProvider)
 {
     _userStorage     = userStorage;
     _sessionRegister = sessionRegister;
     _shellProvider   = shellProvider;
 }
    private static void CreateDependencies(string guestControllerHostUrl, string guestControllerSpoofedIpAddress, string mixApiHostUrl, string oneIdClientId, string mixClientToken, string clientVersion, ICoroutineManager coroutineManager, IKeychain keychain, AbstractLogger logger, string localStorageDirPath, string languageCode, out ISessionLogin sessionLogin, out ISessionRegister sessionRegister, out ISessionRestorer sessionRestorer, out ISessionReuser sessionReuser, out IOfflineSessionCreator offlineSessionCreator)
    {
        SystemStopwatchFactory    systemStopwatchFactory    = new SystemStopwatchFactory();
        SystemWwwFactory          wwwFactory                = new SystemWwwFactory();
        WwwCallFactory            wwwCallFactory            = new WwwCallFactory(logger, coroutineManager, systemStopwatchFactory, wwwFactory);
        FileSystem                fileSystem                = new FileSystem();
        DatabaseDirectoryCreator  databaseDirectoryCreator  = new DatabaseDirectoryCreator(fileSystem, localStorageDirPath);
        DocumentCollectionFactory documentCollectionFactory = new DocumentCollectionFactory();
        string sdkDatabasesDirectory = databaseDirectoryCreator.GetSdkDatabasesDirectory();
        DatabaseCorruptionHandler databaseCorruptionHandler = new DatabaseCorruptionHandler(logger, fileSystem, sdkDatabasesDirectory);
        SystemRandom    random       = new SystemRandom();
        SystemEpochTime epochTime    = new SystemEpochTime();
        Database        database     = new Database(keychain.LocalStorageKey, random, epochTime, databaseDirectoryCreator, documentCollectionFactory, databaseCorruptionHandler);
        MixWebCallQueue webCallQueue = new MixWebCallQueue();
        MixSessionStartWebCallEncryptor sessionStartEncryptor    = new MixSessionStartWebCallEncryptor();
        MixWebCallFactoryFactory        mixWebCallFactoryFactory = new MixWebCallFactoryFactory(logger, mixApiHostUrl, mixClientToken, wwwCallFactory, webCallQueue, epochTime, database);
        NotificationDispatcher          notificationDispatcher   = new NotificationDispatcher();
        NotificationQueue          notificationQueue             = new NotificationQueue(notificationDispatcher);
        SessionStatus              sessionStatus           = new SessionStatus(isPaused: true);
        NoOpSessionRefresher       sessionRefresher        = new NoOpSessionRefresher();
        JsonWebCallEncryptor       webCallEncryptor        = new JsonWebCallEncryptor();
        IMixWebCallFactory         webCallFactory          = mixWebCallFactoryFactory.Create(webCallEncryptor, string.Empty, string.Empty, sessionRefresher);
        RsaEncryptor               rsaEncryptor            = new RsaEncryptor();
        MixEncryptor               encryptor               = new MixEncryptor();
        MixWebCallEncryptorFactory webCallEncryptorFactory = new MixWebCallEncryptorFactory(encryptor);
        SessionRefresherFactory    sessionRefresherFactory = new SessionRefresherFactory(webCallQueue);
        MixSessionStarter          mixSessionStarter       = new MixSessionStarter(logger, rsaEncryptor, database, webCallEncryptorFactory, sessionStartEncryptor, mixWebCallFactoryFactory, keychain, coroutineManager, sessionRefresherFactory);
        IStopwatch pollCountdownStopwatch = systemStopwatchFactory.Create();
        GuestControllerClientFactory guestControllerClientFactory = new GuestControllerClientFactory(wwwCallFactory, guestControllerSpoofedIpAddress, database, guestControllerHostUrl, oneIdClientId, logger);
        SessionFactory sessionFactory = new SessionFactory(logger, coroutineManager, pollCountdownStopwatch, epochTime, databaseCorruptionHandler, notificationQueue, notificationDispatcher, sessionStatus, mixWebCallFactoryFactory, webCallEncryptorFactory, mixSessionStarter, keychain, sessionRefresherFactory, guestControllerClientFactory, random, encryptor, fileSystem, wwwCallFactory, localStorageDirPath, clientVersion, databaseDirectoryCreator, documentCollectionFactory, database);
        AgeBandBuilder ageBandBuilder = new AgeBandBuilder(logger, webCallFactory);

        Disney.Mix.SDK.Internal.RegistrationConfigurationGetter registrationConfigurationGetter = new Disney.Mix.SDK.Internal.RegistrationConfigurationGetter(logger, guestControllerClientFactory, ageBandBuilder);
        LegalMarketingErrorsBuilder legalMarketingErrorsBuilder = new LegalMarketingErrorsBuilder(registrationConfigurationGetter, languageCode, epochTime);

        sessionLogin          = new SessionLogin(logger, guestControllerClientFactory, mixSessionStarter, database, legalMarketingErrorsBuilder, sessionFactory);
        sessionRegister       = new SessionRegister(logger, guestControllerClientFactory, database, mixSessionStarter, sessionFactory);
        sessionRestorer       = new SessionRestorer(logger, guestControllerClientFactory, database, sessionFactory);
        sessionReuser         = new SessionReuser(logger, database, mixSessionStarter, sessionFactory);
        offlineSessionCreator = new OfflineSessionCreator(logger, sessionFactory, database);
    }