public RetailProductLoader(ILogger <RetailProductLoader> logger, IOptions <ServiceOptions> options, LoaderService <Item> itemService) { _options = options.Value; _logger = logger; _items = itemService.Items; }
public static GameObject CreateEffect(string effect, Vector3 pos, Quaternion rotation) { var effectPath = GetEffectPath(effect); LoaderService loader = ServiceLocate.Instance.GetService <LoaderService>(); return(InstantiateEffect(effectPath, pos, rotation)); }
public void RequestResources(IResourceModel resourceModel) { var requestModel = ResourceRequests.GetInstance(); resourceModel.CollectResources(requestModel); foreach (var request in requestModel) { var name = request.Key; var assetBundle = request.Value.AssetBundle; var assetName = request.Value.AssetName; LoaderService.GetOrLoadAssetBundle(assetBundle, bundle => { bundle.LoadAsset <Object>(assetName, resource => { requestModel.OnResourceLoaded(name, resource); if (requestModel.IsAllResourcesLoaded()) { resourceModel.OnResourcesLoaded(requestModel); requestModel.Release(); ResourceRequests.ReturnInstance(requestModel); } }); }); } }
/// <summary> /// Registers the default loader service, if no other loader has been /// registered yet. /// </summary> /// <param name="configuration">The configuration to extend.</param> /// <param name="setup">Optional setup for the loader service.</param> /// <param name="requesters">Optional requesters to use.</param> /// <returns>The new instance with the service.</returns> public static IConfiguration WithDefaultLoader(this IConfiguration configuration, Action <LoaderService> setup = null, IEnumerable <IRequester> requesters = null) { if (configuration == null) { throw new ArgumentNullException("configuration"); } if (configuration.GetServices <ILoaderService>().Any() == false) { if (requesters == null) { requesters = new IRequester[] { new HttpRequester(), new DataRequester() } } ; var service = new LoaderService(requesters); if (setup != null) { setup(service); } return(configuration.With(service)); } return(configuration); }
public ShopLoader(ILogger <ShopLoader> logger, IOptions <ServiceOptions> options, LoaderService <RetailProduct> retailProductService) { _options = options.Value; _logger = logger; _retailProducts = retailProductService.Items; }
private IBrowsingContext GetContext() { var requester = new HttpClientRequester(_client); var loaderService = new LoaderService(new[] { requester }); var configuration = Configuration.Default.With(loaderService); return(BrowsingContext.New(configuration)); }
public static IConfiguration WithPageRequester(this IConfiguration config, Boolean enableNavigation = true, Boolean enableResourceLoading = false) { var service = new LoaderService(PageRequester.All); service.IsResourceLoadingEnabled = enableResourceLoading; service.IsNavigationEnabled = enableNavigation; return(config.With(service)); }
public LoaderServiceTest() { fHttpService = Substitute.For <IHttpService>(); fConfig = Substitute.For <ILoaderServiceConfig>(); fResourcesRepository = Substitute.For <IResourcesRepository>(); fVersionRepository = Substitute.For <IVersionRepository>(); fWoodyPlantRepository = Substitute.For <IWoodyPlantRepository>(); fHubContext = Substitute.For <IHubContext <ClientHub> >(); fService = new LoaderService(fHttpService, fConfig, fResourcesRepository, fVersionRepository, fWoodyPlantRepository, fHubContext); }
public ShipLoader(ILogger <ShipLoader> logger, EntityParser entityParser, IOptions <ServiceOptions> options, IJsonFileReaderWriter jsonFileReaderWriter, VehicleParser vehicleParser, LocalisationService localisationService, LoaderService <Manufacturer> manufacturersService) { _logger = logger; _entityParser = entityParser; _jsonFileReaderWriter = jsonFileReaderWriter; _vehicleParser = vehicleParser; _localisationService = localisationService; Manufacturers = manufacturersService.Items; _options = options.Value; }
public CommodityLoader(ILogger <CommodityLoader> logger, EntityParser entityParser, IJsonFileReaderWriter jsonFileReaderWriter, LoaderService <CommodityTypeAndSubType> commodityTypeService, IOptions <ServiceOptions> options, LocalisationService localisationService) { _logger = logger; _entityParser = entityParser; _jsonFileReaderWriter = jsonFileReaderWriter; _localisationService = localisationService; CommodityTypes = commodityTypeService.Items; _options = options.Value; }
public ItemLoader(ILogger <ItemLoader> logger, EntityParser entityParser, IJsonFileReaderWriter jsonFileReaderWriter, LoaderService <Manufacturer> manufacturersService, IOptions <ServiceOptions> options, LocalisationService localisationService, LoaderService <Ship> shipService, LoaderService <Commodity> commodtiyService) { _logger = logger; _entityParser = entityParser; _jsonFileReaderWriter = jsonFileReaderWriter; _localisationService = localisationService; Manufacturers = manufacturersService.Items; Ships = shipService.Items; Commodities = commodtiyService.Items; _options = options.Value; }
static void Main(string[] args) { while (true) { try { LoaderService loaderService = new LoaderService(); loaderService.Execute(); } catch (Exception ex) { Console.WriteLine($"An error occured while loading files: {ex}"); } Thread.Sleep(Config.Instance.LoaderExecutionInterval); } }
public void SaveBlueprint() { if (ActiveBlueprintStorage == null) { return; } if (!LoaderService.SaveBlueprint(ActiveBlueprintStorage).GetAwaiter().GetResult()) { UpdateStatus($"Failed to save Blueprint {ActiveBlueprintStorage.BlueprintRegistryItem.Name}!"); return; } ChangeContentPage(Constants.ContentPage.ViewBlueprint); ListManager.PrependRegistryItemToList((BlueprintRegistryItem)ActiveBlueprintStorage.BlueprintRegistryItem); UpdateStatus($"Saved {ActiveBlueprintStorage.BlueprintRegistryItem.Name}!"); }
private static ActorsModel LoadActors() { var actorsFile = Path.Combine(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]), "actors.json"); #if DEBUG if (!File.Exists(actorsFile)) { actorsFile = Path.Combine(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]), "..", "..", "..", "actors.json"); } #endif var loaderService = new LoaderService(); var actors = loaderService.LoadActors(actorsFile); return(actors); }
private static KnxSettings LoadSettings() { var settingsFile = Path.Combine(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]), "settings.json"); #if DEBUG if (!File.Exists(settingsFile)) { settingsFile = Path.Combine(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]), "..", "..", "..", "settings.json"); } #endif var loaderService = new LoaderService(); var settings = loaderService.LoadSettings(settingsFile); return(settings); }
public void OpenBlueprint(Guid blueprintId) { ChangeContentPage(Constants.ContentPage.Loading); IBlueprintStorage storage = LoaderService.LoadBlueprint(blueprintId).GetAwaiter().GetResult(); if (storage == null) { UpdateStatus($"Failed to open Blueprint!"); ChangeContentPage(Constants.ContentPage.Error); return; } ActiveBlueprintStorage = storage; ChangeContentPage(Constants.ContentPage.ViewBlueprint); ListManager.PrependRegistryItemToList((BlueprintRegistryItem)ActiveBlueprintStorage.BlueprintRegistryItem); OnLoadedBlueprint?.Invoke(this, ActiveBlueprintStorage.Blueprint); }
private void InitServices() { LoaderService loaderService = new LoaderService(); try { List <Transaction> transactions = loaderService.ReadTransactions(); List <Asset> portfolio = loaderService.ReadPortfolio(); _analyticsService = new AnalyticsService(transactions, portfolio); _reportService = new ReportService(transactions, portfolio); } catch (Exception ex) { MessageBox.Show(ex.Message); throw ex; } }
static async Task Main(string[] args) { var queue = new SimpleEventQueue(); var simpleLog = new SimpleConsoleLog(); using (var unitOfWork = new MovienUnitOfWork()) { await unitOfWork.Setup(); var cache = new Cache(unitOfWork.WebPages); using (var cachingService = new CachingService(queue, cache)) using (var loader = new LoaderService(queue, throttling: TimeSpan.FromSeconds(1), simpleLog, cache)) { var lostFilmLoader = new LostFilmParserService(queue); var lostFilmSeriesLoader = new LostFilmSeriesesLoader(queue); lostFilmSeriesLoader.Start(); Console.ReadLine(); } } }
public ApiSelectController(LoaderService loader, DbCore db) { _loader = loader; _db = db; }
public async Task GetAutoConfigureParametersAsyncTest() { var parameters = await LoaderService.GetAutoConfigureParametersAsync(); GetAutoConfigureParametersResultTest(parameters); }
public async Task GetSyncStatusAsyncTest() { var syncStatus = await LoaderService.GetSyncStatusAsync(); GetSyncStatusResultTest(syncStatus); }
public void GetSyncStatusTest() { var syncStatus = LoaderService.GetSyncStatus(); GetSyncStatusResultTest(syncStatus); }
public void GetAutoConfigureParametersTest() { var parameters = LoaderService.GetAutoConfigureParameters(); GetAutoConfigureParametersResultTest(parameters); }
private LoaderService GetLoader() { return(_loader ?? (_loader = _facade.GetService <LoaderService>())); }
public PreviewDetailController(LoaderService loader) { _loader = loader; }