Exemplo n.º 1
0
        public FiltersManager(
            IFiltersFactory filtersFactory,
            Settings.IGlobalSettingsAccessor globalSettingsAccessor,
            ILogSourcesManager logSourcesManager,
            IAdjustingColorsGenerator threadColors,
            IShutdown shutdown
            )
        {
            this.globalSettings = globalSettingsAccessor;
            this.logSources     = logSourcesManager;

            this.highlightFilters = filtersFactory.CreateFiltersList(FilterAction.Exclude, FiltersListPurpose.Highlighting);

            this.globalSettings.Changed += (sender, args) =>
            {
                if ((args.ChangedPieces & Settings.SettingsPiece.Appearance) != 0)
                {
                    threadColors.Brightness = globalSettings.Appearance.ColoringBrightness;
                }
            };

            this.logSources.OnLogSourceRemoved += (s, e) =>
            {
                highlightFilters.PurgeDisposedFiltersAndFiltersHavingDisposedThreads();
            };

            shutdown.Cleanup += (sender, args) =>
            {
                highlightFilters.Dispose();
            };
        }
Exemplo n.º 2
0
        public FiltersManager(
            IFiltersFactory filtersFactory,
            Settings.IGlobalSettingsAccessor globalSettingsAccessor,
            ILogSourcesManager logSourcesManager,
            IShutdown shutdown
            )
        {
            this.globalSettings = globalSettingsAccessor;
            this.logSources     = logSourcesManager;

            this.highlightFilters = filtersFactory.CreateFiltersList(FilterAction.Exclude, FiltersListPurpose.Highlighting);

            this.logSources.OnLogSourceRemoved += (s, e) =>
            {
                highlightFilters.PurgeDisposedFiltersAndFiltersHavingDisposedThreads();
            };

            shutdown.Cleanup += (sender, args) =>
            {
                highlightFilters.Dispose();
            };
        }