public MemeModule(ICatalogService catalogService, LocaleService localeService, ISearchService searchService, DeckViewBuilder deckViewBuilder, IOptionsSnapshot <TipsySettings> settings) { CatalogService = catalogService; LocaleService = localeService; SearchService = searchService; DeckViewBuilder = deckViewBuilder; Settings = settings.Value; }
public override void Initialize() { base.Initialize(); LocaleService localeService = (LocaleService)Game.Services.GetService(typeof(LocaleService)); keyboardLayout = localeService.CurrentLocale.KeyboardLayout; }
private static async Task SetAutoConfig(string[] args) { await Parser.Default.ParseArguments <Options>(args).WithParsedAsync(async opt => { Config.Instance.Parse(opt.ConfigPath?.Trim()); var localeService = new LocaleService(Config.Instance.Locale); await AssignSantasAndSendEmails(localeService); }); }
public GameQueryModule(LocaleService localeService, ISearchService searchService, CardboardSearchViewBuilder cardboardSearchViewBuilder, CardFlavorSearchViewBuilder cardFlavorSearchViewBuilder, CardRelationSearchViewBuilder cardRelationSearchViewBuilder, KeywordSearchViewBuilder keywordSearchViewBuilder, DeckSearchViewBuilder deckSearchViewBuilder, AnythingSearchViewBuilder anythingSearchViewBuilder, IOptionsSnapshot <TipsySettings> tipsySettings) { LocaleService = localeService; SearchService = searchService; CardboardSearchViewBuilder = cardboardSearchViewBuilder; CardFlavorSearchViewBuilder = cardFlavorSearchViewBuilder; CardRelationSearchViewBuilder = cardRelationSearchViewBuilder; KeywordSearchViewBuilder = keywordSearchViewBuilder; DeckSearchViewBuilder = deckSearchViewBuilder; AnythingSearchViewBuilder = anythingSearchViewBuilder; TipsySettings = tipsySettings.Value; }
/// <summary> /// Creates a new NinthBrain object using provided apiKey and accessToken parameters /// </summary> /// <param name="config">Configuration</param> public NinthBrainSuiteService(Configuration config) { configuration = config; individualService = new IndividualService(configuration, this); certificationService = new CertificationService(configuration, this); individualCertificationService = new IndividualCertificationService(configuration, this); departmentService = new DepartmentService(configuration, this); jobTitleService = new JobTitleService(configuration, this); localeService = new LocaleService(configuration, this); workShiftService = new WorkShiftService(configuration, this); individualCourseService = new IndividualCourseService(configuration, this); }
private static async Task SetManualConfig() { var configurator = new ManualConfigService(); var localeService = new LocaleService(configurator.Locale); var config = configurator.GetConfig(localeService); Config.Instance.Parse(config); await AssignSantasAndSendEmails(localeService); configurator.DisplayEndProcess(); }
private static async Task AssignSantasAndSendEmails(LocaleService localeService) { var santas = new RandomizeService().Randomize(Config.Instance.Participants); var mailservice = new MailService(); var mailMessageFormatter = new MailMessageFormatter(localeService); // Todo: try to put back Task.WhenAll on Send() without having 'too much connections' issue foreach (var santa in santas) { var body = mailMessageFormatter.GetHtmlBody(santa); await mailservice.Send(santa, body); } }
private void LdrOnCompleted(IAddressableLoader loader, AsyncOperationStatus status) { loader.CompletedEvent -= LdrOnCompleted; var atlases = loader.Assets.Where(o => o is SpriteAtlas).Cast <SpriteAtlas>().ToArray(); var sounds = loader.Assets.Where(o => o is AudioSettings).Cast <AudioSettings>().ToArray(); var locales = loader.Assets.Where(IsLocale).Cast <TextAsset>().ToArray(); var windows = loader.Assets.Where(o => (o as GameObject)?.GetComponent <Window>()) .Cast <GameObject>().Select(o => o.GetComponent <Window>()).ToArray(); if (atlases.Length > 0) { foreach (var pair in _delayedAtlasRequests.ToList()) { if (atlases.Any(atlas => { if (atlas.name != pair.Key) { return(false); } pair.Value?.Invoke(atlas); _delayedAtlasRequests.Remove(pair.Key); return(true); })) { Debug.LogFormat("Request for atlas {0} was found and satisfied.", pair.Key); break; } } } foreach (var audioSettings in sounds) { foreach (var pair in audioSettings.Clips) { AudioManager.RegisterClips(pair.Value, pair.Key); } } foreach (var locale in locales) { LocaleService.AddLocaleCsv(locale.text); } foreach (var window in windows) { WindowManager.RegisterWindow(window, true); } }
public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 960; graphics.PreferredBackBufferHeight = 600; curLocalNameIndex = -1; localeNames = new String[] { "en-US", "de-DE", "ru-RU" }; content = new ContentManager(Services); localeService = new LocaleService(this, content); textInputService = new TextInputService(this); inputText = ""; }
public async Task <ActionResult> Index(string subscriptionId, string azureOfferId = "MS-AZR-0044P", string azureRegionId = "US", string localeId = "en-US") { // verify subscription id present if (string.IsNullOrEmpty(subscriptionId)) { return(RedirectToRoute("Default", new { controller = "Subscriptions" })); } // get all regions & locals var offers = new List <AzureBillingViewer.Services.AzureOffer>(from offer in AzureOfferService.List() orderby offer.Retired, offer.Name select offer); var regions = new List <AzureRegion>(AzureRegionService.List()); var locales = new List <string>(LocaleService.List()); // init view model AzureRatesViewModel viewModel = new AzureRatesViewModel { AzureSubscriptionId = subscriptionId, AzureOfferId = azureOfferId, AzureRegion = regions.First(r => r.Id == azureRegionId), AzureRegionId = azureRegionId, LocaleId = localeId, AvailableAzureOffers = offers.Select(z => new SelectListItem { Text = (z.Retired) ? string.Format("(retired) {0} - {1}", z.Id, z.Name) : string.Format("{0} {1}", z.Id, z.Name), Value = z.Id }), AvailableAzureRegions = regions.OrderBy(x => x.Name).Select(y => new SelectListItem { Text = y.Name, Value = y.Id }), AvailableLocales = locales.Select(y => new SelectListItem { Text = y, Value = y }) }; // get rate info from Azure var azureRates = await AzureRatesRepository.GetRates(viewModel.AzureSubscriptionId, viewModel.AzureOfferId, viewModel.AzureRegion, viewModel.LocaleId); // update view model if (azureRates.OfferTerms.Any()) { viewModel.AzureOfferName = azureRates.OfferTerms[0].Name; viewModel.OfferCredit = azureRates.OfferTerms[0].Credit; viewModel.EffectiveDate = azureRates.OfferTerms[0].EffectiveDate; viewModel.ExcludedMeterIds.AddRange(azureRates.OfferTerms[0].ExcludedMeterIds); viewModel.TieredDiscounts = azureRates.OfferTerms[0].TieredDiscount; } viewModel.MeterRegion = azureRates.MeterRegion; viewModel.IsTaxIncluded = azureRates.IsTaxIncluded; //viewModel.Tags = azureRates.Tags; viewModel.Meters.AddRange(azureRates.Meters .OrderBy(x => x.MeterCategory) .OrderBy(x => x.MeterSubCategory) .OrderBy(x => x.MeterName) .OrderBy(x => x.MeterRegion) ); return(View(viewModel)); }
public AdminModule(GreengladeContext dbContext, LocaleService localeService) { DbContext = dbContext; LocaleService = localeService; }