Example #1
0
        public static void ApplySettings(IDebugSettings settings)
        {
            Debug.RemoveAllOutputStreams();
            Debug.RemoveAllPrefixes();

            Debug.PrefixLookupMode = (PrefixLookupSettings)settings.PrefixLookupFlags;

            SeverityFilter = settings.SeverityFilter;

            Debug.AdlEnabled      = settings.Enabled;
            Debug.AdlWarningMask  = 0;
            Debug.CheckForUpdates = settings.SearchForUpdates;
            Debug.AdlWarningMask  = -1;
            Debug.SendWarnings    = settings.SendInternalWarnings;
            Debug.UpdateMask      = -1;

            Debug.SetAllPrefixes(settings.StageNames);

            Debug.AddPrefixForMask(0, "[Silent]");

            foreach (ILogStreamSettings logStreamSettings in settings.Streams)
            {
                Debug.AddOutputStream(OpenStream(logStreamSettings));
            }


            CrashConfig cconf = new CrashConfig();

            cconf.CrashMask       = -1;
            cconf.CheckForUpdates = settings.SearchForUpdates;
            CrashHandler.Initialize(cconf);
        }
 public GridVisualizer(IGrid grid,
                       IGridPositionCalculator gridPositionCalculator,
                       IGridCellHighlightPool cellHighlightPool,
                       IDebugSettings debugSettings)
 {
     _grid = grid;
     _positionCalculator = gridPositionCalculator;
     _cellHighlightPool  = cellHighlightPool;
     _debugSettings      = debugSettings;
 }
Example #3
0
 public MainWindowViewModel
 (
     [NotNull] IYouTubeCleanupToolDbContextFactory youTubeCleanupToolDbContextFactory,
     [NotNull] IMapper mapper,
     [NotNull] IGetAndCacheYouTubeData getAndCacheYouTubeData,
     [NotNull] IUpdateDataViewModel updateDataViewModel,
     [NotNull] IWindowService windowService,
     [NotNull] IErrorHandler errorHandler,
     [NotNull] IDoWorkOnUi doWorkOnUi,
     [NotNull] IDebugSettings debugSettings,
     [NotNull] ILogger logger
 )
 {
     _youTubeCleanupToolDbContextFactory = youTubeCleanupToolDbContextFactory;
     Videos                  = new ObservableCollection <WpfVideoData>();
     Playlists               = new ObservableCollection <WpfPlaylistData>();
     VideoFilter             = new ObservableCollection <VideoFilter>();
     _mapper                 = mapper;
     _getAndCacheYouTubeData = getAndCacheYouTubeData;
     CheckedOrUncheckedVideoInPlaylistCommand = new RunMethodCommand <WpfPlaylistData>(async o => await UpdateVideoInPlaylist(o), errorHandler.HandleError);
     OpenPlaylistCommand                       = new RunMethodCommand <PlaylistData>(OpenPlaylist, errorHandler.HandleError);
     OpenChannelCommand                        = new RunMethodCommand <VideoData>(OpenChannel, errorHandler.HandleError);
     OpenVideoCommand                          = new RunMethodCommand <VideoData>(OpenVideo, errorHandler.HandleError);
     SearchCommand                             = new RunMethodWithoutParameterCommand(Search, errorHandler.HandleError);
     RefreshDataCommand                        = new RunMethodWithoutParameterCommand(UpdateAllPlaylists, errorHandler.HandleError);
     UpdateSettingsCommand                     = new RunMethodWithoutParameterCommand(UpdateSettings, errorHandler.HandleError);
     RefreshSelectedPlaylistCommand            = new RunMethodWithoutParameterCommand(UpdateSelectedPlaylist, errorHandler.HandleError);
     ShowLogsCommand                           = new RunMethodWithoutParameterCommand(ShowLogsWindow, errorHandler.HandleError);
     _searchTypeDelayDeferTimer                = new DeferTimer(async() => await SearchForVideos(SearchText), errorHandler.HandleError);
     _selectedFilterDataFromComboBoxDeferTimer = new DeferTimer(async() => await GetVideosForPlaylist(SelectedFilterFromComboBox), errorHandler.HandleError);
     _selectedVideoChangedDeferTimer           = new DeferTimer(async() => await SelectedVideoChanged(SelectedVideo), errorHandler.HandleError);
     _updateDataViewModel                      = updateDataViewModel;
     _windowService                            = windowService;
     _doWorkOnUi    = doWorkOnUi;
     _debugSettings = debugSettings;
     _logger        = logger;
     _debugSettings.ShowIdsChanged += DebugSettingsOnShowIdsChanged;
     SpecialVideoFilters            = new List <VideoFilter>()
     {
         new() { Title = "All", FilterType = FilterType.All },
         new() { Title = "Uncategorized", FilterType = FilterType.Uncategorized },
     };
 }