private CalendarLogAnalysis LoadFromMailbox(CalendarLogId id, UriHandler handler, MailboxSession session)
        {
            StoreObjectId       storeId = StoreObjectId.Deserialize(handler.Id);
            CalendarLogAnalysis result;

            using (Item item = Item.Bind(session, storeId))
            {
                IEnumerable <PropertyDefinition> displayProperties = AnalysisDetailLevels.GetDisplayProperties(this.detailLevel);
                item.Load(displayProperties.ToArray <PropertyDefinition>());
                result = new CalendarLogAnalysis(id, item, displayProperties);
            }
            return(result);
        }
        private CalendarLogAnalysis LoadFromFile(CalendarLogId id, UriHandler handler)
        {
            FileInfo fileInfo = new FileInfo(handler.Uri.LocalPath);

            if (fileInfo.Exists)
            {
                using (MessageItem messageItem = MessageItem.CreateInMemory(StoreObjectSchema.ContentConversionProperties))
                {
                    using (FileStream fileStream = fileInfo.OpenRead())
                    {
                        ItemConversion.ConvertMsgStorageToItem(fileStream, messageItem, new InboundConversionOptions(new EmptyRecipientCache(), null));
                        IEnumerable <PropertyDefinition> displayProperties = AnalysisDetailLevels.GetDisplayProperties(this.detailLevel);
                        return(new CalendarLogAnalysis(id, messageItem, displayProperties));
                    }
                }
            }
            throw new ArgumentException("Item argument cannot be resolved.", "item");
        }
Ejemplo n.º 3
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));
        }