Example #1
0
        public SearchPanelViewModel(ILogFilterService logFilterService, ILogsViewService logsViewService)
        {
            LogsViewService = logsViewService;

            _selectedLogLevel = CreateProperty(nameof(SelectedLogLevel), LogLevel.All);
            var levelFilter = _selectedLogLevel.Select(CreateLogLevelFilter);

            logFilterService.AddFilter(levelFilter);

            _query = CreateProperty <string>(nameof(Query));
            var queryFilter = _query.Select(CreateQueryFilter).DistinctUntilChanged();

            logFilterService.AddFilter(queryFilter);
        }
        public LogSourceLevelFilter(ILogSourceService logSourceService, ILogFilterService logFilterService)
        {
            _thisLock     = new object();
            _sourceLevels = new Dictionary <ILogSource, LogLevel>();
            _filter       = new BehaviorSubject <Func <LogEvent, bool> >(LogFilter.PassAll);

            logFilterService.AddFilter(_filter);

            _sourcesSubscription = logSourceService.Sources.AsItemsBehaviorObservable().Subscribe(OnSourcesChanged);
        }