Beispiel #1
0
 public CacheManager(IApplicationCache cache, ITextFileManager textFileManager, IXmlFileManager xmlFileManager, ISerializer serializer)
 {
     _cache           = cache;
     _textFileManager = textFileManager;
     _xmlFileManager  = xmlFileManager;
     _serializer      = serializer;
 }
Beispiel #2
0
 public HomeService(
     ILogger <HomeService> logger,
     IApplicationCache cache)
 {
     _logger = logger;
     _cache  = cache;
 }
Beispiel #3
0
 public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
 {
     this.executor = commandExecutor;
     this.StartClient();
     this.StartSession(desiredCapabilities);
     this.mouse    = new RemoteMouse(this);
     this.keyboard = new RemoteKeyboard(this);
     if (this.capabilities.HasCapability(CapabilityType.SupportsApplicationCache))
     {
         object capability = this.capabilities.GetCapability(CapabilityType.SupportsApplicationCache);
         if (capability is bool && (bool)capability)
         {
             this.appCache = new RemoteApplicationCache(this);
         }
     }
     if (this.capabilities.HasCapability(CapabilityType.SupportsLocationContext))
     {
         object capability2 = this.capabilities.GetCapability(CapabilityType.SupportsLocationContext);
         if (capability2 is bool && (bool)capability2)
         {
             this.locationContext = new RemoteLocationContext(this);
         }
     }
     if (this.capabilities.HasCapability(CapabilityType.SupportsWebStorage))
     {
         object capability3 = this.capabilities.GetCapability(CapabilityType.SupportsWebStorage);
         if (capability3 is bool && (bool)capability3)
         {
             this.storage = new RemoteWebStorage(this);
         }
     }
 }
 public AdminController(
     IAdminService adminService,
     IApplicationCache cache)
 {
     _adminService = adminService;
     _cache        = cache;
 }
Beispiel #5
0
 public DHGateService(IHttpService http, IApplicationCache cache, IRavenClient raven)
     : base(SearchServiceType.DHGate)
 {
     this.http  = http;
     this.cache = cache;
     this.raven = raven;
 }
Beispiel #6
0
 public SearchCache(IApplicationCache cache, ISearchPostgres db, WebSearchService[] services, IRavenClient raven)
 {
     this.cache       = cache;
     this.db          = db;
     this.raven       = raven;
     this.webServices = services;
 }
 public JwtBlacklistService(
     IOptionsSnapshot <AuthenticationConfiguration> authenticationConfiguration,
     IApplicationCache cache
     )
 {
     _authenticationConfiguration = authenticationConfiguration.Value;
     _cache = cache;
 }
        public static async Task SetSearchServices(WebSearchService[] services, IApplicationCache cache)
        {
            foreach (var model in services)
            {
                var key = model.ServiceModel.GetRedisKey();

                await cache.StoreString(key, JsonConvert.SerializeObject(model.ServiceModel));
            }
        }
 public CreateMessageViewModel(
     INavigationService navigationService,
     IApplicationCache cache,
     IDatabaseService dbService,
     IMobileCenterLogger logger)
     : base(navigationService, cache, logger)
 {
     DatabaseService = dbService;
 }
Beispiel #10
0
 public TestApiController(IApplicationCache appCache, ISessionCache sessionCache, IXmlFileManager xmlFileManager, IRequestClient requestClient, ITextFileManager textFileManager, IReportManager reportManager)
 {
     _appCache        = appCache;
     _sessionCache    = sessionCache;
     _xmlFileManager  = xmlFileManager;
     _requestClient   = requestClient;
     _textFileManager = textFileManager;
     _reportManager   = reportManager;
 }
Beispiel #11
0
 public SearchService(WebSearchService[] services, ISearchPostgres db,
                      IApplicationCache cache, IRavenClient raven, SearchCache searchCache)
 {
     this.raven       = raven;
     this.db          = db;
     this.cache       = cache;
     this.services    = services;
     this.searchCache = searchCache;
 }
Beispiel #12
0
 public FriendsViewModel(
     INavigationService navService,
     IApplicationCache cache,
     IFacebookService fbservice,
     IMobileCenterLogger logger)
     : base(navService, cache, logger)
 {
     FacebookService = fbservice;
 }
Beispiel #13
0
 public BaseViewModel(
     INavigationService navigationService,
     IApplicationCache cache,
     IMobileCenterLogger logger)
 {
     NavigationService = navigationService;
     ApplicationCache  = cache;
     Logger            = logger;
 }
        /// <summary>
        /// Saves <paramref name="applicationCache"/> to file.
        /// </summary>
        public async Task SaveCacheAsync(IApplicationCache applicationCache)
        {
            using var _ = await _muetx.LockAsync().ConfigureAwait(false);

            using var stream = _fileSystem.File.OpenWrite(_filePath);
            stream.SetLength(0);

            await JsonSerializer.SerializeAsync(stream, applicationCache).ConfigureAwait(false);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="Solve"/> class.
 /// </summary>
 public EventsFileRepository(
     IFileSystem fileSystem,
     IApplicationCache applicationCache,
     IApplicationCacheSaver applicationCacheSaver)
 {
     _fileSystem            = fileSystem;
     _applicationCache      = applicationCache;
     _applicationCacheSaver = applicationCacheSaver;
 }
Beispiel #16
0
 public LoginViewModel(
     IFacebookService facebookService,
     IApplicationCache cache,
     INavigationService navService,
     IMobileCenterLogger logger) 
     : base(navService, cache, logger)
 {
     FacebookService = facebookService;
 }
Beispiel #17
0
 public FriendsViewModel(
     IApplicationCache cache,
     IFacebookService fbservice,
     IMobileCenterLogger logger,
     IMvxMessenger messenger) : base(messenger)
 {
     FacebookService = fbservice;
     Cache           = cache;
     Logger          = logger;
 }
Beispiel #18
0
 public CreateMessageViewModel(
     IApplicationCache cache,
     IDatabaseService dbService,
     IMobileCenterLogger logger,
     IMvxMessenger messenger) : base(messenger)
 {
     Cache           = cache;
     DatabaseService = dbService;
     Logger          = logger;
 }
Beispiel #19
0
 //Setup this class as a Scoped dependency injection and call SetupScope
 public ShopifyService(IHttpService http, IApplicationCache cache,
                       ShopifyOAuth oauth, OAuthPostgres oauthDb, OAuthService oauthRetriever, IRavenClient raven, IOptions <ShopifyOptions> config)
 {
     this.http           = http;
     this.raven          = raven;
     this.config         = config.Value;
     this.oauthDb        = oauthDb;
     this.cache          = cache;
     this.oauthRetriever = oauthRetriever;
 }
Beispiel #20
0
 public SessionLoggingFilter(
     ISessionService sessionService,
     IApplicationCache cache,
     IUnitOfWorkFactory uowFactory,
     ISessionProvider sessionProvider)
 {
     _sessionService  = sessionService;
     _uowFactory      = uowFactory;
     _cache           = cache;
     _sessionProvider = sessionProvider;
 }
Beispiel #21
0
 public HistoryViewModel(
     IDatabaseService dbService,
     IApplicationCache cache,
     IMobileCenterLogger logger,
     IMvxMessenger messenger) : base(messenger)
 {
     DatabaseService = dbService;
     Cache           = cache;
     Logger          = logger;
     LoadHistory();
 }
 public EmailService(
     IEmailProvider emailProvider,
     IHttpContextAccessor httpContextAccessor,
     IApplicationCache cache,
     IUnitOfWorkFactory uowFactory)
 {
     _emailProvider       = emailProvider;
     _httpContextAccessor = httpContextAccessor;
     _cache      = cache;
     _uowFactory = uowFactory;
 }
 public DropshippingService(ShopifyService shopify, ISearchService search, OAuthPostgres dbOauth,
                            OAuthService oauthdb, DropshipItemsPostgres dbItems, DropshipAccountsPostgres dbAccounts, IApplicationCache cache)
 {
     this.shopify    = shopify;
     this.search     = search;
     this.dbItems    = dbItems;
     this.dbAccounts = dbAccounts;
     this.cache      = cache;
     this.dbOAuth    = dbOauth;
     this.oauthdb    = oauthdb;
 }
Beispiel #24
0
 public HistoryViewModel(
     IDatabaseService dbService,
     IApplicationCache cache,
     INavigationService navigationService,
     IMobileCenterLogger logger) 
     : base(navigationService,cache, logger)
 {
     DatabaseService = dbService;
     LoadHistory();
     Messenger.Default.Register<RefreshHistoryMessage>(this, RefreshHistoryHandler);
 }
Beispiel #25
0
        public AdminService(
            IAccountService accountService,
            ISessionService sessionService,
            IUnitOfWorkFactory uowFactory,
            IApplicationCache cache)
        {
            _uowFactory = uowFactory;

            _cache          = cache;
            _accountService = accountService;
            _sessionService = sessionService;
        }
 public LoginViewModel(
     IFacebookService facebookService,
     IApplicationCache cache,
     IMobileCenterLogger logger,
     ILoginService loginService,
     IMvxMessenger messanger) : base(messanger)
 {
     FacebookService = facebookService;
     Logger          = logger;
     Cache           = cache;
     LoginService    = loginService;
 }
Beispiel #27
0
 public EventSummaryViewModel(
     IEventsRepository?eventsRepository           = null,
     IApplicationCache?applicationCache           = null,
     IApplicationCacheSaver?applicationCacheSaver = null)
 {
     _svgToBitmapConverter  = new SvgToBitmapConverter();
     _eventsRepository      = eventsRepository ?? Ioc.GetService <IEventsRepository>();
     _applicationCache      = applicationCache ?? Ioc.GetService <IApplicationCache>();
     _applicationCacheSaver = applicationCacheSaver ?? Ioc.GetService <IApplicationCacheSaver>();
     ChangeEventCommand     = ReactiveCommand.CreateFromTask(ChangeEventAsync);
     ShowEventChangeDialog  = new Interaction <EventChangeViewModel, EventViewModel?>();
 }
Beispiel #28
0
        public void TestAppCacheStatus()
        {
            driver.Url = simpleTestPage;
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromMilliseconds(2000));
            IApplicationCache appCache = ((RemoteWebDriver)driver).ApplicationCache;
            AppCacheStatus    status   = appCache.GetStatus();

            while (status == AppCacheStatus.DOWNLOADING)
            {
                status = appCache.GetStatus();
            }
            Assert.AreEqual(AppCacheStatus.UNCACHED, status);
        }
 public SessionService(
     ILogger <SessionService> logger,
     ISessionProvider sessionProvider,
     IUnitOfWorkFactory uowFactory,
     IApplicationCache cache,
     IHttpContextAccessor httpContextAccessor)
 {
     _logger              = logger;
     _uowFactory          = uowFactory;
     _sessionProvider     = sessionProvider;
     _httpContextAccessor = httpContextAccessor;
     _cache = cache;
 }
Beispiel #30
0
 public SessionSummaryViewModel(
     SnackbarViewModel snackbarViewModel,
     ISessionsRepository?sessionRepository        = null,
     IApplicationCache?applicationCache           = null,
     IApplicationCacheSaver?applicationCacheSaver = null)
 {
     _svgToBitmapConverter   = new SvgToBitmapConverter(100);
     _snackbarViewModel      = snackbarViewModel;
     _sessionRepository      = sessionRepository ?? Ioc.GetService <ISessionsRepository>();
     _applicationCache       = applicationCache ?? Ioc.GetService <IApplicationCache>();
     _applicationCacheSaver  = applicationCacheSaver ?? Ioc.GetService <IApplicationCacheSaver>();
     ChangeSessionCommand    = ReactiveCommand.CreateFromTask(ChangeSessionAsync);
     ShowSessionChangeDialog = new Interaction <SessionChangeViewModel, SessionViewModel?>();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="RemoteWebDriver"/> class
        /// </summary>
        /// <param name="commandExecutor">An <see cref="ICommandExecutor"/> object which executes commands for the driver.</param>
        /// <param name="desiredCapabilities">An <see cref="ICapabilities"/> object containing the desired capabilities of the browser.</param>
        public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
        {
            this.executor = commandExecutor;
            this.StartClient();
            this.StartSession(desiredCapabilities);
            this.mouse = new RemoteMouse(this);
            this.keyboard = new RemoteKeyboard(this);

            if (this.capabilities.HasCapability(CapabilityType.SupportsApplicationCache))
            {
                object appCacheCapability = this.capabilities.GetCapability(CapabilityType.SupportsApplicationCache);
                if (appCacheCapability is bool && (bool)appCacheCapability)
                {
                    this.appCache = new RemoteApplicationCache(this);
                }
            }

            if (this.capabilities.HasCapability(CapabilityType.SupportsLocationContext))
            {
                object locationContextCapability = this.capabilities.GetCapability(CapabilityType.SupportsLocationContext);
                if (locationContextCapability is bool && (bool)locationContextCapability)
                {
                this.locationContext = new RemoteLocationContext(this);
                }
            }

            if (this.capabilities.HasCapability(CapabilityType.SupportsWebStorage))
            {
                object webContextCapability = this.capabilities.GetCapability(CapabilityType.SupportsWebStorage);
                if (webContextCapability is bool && (bool)webContextCapability)
                {
                    this.storage = new RemoteWebStorage(this);
                }
            }
        }
Beispiel #32
0
 /// <summary>
 /// Initializes a new instance of the RemoteWebDriver class
 /// </summary>
 /// <param name="commandExecutor">An <see cref="ICommandExecutor"/> object which executes commands for the driver.</param>
 /// <param name="desiredCapabilities">An <see cref="ICapabilities"/> object containing the desired capabilities of the browser.</param>
 public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
 {
     this.executor = commandExecutor;
     this.StartClient();
     this.StartSession(desiredCapabilities);
     this.mouse = new RemoteMouse(this);
     this.keyboard = new RemoteKeyboard(this);
     this.storage = new RemoteWebStorage(this);
     this.appCache = new RemoteApplicationCache(this);
     this.locationContext = new RemoteLocationContext(this);
 }