/// <summary> /// /// </summary> /// <param name="owner"></param> /// <param name="name"></param> /// <param name="sources"></param> /// <param name="filter">if null no filter, else use it to filter every ILogEntry</param> public LogSourceAggregation(LogAggregator owner, string name, ILogSource[] sources, ILogConstraints filterTemplate) { m_owner = owner; m_logName = name; m_originalSources = new List <ILogSource>(sources); m_fieldNames = AggregateFieldNames(sources); AggregateColumnTypes(sources); // if (filterTemplate != null) // { // m_filter = new LogConstraints(this, filterTemplate as LogConstraints); // } // else { m_filter = null; } }
/// <summary> /// agregates one or more sources -> creates a new (uninitialized) aggregation /// /// NOTE: /// we also 'aggregate' only 1 source to gain the advantage offered by this algoritm /// of being able to pump entry-s to ui thread in chucks instead of sending all source /// in one shoot -> more responsive ui /// </summary> /// <param name="outputLogSourceName"></param> /// <param name="sources"></param> /// <param name="constraints">null if no filter</param> /// <returns></returns> private ILogSource CreateUninitializedAggregation(string outputLogSourceName, ILogSource[] sources, ILogConstraints filterTemplate) { // zero sources - nothing we can do if ((sources == null) || (sources.Length == 0)) { return(null); } ILogSource newAggregation = null; try { // not in cache, so build it, add it to cache (if caching ok) and return it newAggregation = new LogSourceAggregation(this, outputLogSourceName, sources, filterTemplate); return(newAggregation); } finally { Raise_AggregationProgress("LogViewerSR.AggregationProgress_BeginInitialize", cProgressLogCreated, null); } }
ILogSource ILogAggregator.PrepareAggregation(string outputLogSourceName, ILogSource[] sources, ILogConstraints filterTemplate) { ILogSource outputSource = CreateUninitializedAggregation(outputLogSourceName, sources, filterTemplate); m_currentSource = outputSource as LogSourceAggregation; return(outputSource); }