public void OnAnalysisResultChanged(IDataSourceAnalysisHandle handle, ILogAnalysisResult result) { if (!ReferenceEquals(handle, _currentAnalysis)) { return; //< It's likely that we've received a callback from a previous analysis that we MOST CERTAINLY need to thrash } Result = result; }
public bool RemoveAnalysis(IDataSourceAnalysisHandle analysis) { lock (_syncRoot) { if (_analyses.Remove(analysis)) { var disposable = analysis as IDisposable; disposable?.Dispose(); return(true); } return(false); } }
public void OnProgress(IDataSourceAnalysisHandle handle, Percentage progress) { if (!ReferenceEquals(handle, _currentAnalysis)) { return; //< It's likely that we've received a callback from a previous analysis that we MOST CERTAINLY need to thrash } if (Percentage.IsNan(progress)) { Progress = Percentage.HundredPercent; } else { Progress = progress; } }
private void RestartAnalysis() { if (_currentAnalysis != null) { _logAnalyserEngine.RemoveAnalysis(_currentAnalysis); _currentAnalysis = null; } var configuration = new DataSourceAnalysisConfiguration { PluginId = _template.AnalyserPluginId, Configuration = _configuration }; _currentAnalysis = _logAnalyserEngine.CreateAnalysis(_logFile, configuration, this); // Now that we've assigned the current analysis, we can actually start it // (otherwise there would be the race condition of being notified through the // listener interface before we've assigned the new handle, effectively losing // the values provided by the callback). _currentAnalysis.Start(); }