internal IEnumerable <CalendarLogAnalysis> AnalyzeLogs(IEnumerable <CalendarLog> calendarLogs)
        {
            CalendarLog calendarLog = calendarLogs.FirstOrDefault <CalendarLog>();
            IEnumerable <CalendarLogAnalysis> enumerable;

            if (calendarLog != null && calendarLog.IsFileLink)
            {
                enumerable = this.LoadMsgLogs(calendarLogs);
            }
            else
            {
                enumerable = this.LoadMailboxLogs(calendarLogs);
            }
            string[] array = null;
            if (!this.VerifyItemCohesion(enumerable, out array))
            {
                throw new InvalidLogCollectionException();
            }
            enumerable.OrderBy((CalendarLogAnalysis f) => f, CalendarLogAnalysis.GetComparer());
            return(this.PerformAnalysis(enumerable));
        }
Ejemplo n.º 2
0
        internal static string Serialize(IEnumerable <CalendarLogAnalysis> logs, OutputType outputType, AnalysisDetailLevel detailLevel, bool showAll)
        {
            IEnumerable <PropertyDefinition> propertyMask = showAll ? new List <PropertyDefinition>() : CalendarLogAnalysisSerializer.FindUnchangedProperties(logs);
            LogSerializer logSerializer;

            switch (outputType)
            {
            case OutputType.HTML:
                logSerializer = new HtmlLogSerializer(propertyMask);
                goto IL_42;

            case OutputType.XML:
                logSerializer = new XmlLogSerializer(propertyMask);
                goto IL_42;
            }
            logSerializer = new CsvLogSerializer(propertyMask);
IL_42:
            IEnumerable <PropertyDefinition> properties = AnalysisDetailLevels.GetDisplayProperties(detailLevel).Union(CalendarLogAnalysis.GetDisplayProperties(logs));

            logs.OrderBy((CalendarLogAnalysis f) => f, CalendarLogAnalysis.GetComparer());
            return(logSerializer.Serialize(logs, properties, null));
        }