public PiServerService() { this.context = new ContextInfoAccessorService(); this.dbContext = new PowerGridEntities(); this.blobStorageService = new BlobStorageService(); this.applicationConfigurationService = new ApplicationConfigurationService(); }
public UploadController(Context context, IApplicationConfigurationService applicationConfigurationService, IAuthService authService, IUploadService uploadService) { this.context = context; this.applicationConfigurationService = applicationConfigurationService; this.authService = authService; this.uploadService = uploadService; }
/// <summary> /// Konstruktor servisa /// </summary> public ZahtjevKomentarService(ILifetimeScope scope, Context context, IAuthService authService, IApplicationConfigurationService applicationConfigurationService) : base(scope) { this.context = context; this.authService = authService; this.applicationConfigurationService = applicationConfigurationService; }
public NotifikacijaService(ILifetimeScope scope, Context context, IAuthService authService, IApplicationConfigurationService applicationConfigurationService) : base(scope) { this.context = context; this.authService = authService; this.applicationConfigurationService = applicationConfigurationService; }
/// <summary> /// Konstruktor servisa /// </summary> public KorisnikService(ILifetimeScope scope, Context context, IAuthService authService, IApplicationConfigurationService applicationConfigurationService, IPravoUpravljanjaKorisnikomService pravoUpravljanjaKorisnikomService) : base(scope) { this.context = context; this.authService = authService; this.applicationConfigurationService = applicationConfigurationService; this.pravoUpravljanjaKorisnikomService = pravoUpravljanjaKorisnikomService; }
public MainViewModel(IApplicationConfigurationService configurationService, IProcessManagementService processManagementService, IFileSystemService fileSystem, ISteamLocator steamLocator, IViewModelLocator vmLocator) { _configurationService = configurationService ?? throw new ArgumentNullException(nameof(configurationService)); _processManagementService = processManagementService ?? throw new ArgumentNullException(nameof(processManagementService)); _fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem)); _steamLocator = steamLocator ?? throw new ArgumentNullException(nameof(steamLocator)); _vmLocator = vmLocator ?? throw new ArgumentNullException(nameof(vmLocator)); Servers = new ObservableCollection <ServerInformation>(); }
public void ExecuteConfiguration(IApplicationConfigurationService service) { List <IEndPointMethodAuthorization> authorizations = null; if (_authorizations != ImmutableLinkedList <IEndPointMethodAuthorization> .Empty) { authorizations = _authorizations.ToList(); } service.ExposeType(_currentApiInformation, _exposeType, ServiceActivationMethod.Default, _activationFunc, _name, authorizations, _methodFilterGroup, _obsoleteMessage); }
public void ExecuteConfiguration(IApplicationConfigurationService service) { BaseAssetProvider assetProvider = null; Delegate handler; if (File.Exists(_fileSystemPath)) { assetProvider = new FileAssetProvider( _currentApiInformation.ServiceProvider.GetService <IFileAssetCache>(), _currentApiInformation.ServiceProvider.GetService <FileExtensionContentTypeProvider>(), _fileSystemPath ); handler = (Func <HttpContext, Task>)(context => assetProvider.ProvideAsset(context, _urlPath)); var delegateConfig = new DelegateInstanceConfiguration(_currentApiInformation, handler) { Method = HttpMethods.Get, Path = _urlPath }; service.ExposeDelegate(_currentApiInformation, delegateConfig, handler); } else if (Directory.Exists(_fileSystemPath)) { assetProvider = new DirectoryAssetProvider( _currentApiInformation.ServiceProvider.GetService <IFileAssetCache>(), _currentApiInformation.ServiceProvider.GetService <FileExtensionContentTypeProvider>(), _fileSystemPath, _fallback); handler = new Func <HttpContext, string, Task>((context, filePath) => assetProvider.ProvideAsset(context, filePath)); var delegateConfig = new DelegateInstanceConfiguration(_currentApiInformation, handler) { Method = HttpMethods.Get, Path = _urlPath + "{filePath}" }; service.ExposeDelegate(_currentApiInformation, delegateConfig, handler); } else { throw new Exception($"Could not find asset path {_fileSystemPath}"); } assetProvider.CacheMaxAge = _cacheMaxAge; assetProvider.NoCache = _noCache; assetProvider.InMemoryCache = _inMemoryCache; }
private void SetupTheme(IApplicationConfigurationService applicationConfigService) { AppTheme appTheme = applicationConfigService.Theme; Accent accent = applicationConfigService.Accent; ThemeManager.ChangeAppStyle(Application.Current, accent, appTheme); // var themeService = serviceLocator.ResolveType<IThemeService>(); // ThemeHelper.EnsureApplicationThemes(GetType().Assembly, themeService.ShouldCreateStyleForwarders()); // var application = Application.Current; // var applicationResources = application.Resources; // var resourceDictionary = applicationResources.MergedDictionaries[0]; // MahAppsHelper.ApplyTheme(); }
/// <inheritdoc /> public void ExecuteConfiguration(IApplicationConfigurationService service) { if (OnlyAttributedFlag) { MethodFilterGroup.Add(m => m.GetCustomAttributes().Any(a => a is IPathAttribute)); WhereFilters.Add(type => type.GetMembers(BindingFlags.Public | BindingFlags.Instance).Any(member => member.GetCustomAttributes().Any(attr => attr is IPathAttribute))); } foreach (var type in Types) { if (!WhereFilters.Execute(type)) { continue; } var activationMethod = _activateMethod(type); var authorizationList = AuthorizeFuncs.SelectMany(func => func(type)).ToList(); if (AsFuncs != ImmutableLinkedList <Func <Type, IEnumerable <string> > > .Empty) { foreach (var asFunc in AsFuncs) { foreach (var nameString in asFunc(type)) { service.ExposeType(_currentApiInformation, type, activationMethod, null, nameString, authorizationList, MethodFilterGroup, null); } } } else { service.ExposeType(_currentApiInformation, type, activationMethod, null, "", authorizationList, MethodFilterGroup, null); } } }
public PrilogZahtjevaService(ILifetimeScope scope, Context context, IAuthService authService, IApplicationConfigurationService applicationConfigurationService) { this.context = context; this.authService = authService; this.applicationConfigurationService = applicationConfigurationService; }
/// <summary> /// Initializes a new instance of the <see cref="FeedbackService"/> class. /// </summary> public FeedbackService() { this.dbContext = new PowerGridEntities(); this.context = new ContextInfoAccessorService(); this.applicationConfigurationService = new ApplicationConfigurationService(); }
public abstract void ExecuteConfiguration(IApplicationConfigurationService service);
public ApplicationSettingsViewModel(IApplicationConfigurationService configurationService) { _configurationService = configurationService ?? throw new ArgumentNullException(nameof(configurationService)); }
public UploadService(ILifetimeScope scope, Context context, IApplicationConfigurationService applicationConfigurationService) : base(scope) { this.applicationConfigurationService = applicationConfigurationService; this.context = context; }
/// <summary> /// Initializes a new instance of the <see cref="ApplicationConfigurationController"/> class. /// </summary> public ApplicationConfigurationController() { this.applicationConfigurationService = new ApplicationConfigurationService(); }
public override void ExecuteConfiguration(IApplicationConfigurationService service) { service.ExposeDelegate(_currentApi, this, _delegate); }
public ApplicationConfigurationServiceTests() { _config = new ApplicationConfigurationService( new ConfigurationBuilder() .AddJsonFile("appsettings.json", true, true).Build()); }
/// <summary> /// Constructeur. /// </summary> /// <param name="eventService">Service de gestion des commandes.</param> /// <param name="repositoryService">Service pour l'accès aux répertoires de données.</param> /// <param name="configurationService">Service de gestion de la configuration de l'application.</param> public ExecutionContext(IEventService eventService, IRepositoryService repositoryService, IApplicationConfigurationService configurationService) { this.eventService = eventService; this.repositoryService = repositoryService; this.configurationService = configurationService; }
/// <summary>Initializes a new instance of the <see cref="SettingsThemeViewModel" /> class.</summary> /// <param name="applicationConfigService">The application configuration service.</param> public SettingsThemeViewModel(IApplicationConfigurationService applicationConfigService) : base(false) { _applicationConfigService = applicationConfigService; }
private DependencyInjection(IServiceCollection services, IApplicationConfigurationService config) { _services = services; _config = config; }
public ServerInformationViewModel(IApplicationConfigurationService configurationService) { _configurationService = configurationService ?? throw new ArgumentNullException(nameof(configurationService)); }