Esempio n. 1
0
        public LogViewerViewModel(IDataSourceViewModel dataSource,
                                  IActionCenter actionCenter,
                                  IApplicationSettings applicationSettings,
                                  TimeSpan maximumWaitTime)
        {
            if (dataSource == null)
            {
                throw new ArgumentNullException(nameof(dataSource));
            }
            if (actionCenter == null)
            {
                throw new ArgumentNullException(nameof(actionCenter));
            }
            if (applicationSettings == null)
            {
                throw new ArgumentNullException(nameof(applicationSettings));
            }

            _actionCenter        = actionCenter;
            _applicationSettings = applicationSettings;
            _maximumWaitTime     = maximumWaitTime;
            _dataSource          = dataSource;

            _pendingSections = new List <KeyValuePair <ILogFile, LogFileSection> >();

            LogFile = _dataSource.DataSource.FilteredLogFile;
            LogFile.AddListener(this, _maximumWaitTime, 1000);
            Search = _dataSource.DataSource.Search;

            UpdateCounts();
        }