コード例 #1
0
 public SettingsServiceBase(IServiceProvider sp)
 {
     _sp               = sp;
     _settingsCache    = _sp.GetRequiredService <ISettingsCache>();
     _tenantIdAccessor = _sp.GetRequiredService <ITenantIdAccessor>();
     _repo             = _sp.GetRequiredService <ApplicationRepository>();
 }
コード例 #2
0
        public UnityNUnitServiceProvider(ISolution solution,
                                         IPsiModules psiModules,
                                         ISymbolCache symbolCache,
                                         IUnitTestElementIdFactory idFactory,
                                         IUnitTestElementManager elementManager,
                                         NUnitTestProvider provider,
                                         IUnitTestingSettings settings,
                                         ISettingsStore settingsStore,
                                         ISettingsOptimization settingsOptimization,
                                         ISettingsCache settingsCache,
                                         UnitTestingCachingService cachingService,
                                         INUnitTestParametersProvider testParametersProvider,
                                         UnityEditorProtocol editorProtocol,
                                         RunViaUnityEditorStrategy runViaUnityEditorStrategy,
                                         UnitySolutionTracker unitySolutionTracker)
            : base(solution, psiModules, symbolCache, idFactory, elementManager, provider, settings, settingsStore,
                   settingsOptimization, settingsCache, cachingService, testParametersProvider)
        {
            if (solution.GetData(ProjectModelExtensions.ProtocolSolutionKey) == null)
            {
                return;
            }

            myRdUnityModel         = solution.GetProtocolSolution().GetRdUnityModel();
            myEditorProtocol       = editorProtocol;
            myUnityEditorStrategy  = runViaUnityEditorStrategy;
            myUnitySolutionTracker = unitySolutionTracker;
        }
コード例 #3
0
 public ApplicationSettingsServiceBase(ApplicationSettingsServiceDependencies deps) : base(deps.Context)
 {
     _settingsCache    = deps.SettingsCache;
     _permissionsCache = deps.PermissionsCache;
     _behavior         = deps.Behavior;
     _metadataProvider = deps.MetadataProvider;
 }
コード例 #4
0
        public UnityNUnitServiceProvider(ISolution solution,
                                         IPsiModules psiModules,
                                         ISymbolCache symbolCache,
                                         IUnitTestElementIdFactory idFactory,
                                         IUnitTestElementManager elementManager,
                                         NUnitTestProvider provider,
                                         IUnitTestingSettings settings,
                                         ISettingsStore settingsStore,
                                         ISettingsOptimization settingsOptimization,
                                         ISettingsCache settingsCache,
                                         UnitTestingCachingService cachingService,
                                         INUnitTestParametersProvider testParametersProvider,
                                         FrontendBackendHost frontendBackendHost,
                                         BackendUnityHost backendUnityHost,
                                         RunViaUnityEditorStrategy runViaUnityEditorStrategy,
                                         UnitySolutionTracker unitySolutionTracker)
            : base(solution, psiModules, symbolCache, idFactory, elementManager, provider, settings, settingsStore,
                   settingsOptimization, settingsCache, cachingService, testParametersProvider)
        {
            // Only in tests
            if (!frontendBackendHost.IsAvailable)
            {
                return;
            }

            myFrontendBackendModel = frontendBackendHost.Model.NotNull("frontendBackendHost.Model != null");
            myBackendUnityHost     = backendUnityHost;
            myUnityEditorStrategy  = runViaUnityEditorStrategy;
            myUnitySolutionTracker = unitySolutionTracker;
        }
コード例 #5
0
 public ExchangeRatesService(
     ApplicationRepository repo,
     ISettingsCache settingsCache,
     IServiceProvider sp) : base(sp)
 {
     _repo          = repo;
     _settingsCache = settingsCache;
 }
コード例 #6
0
 public GeneralSettingsService(
     ApplicationSettingsServiceDependencies deps,
     IStringLocalizer <Strings> localizer,
     ISettingsCache settingsCache) : base(deps)
 {
     _localizer     = localizer;
     _settingsCache = settingsCache;
     _behavior      = deps.Behavior;
 }
コード例 #7
0
 public ApplicationApiFilter(IServiceProvider sp)
 {
     _appRepo              = sp.GetRequiredService <ApplicationRepository>();
     _tenantIdAccessor     = sp.GetRequiredService <ITenantIdAccessor>();
     _tenantInfoAccessor   = sp.GetRequiredService <ITenantInfoAccessor>();
     _externalUserAccessor = sp.GetRequiredService <IExternalUserAccessor>();
     _definitionsCache     = sp.GetRequiredService <IDefinitionsCache>();
     _settingsCache        = sp.GetRequiredService <ISettingsCache>();
     _serviceProvider      = sp;
 }
コード例 #8
0
 public SummaryEntriesController(
     ILogger <SummaryEntriesController> logger,
     IStringLocalizer <Strings> localizer,
     ApplicationRepository repo,
     ISettingsCache settingsCache) : base(logger, localizer)
 {
     _logger        = logger;
     _localizer     = localizer;
     _repo          = repo;
     _settingsCache = settingsCache;
 }
コード例 #9
0
 public ApplicationApiFilter(ITenantIdAccessor tenantIdAccessor, ApplicationRepository appRepo, ITenantInfoAccessor tenantInfoAccessor,
                             IExternalUserAccessor externalUserAccessor, IServiceProvider serviceProvider, IDefinitionsCache definitionsCache, ISettingsCache settingsCache)
 {
     _appRepo              = appRepo;
     _tenantIdAccessor     = tenantIdAccessor;
     _tenantInfoAccessor   = tenantInfoAccessor;
     _externalUserAccessor = externalUserAccessor;
     _serviceProvider      = serviceProvider;
     _definitionsCache     = definitionsCache;
     _settingsCache        = settingsCache;
 }
コード例 #10
0
 public SettingsController(ApplicationRepository repo,
                           ILogger <SettingsController> logger,
                           IStringLocalizer <Strings> localizer,
                           ISettingsCache settingsCache,
                           ITenantIdAccessor tenantIdAccessor)
 {
     _repo             = repo;
     _logger           = logger;
     _localizer        = localizer;
     _settingsCache    = settingsCache;
     _tenantIdAccessor = tenantIdAccessor;
 }
コード例 #11
0
ファイル: Form1.cs プロジェクト: bairamovazat/FileManager
        private ISettingCache GetSettingCacheTwo(ISettingsCache settingsCache)
        {
            return(new SettingCacheImpl()
            {
                LastDriverName = new Func <string>(() => settingsCache.LastDriverNameTwo()),

                LastPath = new Func <List <string> >(() => settingsCache.LastPathTwo()),

                SaveLastDriverName = new Action <string>((name) => settingsCache.SaveLastDriverNameTwo(name)),

                SaveLastPath = new Action <List <string> >((list) => settingsCache.SaveLastPathTwo(list))
            });
        }
コード例 #12
0
 public ApplicationSettingsServiceDependencies(
     IServiceContextAccessor context,
     ISettingsCache settingsCache,
     IPermissionsCache permissionsCache,
     ApplicationServiceBehavior behavior,
     MetadataProvider metadataProvider)
 {
     Context          = context;
     SettingsCache    = settingsCache;
     PermissionsCache = permissionsCache;
     Behavior         = behavior;
     MetadataProvider = metadataProvider;
 }
コード例 #13
0
ファイル: Form1.cs プロジェクト: bairamovazat/FileManager
        public MainForm()
        {
            InitializeComponent();
            BindCmdRuner();
            settingsCache = new SettingsCacheIniImpl();
            LoadSizeFromCache();
            LoadPositionFromCache();
            dataGridViewOne.Cache = GetSettingCacheOne(settingsCache);
            dataGridViewTwo.Cache = GetSettingCacheTwo(settingsCache);

            dataGridViewOne.GotFocus += (sender, e) => lastFocusedFileDataGridView = dataGridViewOne;
            dataGridViewTwo.GotFocus += (sender, e) => lastFocusedFileDataGridView = dataGridViewTwo;

            dataGridViewOne.UpdateView += (dataGrid) => labelOne.Text = dataGrid.GetCurrentPath();
            dataGridViewTwo.UpdateView += (dataGrid) => labelTwo.Text = dataGrid.GetCurrentPath();

            dataGridViewOne.GlobalErrorHandler += (ex) => MessageBox.Show(ex.Message, "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            dataGridViewTwo.GlobalErrorHandler += (ex) => MessageBox.Show(ex.Message, "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error);

            Bind(dataGridViewOne, comboBoxOne);
            Bind(dataGridViewTwo, comboBoxTwo);

            BindFocus(dataGridViewOne, panelOneChoseDisk);
            BindFocus(dataGridViewTwo, panelTwoChoseDisk);

            dataGridViewOne.UpdateDrives();
            dataGridViewTwo.UpdateDrives();

            dataGridViewOne.Focus();

            //TODO сделать систему коммитов, чтобы каждый пиксель не записывать
            this.SizeChanged += (sender, e) =>
            {
                Console.WriteLine("SizeChange");
                settingsCache.Width  = this.Width;
                settingsCache.Height = this.Height;
            };

            this.LocationChanged += (sender, e) =>
            {
                settingsCache.XPosition = this.Location.X;
                settingsCache.YPosition = this.Location.Y;
            };
            this.MouseMove += (sender, e) =>
            {
                if (Clipboard.ContainsFileDropList())
                {
                    Console.WriteLine(Clipboard.GetFileDropList());
                }
            };
        }
コード例 #14
0
 public CompaniesService(
     IServiceContextAccessor accessor,
     AdminRepository db,
     IApplicationRepositoryFactory factory,
     ISettingsCache settingsCache,
     NullServiceBehavior behavior,
     ILogger <CompaniesService> logger) : base(accessor)
 {
     _adminRepo     = db;
     _factory       = factory;
     _settingsCache = settingsCache;
     _logger        = logger;
     _behavior      = behavior;
 }
コード例 #15
0
ファイル: DocumentsController.cs プロジェクト: azhkhn/tellma
 public DocumentsController(ILogger <DocumentsController> logger, IStringLocalizer <Strings> localizer,
                            ApplicationRepository repo, ITenantIdAccessor tenantIdAccessor, IBlobService blobService,
                            IDefinitionsCache definitionsCache, ISettingsCache settingsCache, IClientInfoAccessor clientInfo,
                            IModelMetadataProvider modelMetadataProvider, ITenantInfoAccessor tenantInfoAccessor) : base(logger, localizer)
 {
     _logger                = logger;
     _localizer             = localizer;
     _repo                  = repo;
     _tenantIdAccessor      = tenantIdAccessor;
     _blobService           = blobService;
     _definitionsCache      = definitionsCache;
     _settingsCache         = settingsCache;
     _clientInfo            = clientInfo;
     _modelMetadataProvider = modelMetadataProvider;
     _tenantInfoAccessor    = tenantInfoAccessor;
 }
        public SettingsManager(ITableStorage storage, ISettingsCache cache, int cacheAbsoluteExpirationInHours = 24)
        {
            if (storage == null)
            {
                throw new ArgumentNullException("storage");
            }
            _storage = storage;

            if (cache == null)
            {
                throw new ArgumentNullException("cache");
            }
            _cache = cache;

            _cacheAbsoluteExpirationInHours = cacheAbsoluteExpirationInHours;
        }
コード例 #17
0
        public TodoItemsCountProvider(
            Lifetime lifetime,
            IPrimaryTodoManager primaryTodoManager,
            SolutionSettingsCache solutionSettingsCache,
            TodoItemsCountDefinitionsCachedSettingsReader todoItemsCountDefinitionsCachedSettingsReader,
            IEnumerable <ITodoItemsCountConsumer> todoItemsCountConsumers,
            ISettingsStore settingsStore)
        {
            _primaryTodoManager = primaryTodoManager;
            _settingsCache      = solutionSettingsCache;
            _todoItemsCountDefinitionsCachedSettingsReader = todoItemsCountDefinitionsCachedSettingsReader;
            _todoItemsCountConsumers = todoItemsCountConsumers.ToIReadOnlyList();

            _primaryTodoManager.FilesWereUpdated.Advise(lifetime, files =>
            {
                // Check for invalid changed files, else we'll get "not valid" exceptions in the 'AllItems' access
                // later (at least as observed during unit test shut down):
                if (files.WhereNotNull().All(x => x.IsValid()))
                {
                    UpdateTodoItemsCounts();
                }
            });

            var settingsCacheGetDataSequentialLifeTime = new SequentialLifetimes(lifetime);

            _currentSettingsCacheLifeTime = settingsCacheGetDataSequentialLifeTime.Next();

            settingsStore.AdviseChange(lifetime, _todoItemsCountDefinitionsCachedSettingsReader.KeyExposed, () =>
            {
                // We use the following lifetime to solve the issue that this 'ISettingsStore.AdviseChange()' callback
                // arrives earlier than the one used in the cache. => The cache has still the old value when accessed
                // in 'UpdateTodoItemsCounts()'. => Terminate the cache lifetime explicitly.
                _currentSettingsCacheLifeTime = settingsCacheGetDataSequentialLifeTime.Next();

                UpdateTodoItemsCounts();
            });

            foreach (var consumer in _todoItemsCountConsumers)
            {
                consumer.UpdateRequestSignal.Advise(lifetime, () => { UpdateTodoItemsCounts(); });
            }

            // IDEA: Combine the three event sources and execute update in background thread?
        }
コード例 #18
0
 public UnityNUnitServiceProvider(ISolution solution, IPsiModules psiModules, ISymbolCache symbolCache,
                                  IUnitTestElementIdFactory idFactory, IUnitTestElementManager elementManager, NUnitTestProvider provider,
                                  ISettingsStore settingsStore, ISettingsOptimization settingsOptimization, ISettingsCache settingsCache,
                                  UnitTestingCachingService cachingService, IDotNetCoreSdkResolver dotNetCoreSdkResolver,
                                  UnityEditorProtocol unityEditorProtocol,
                                  RunViaUnityEditorStrategy runViaUnityEditorStrategy,
                                  NUnitOutOfProcessUnitTestRunStrategy nUnitOutOfProcessUnitTestRunStrategy)
     : base(solution, psiModules, symbolCache, idFactory, elementManager, provider, settingsStore,
            settingsOptimization, settingsCache, cachingService, dotNetCoreSdkResolver, nUnitOutOfProcessUnitTestRunStrategy)
 {
     myUnityEditorProtocol = unityEditorProtocol;
     myUnityEditorStrategy = runViaUnityEditorStrategy;
 }
コード例 #19
0
 public void SetUp()
 {
     cache = Substitute.For <ISettingsCache <NonIdempotencySign> >();
     blackListIdempotencyResolver = new BlackListIdempotencyResolver(cache);
 }
コード例 #20
0
        public UnityNUnitServiceProvider(ISolution solution, IPsiModules psiModules, ISymbolCache symbolCache,
                                         IUnitTestElementIdFactory idFactory, IUnitTestElementManager elementManager, NUnitTestProvider provider,
                                         ISettingsStore settingsStore, ISettingsOptimization settingsOptimization, ISettingsCache settingsCache,
                                         UnitTestingCachingService cachingService, IDotNetCoreSdkResolver dotNetCoreSdkResolver,
                                         UnityEditorProtocol editorProtocol,
                                         RunViaUnityEditorStrategy runViaUnityEditorStrategy,
                                         NUnitOutOfProcessUnitTestRunStrategy nUnitOutOfProcessUnitTestRunStrategy)
            : base(solution, psiModules, symbolCache, idFactory, elementManager, provider, settingsStore,
                   settingsOptimization, settingsCache, cachingService, dotNetCoreSdkResolver, nUnitOutOfProcessUnitTestRunStrategy)
        {
            if (solution.GetData(ProjectModelExtensions.ProtocolSolutionKey) == null)
            {
                return;
            }

            myRdUnityModel = solution.GetProtocolSolution().GetRdUnityModel();

            myEditorModel         = editorProtocol.UnityModel;
            myUnityEditorStrategy = runViaUnityEditorStrategy;
        }
コード例 #21
0
 public SettingsManager(ISettingsCache <TSetting> settingsCache, ISettingsRepository <TSetting> settingsRepository)
 {
     this.settingsCache      = settingsCache;
     this.settingsRepository = settingsRepository;
 }
コード例 #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AppConfigInterceptor"/> type.
 /// </summary>
 /// <param name="settingsProvider">The settings provider.</param>
 /// <param name="settingsCache">The settings cache.</param>
 public AppConfigInterceptor(ISettingsProvider settingsProvider, ISettingsCache settingsCache)
 {
     _settingsProvider = settingsProvider;
     _settingsCache    = settingsCache;
 }
コード例 #23
0
 public BlackListIdempotencyResolver(ISettingsCache <NonIdempotencySign> nonIdempotencySignsCache)
 {
     this.nonIdempotencySignsCache = nonIdempotencySignsCache;
 }
コード例 #24
0
 public GeneralSettingsController(IServiceProvider sp, GeneralSettingsService service, ILogger <GeneralSettingsController> logger, ISettingsCache settingsCache) : base(sp)
 {
     _service       = service;
     _logger        = logger;
     _settingsCache = settingsCache;
 }
コード例 #25
0
        public void SetUp()
        {
            iclCache = Substitute.For <ISettingsCache <IdempotencyControlRule> >();

            iclResolver = new IclResolver(iclCache);
        }
コード例 #26
0
 public DashboardDefinitionsService(ApplicationRepository repo, ISettingsCache settingsCache, IDefinitionsCache defCache, IServiceProvider sp) : base(sp)
 {
     _repo          = repo;
     _settingsCache = settingsCache;
     _defCache      = defCache;
 }
コード例 #27
0
 public IclResolver(ISettingsCache <IdempotencyControlRule> iclCache)
 {
     this.iclCache = iclCache;
 }
コード例 #28
0
 public SettingsController(AutomaticaContext dbContext, IAutoUpdateHandler updateHandler, ISettingsCache settingsCache) : base(dbContext)
 {
     _updateHandler = updateHandler;
     _settingsCache = settingsCache;
 }