public PiServerService()
 {
     this.context            = new ContextInfoAccessorService();
     this.dbContext          = new PowerGridEntities();
     this.blobStorageService = new BlobStorageService();
     this.applicationConfigurationService = new ApplicationConfigurationService();
 }
Exemplo n.º 2
0
 public UploadController(Context context, IApplicationConfigurationService applicationConfigurationService, IAuthService authService, IUploadService uploadService)
 {
     this.context = context;
     this.applicationConfigurationService = applicationConfigurationService;
     this.authService   = authService;
     this.uploadService = uploadService;
 }
Exemplo n.º 3
0
 /// <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;
 }
Exemplo n.º 4
0
 public NotifikacijaService(ILifetimeScope scope, Context context, IAuthService authService, IApplicationConfigurationService applicationConfigurationService)
     : base(scope)
 {
     this.context     = context;
     this.authService = authService;
     this.applicationConfigurationService = applicationConfigurationService;
 }
Exemplo n.º 5
0
 /// <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;
 }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 8
0
        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;
        }
Exemplo n.º 9
0
        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();
        }
Exemplo n.º 10
0
        /// <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);
                }
            }
        }
Exemplo n.º 11
0
 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);
Exemplo n.º 14
0
 public ApplicationSettingsViewModel(IApplicationConfigurationService configurationService)
 {
     _configurationService = configurationService ?? throw new ArgumentNullException(nameof(configurationService));
 }
Exemplo n.º 15
0
 public UploadService(ILifetimeScope scope, Context context, IApplicationConfigurationService applicationConfigurationService) : base(scope)
 {
     this.applicationConfigurationService = applicationConfigurationService;
     this.context = context;
 }
Exemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ApplicationConfigurationController"/> class.
 /// </summary>
 public ApplicationConfigurationController()
 {
     this.applicationConfigurationService = new ApplicationConfigurationService();
 }
Exemplo n.º 17
0
 public override void ExecuteConfiguration(IApplicationConfigurationService service)
 {
     service.ExposeDelegate(_currentApi, this, _delegate);
 }
Exemplo n.º 18
0
 public ApplicationConfigurationServiceTests()
 {
     _config = new ApplicationConfigurationService(
         new ConfigurationBuilder()
         .AddJsonFile("appsettings.json", true, true).Build());
 }
Exemplo n.º 19
0
 /// <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;
 }
Exemplo n.º 20
0
 /// <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;
 }
Exemplo n.º 21
0
 private DependencyInjection(IServiceCollection services,
                             IApplicationConfigurationService config)
 {
     _services = services;
     _config   = config;
 }
Exemplo n.º 22
0
 public ServerInformationViewModel(IApplicationConfigurationService configurationService)
 {
     _configurationService = configurationService ?? throw new ArgumentNullException(nameof(configurationService));
 }