示例#1
0
        void LogFileReader_FinishedLoading(object sender, EventArgs e)
        {
            Logger.logInfo("Finished loading.");
            _isLoading = false;
            _isDeadFile = false;
            if (!_waitingForClose)
            {
                Invoke(new MethodInvoker(LoadingFinished));
                Invoke(new MethodInvoker(LoadPersistenceData));
                Invoke(new MethodInvoker(SetGuiAfterLoading));
                _loadingFinishedEvent.Set();
                _externaLoadingFinishedEvent.Set();
                _timeSpreadCalc.SetLineCount(CurrentLogFileReader.LineCount);

                if (_reloadMemento != null)
                {
                    Invoke(new Action<ReloadMemento>(PositionAfterReload), new object[] { _reloadMemento });
                }
                if (filterTailCheckBox.Checked)
                {
                    Logger.logInfo("Refreshing filter view because of reload.");
                    Invoke(new MethodInvoker(FilterSearch)); // call on proper thread
                }

                HandleChangedFilterList();
            }
            _reloadMemento = null;
        }
示例#2
0
 void PositionAfterReload(ReloadMemento reloadMemento)
 {
     if (_reloadMemento.currentLine < dataGridView.RowCount && _reloadMemento.currentLine >= 0)
     {
         dataGridView.CurrentCell = dataGridView.Rows[_reloadMemento.currentLine].Cells[0];
     }
     if (_reloadMemento.firstDisplayedLine < dataGridView.RowCount && _reloadMemento.firstDisplayedLine >= 0)
     {
         dataGridView.FirstDisplayedScrollingRowIndex = _reloadMemento.firstDisplayedLine;
     }
 }
示例#3
0
        public void Reload()
        {
            SavePersistenceData(false);

            _reloadMemento = new ReloadMemento();
            _reloadMemento.currentLine = dataGridView.CurrentCellAddress.Y;
            _reloadMemento.firstDisplayedLine = dataGridView.FirstDisplayedScrollingRowIndex;
            _forcedColumnizerForLoading = CurrentColumnizer;

            if (_fileNames == null || !IsMultiFile)
            {
                LoadFile(FileName, EncodingOptions);
            }
            else
            {
                LoadFilesAsMulti(_fileNames, EncodingOptions);
            }
        }