Example #1
0
 public StateMachineService(IBotFlowService botFlowService, IVariableService variableService,
                            IComparisonService comparisonService)
 {
     _variableService   = variableService;
     _comparisonService = comparisonService;
     _botFlowService    = botFlowService;
 }
Example #2
0
 public ProcessDataService(IItemToProcessRepository itemToProcessRepository, IHashService hashService,
                           IComparisonService comparisonService, IProcessResultRepository comparisonRepository)
 {
     _itemToProcessRepository = itemToProcessRepository;
     _hashService             = hashService;
     _comparisonService       = comparisonService;
     _comparisonRepository    = comparisonRepository;
 }
Example #3
0
        private static void InitServices()
        {
            var serviceProvider = new ServiceCollection()
                                  .AddSingleton <IComparisonService, ComparisonService>()
                                  .AddSingleton <INotificationService, NotificationService>()
                                  .BuildServiceProvider();

            _comparisonService   = serviceProvider.GetService <IComparisonService>();
            _notificationService = serviceProvider.GetService <INotificationService>();
        }
Example #4
0
 public BenchmarkChartsController(IBenchmarkChartBuilder benchmarkChartBuilder, IFinancialDataService financialDataService, IFinancialCalculationsService fcService, ILocalAuthoritiesService laService, IDownloadCSVBuilder csvBuilder,
                                  IContextDataService contextDataService, IBenchmarkCriteriaBuilderService benchmarkCriteriaBuilderService, IComparisonService comparisonService)
 {
     _benchmarkChartBuilder           = benchmarkChartBuilder;
     _financialDataService            = financialDataService;
     _fcService                       = fcService;
     _laService                       = laService;
     _csvBuilder                      = csvBuilder;
     _contextDataService              = contextDataService;
     _benchmarkCriteriaBuilderService = benchmarkCriteriaBuilderService;
     _comparisonService               = comparisonService;
 }
Example #5
0
 public BenchmarkCriteriaController(
     ILocalAuthoritiesService laService,
     IFinancialDataService financialDataService,
     IContextDataService contextDataService,
     ILaSearchService laSearchService,
     ISchoolBenchmarkListService benchmarkBasketService,
     IComparisonService comparisonService,
     IValidationService valService)
 {
     _financialDataService   = financialDataService;
     _laService              = laService;
     _contextDataService     = contextDataService;
     _laSearchService        = laSearchService;
     _benchmarkBasketService = benchmarkBasketService;
     _comparisonService      = comparisonService;
     _valService             = valService;
 }
 public void InitializeMocksAndRepo()
 {
     _clientInfoRepository = new ClientInfoInMemoryRepository();
     _clientInfoRepository.Seed(produceMocks());
     _comparisonService = new ComparisonService();
 }
Example #7
0
 public ComparisonController(IComparisonService comparisonService)
 {
     this.comparisonService = comparisonService;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="globalConfiguration">GlobalConfiguration</param>
 public ComparisonApiController()
 {
     comparisonService = new ComparisonServiceImpl(globalConfiguration);
 }
Example #9
0
 public DiffController(IDiffService service, IComparisonService comparisonService)
 {
     _diffService       = service;
     _comparisonService = comparisonService;
 }
 public CompareController(IComparisonService comparisonService, ILogger <CompareController> logger)
 {
     _comparisonService = comparisonService;
     _logger            = logger;
 }
 public SearchFightApiController(ISearchService searchService, IComparisonService comparisonService)
 {
     _searchService     = searchService;
     _comparisonService = comparisonService;
 }
Example #12
0
        public MainWindowViewModel(
            [NotNull] IFactory <IOverlayAuraViewModel, OverlayAuraProperties> auraViewModelFactory,
            [NotNull] IApplicationUpdaterViewModel appUpdater,
            [NotNull] IClipboardManager clipboardManager,
            [NotNull] IConfigSerializer configSerializer,
            [NotNull] IGenericSettingsViewModel settingsViewModel,
            [NotNull] IMessageBoxViewModel messageBox,
            [NotNull] IHotkeyConverter hotkeyConverter,
            [NotNull] IFactory <HotkeyIsActiveTrigger> hotkeyTriggerFactory,
            [NotNull] IConfigProvider <EyeAurasConfig> configProvider,
            [NotNull] IConfigProvider rootConfigProvider,
            [NotNull] IPrismModuleStatusViewModel moduleStatus,
            [NotNull] IMainWindowBlocksProvider mainWindowBlocksProvider,
            [NotNull] IFactory <IRegionSelectorService> regionSelectorServiceFactory,
            [NotNull] ISharedContext sharedContext,
            [NotNull] IComparisonService comparisonService,
            [NotNull][Dependency(WellKnownSchedulers.UI)] IScheduler uiScheduler)
        {
            using var unused = new OperationTimer(elapsed => Log.Debug($"{nameof(MainWindowViewModel)} initialization took {elapsed.TotalMilliseconds:F0}ms"));

            TabsList     = new ReadOnlyObservableCollection <IEyeAuraViewModel>(sharedContext.AuraList);
            ModuleStatus = moduleStatus.AddTo(Anchors);
            var executingAssemblyName = Assembly.GetExecutingAssembly().GetName();

            Title = $"{(AppArguments.Instance.IsDebugMode ? "[D]" : "")} {executingAssemblyName.Name} v{executingAssemblyName.Version}";
            Disposable.Create(() => Log.Info("Disposing Main view model")).AddTo(Anchors);

            ApplicationUpdater = appUpdater.AddTo(Anchors);
            MessageBox         = messageBox.AddTo(Anchors);
            Settings           = settingsViewModel.AddTo(Anchors);
            StatusBarItems     = mainWindowBlocksProvider.StatusBarItems;

            this.auraViewModelFactory  = auraViewModelFactory;
            this.configProvider        = configProvider;
            this.sharedContext         = sharedContext;
            this.regionSelectorService = regionSelectorServiceFactory.Create();
            this.clipboardManager      = clipboardManager;
            this.configSerializer      = configSerializer;
            this.hotkeyConverter       = hotkeyConverter;
            this.hotkeyTriggerFactory  = hotkeyTriggerFactory;

            CreateNewTabCommand = CommandWrapper.Create(() => AddNewCommandExecuted(OverlayAuraProperties.Default));
            CloseTabCommand     = CommandWrapper
                                  .Create <IOverlayAuraViewModel>(CloseTabCommandExecuted, CloseTabCommandCanExecute)
                                  .RaiseCanExecuteChangedWhen(this.WhenAnyProperty(x => x.SelectedTab));

            DuplicateTabCommand = CommandWrapper
                                  .Create(DuplicateTabCommandExecuted, DuplicateTabCommandCanExecute)
                                  .RaiseCanExecuteChangedWhen(this.WhenAnyProperty(x => x.SelectedTab));
            CopyTabToClipboardCommand = CommandWrapper
                                        .Create(CopyTabToClipboardExecuted, CopyTabToClipboardCommandCanExecute)
                                        .RaiseCanExecuteChangedWhen(this.WhenAnyProperty(x => x.SelectedTab).Select(x => x));

            PasteTabCommand             = CommandWrapper.Create(PasteTabCommandExecuted);
            UndoCloseTabCommand         = CommandWrapper.Create(UndoCloseTabCommandExecuted, UndoCloseTabCommandCanExecute);
            OpenAppDataDirectoryCommand = CommandWrapper.Create(OpenAppDataDirectory);
            SelectRegionCommand         = CommandWrapper.Create(SelectRegionCommandExecuted);

            Observable
            .FromEventPattern <OrderChangedEventArgs>(h => positionMonitor.OrderChanged += h, h => positionMonitor.OrderChanged -= h)
            .Select(x => x.EventArgs)
            .Subscribe(OnTabOrderChanged, Log.HandleUiException)
            .AddTo(Anchors);

            sharedContext
            .AuraList
            .ToObservableChangeSet()
            .ObserveOn(uiScheduler)
            .OnItemAdded(x => SelectedTab = x)
            .Subscribe()
            .AddTo(Anchors);

            this.WhenAnyValue(x => x.SelectedTab)
            .Subscribe(x => Log.Debug($"Selected tab: {x}"))
            .AddTo(Anchors);

            LoadConfig();
            rootConfigProvider.Save();

            if (sharedContext.AuraList.Count == 0)
            {
                CreateNewTabCommand.Execute(null);
            }

            configUpdateSubject
            .Sample(ConfigSaveSamplingTimeout)
            .Subscribe(SaveConfig, Log.HandleException)
            .AddTo(Anchors);

            Observable.Merge(
                this.WhenAnyProperty(x => x.Left, x => x.Top, x => x.Width, x => x.Height)
                .Sample(ConfigSaveSamplingTimeout)
                .Select(x => $"[{x.Sender}] Main window property change: {x.EventArgs.PropertyName}"),
                sharedContext.AuraList.ToObservableChangeSet()
                .Sample(ConfigSaveSamplingTimeout)
                .Select(x => "Tabs list change"),
                sharedContext.AuraList.ToObservableChangeSet()
                .WhenPropertyChanged(x => x.Properties)
                .Sample(ConfigSaveSamplingTimeout)
                .WithPrevious((prev, curr) => new { prev, curr })
                .Select(x => new { x.curr.Sender, ComparisonResult = comparisonService.Compare(x.prev?.Value, x.curr.Value) })
                .Where(x => !x.ComparisonResult.AreEqual)
                .Select(x => $"[{x.Sender.TabName}] Tab properties change: {x.ComparisonResult.DifferencesString}"))
            .Buffer(ConfigSaveSamplingTimeout)
            .Where(x => x.Count > 0)
            .Subscribe(
                reasons =>
            {
                const int maxReasonsToOutput = 50;
                Log.Debug(
                    $"Config Save reasons{(reasons.Count <= maxReasonsToOutput ? string.Empty : $"first {maxReasonsToOutput} of {reasons.Count} items")}:\r\n\t{reasons.Take(maxReasonsToOutput).DumpToTable()}");
                configUpdateSubject.OnNext(Unit.Default);
            },
Example #13
0
 public override void Setup()
 {
     base.Setup();
     this.comparisonService = new ComparisonService(this.context);
 }
 public ProductComparisonController(IComparisonService comparisonService)
 {
     _comparisonService = comparisonService;
 }
 public DiffController(IComparisonService comparisonService)
 {
     _comparisonService = comparisonService ?? throw new ArgumentNullException(nameof(comparisonService));
 }
 public ComparisonServiceTests()
 {
     _dataRepository    = new ComparisonDataRepository();
     _comparisonService = new ComparisonService(_dataRepository);
 }
Example #17
0
 public ComparisonsController(IComparisonService service)
 {
     this.service = service;
 }
Example #18
0
 public DiffController()
 {
     _diffService       = new Services.DiffService();
     _comparisonService = new ComparisonService();
 }