public override async Task ActivateAsync() { var defaultViewportTemplates = _profileSettingsService.GetDefaultViewportTemplates(); var installedModules = await _dcsWorldService.GetInstalledAircraftModulesAsync(); var templates = defaultViewportTemplates.Where(vp => installedModules.Any(m => m.ModuleId == vp.ModuleId)).ToArray(); if (templates.Length == 0) { await Controller.GoNextAsync(false); return; } foreach (var template in templates) { var module = installedModules.First(m => m.ModuleId == template.ModuleId); var model = new ModuleViewportModel(template.TemplateName, template.ExampleImageUrl, module, template.Viewports); ModuleViewports.Add(model); } await base.ActivateAsync(); }
public ModuleViewportTemplate[] GetDefaultViewportTemplates() { return(_profileSettingsService.GetDefaultViewportTemplates()); }