ILogSource ILogAggregator.PrepareAggregation(string outputLogSourceName, ILogSource[] sources, ILogConstraints filterTemplate)
        {
            ILogSource outputSource = CreateUninitializedAggregation(outputLogSourceName, sources, filterTemplate);

            m_currentSource = outputSource as LogSourceAggregation;

            return(outputSource);
        }
        /// <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);
            }
        }