示例#1
0
        public AdminAuditLogEvent(AdminAuditLogEventId identity, string eventLog)
        {
            AdminAuditLogEvent.< > c__DisplayClass4 CS$ < > 8__locals1 = new AdminAuditLogEvent.< > c__DisplayClass4();
            CS$ < > 8__locals1.eventLog = eventLog;
            this..ctor();
            CS$ < > 8__locals1.< > 4__this = this;
            if (identity == null)
            {
                throw new ArgumentNullException("identity");
            }
            if (CS$ < > 8__locals1.eventLog == null)
            {
                throw new ArgumentNullException("eventLog");
            }
            this.propertyBag[SimpleProviderObjectSchema.Identity] = identity;
            Dictionary <string, AdminAuditLogModifiedProperty> modifiedProperties = new Dictionary <string, AdminAuditLogModifiedProperty>(StringComparer.OrdinalIgnoreCase);
            List <PropertyParseSchema> list = new List <PropertyParseSchema>(AdminAuditLogEvent.AdminAuditLogRecordParseSchema);

            list.Add(new PropertyParseSchema("Parameter", AdminAuditLogSchema.CmdletParameters, (string line) => CS$ < > 8__locals1.< > 4__this.ParseCmdletParameter(line, CS$ < > 8__locals1.eventLog)));
            list.Add(new PropertyParseSchema("Property Modified", AdminAuditLogSchema.ModifiedProperties, (string line) => CS$ < > 8__locals1.< > 4__this.ParseModifiedProperty(line, modifiedProperties, true, CS$ < > 8__locals1.eventLog)));
            list.Add(new PropertyParseSchema("Property Original", AdminAuditLogSchema.ModifiedProperties, (string line) => CS$ < > 8__locals1.< > 4__this.ParseModifiedProperty(line, modifiedProperties, false, CS$ < > 8__locals1.eventLog)));
            AuditLogParseSerialize.ParseAdminAuditLogRecord(this, list, CS$ < > 8__locals1.eventLog);
            if (!string.IsNullOrEmpty(this.ObjectModified) && string.IsNullOrEmpty(this.ModifiedObjectResolvedName))
            {
                this.ModifiedObjectResolvedName = this.ObjectModified;
            }
        }
        private MailboxAuditLogRecord ReadAuditLogRecord(ObjectId itemId, ExDateTime creationTime, string content)
        {
            MailboxAuditLogRecordId identity          = new MailboxAuditLogRecordId(itemId);
            string mailboxResolvedName                = MailboxAuditLogSearchWorker.ResolveMailboxOwnerName(this.mailboxUser);
            MailboxAuditLogEvent mailboxAuditLogEvent = AuditLogParseSerialize.ParseMailboxAuditRecord(identity, content, mailboxResolvedName, this.mailboxUser.Guid.ToString(), new DateTime?(creationTime.UniversalTime.ToLocalTime()));

            this.ResolveDisplayNames(mailboxAuditLogEvent);
            return(mailboxAuditLogEvent);
        }
示例#3
0
        public override void Apply(MailboxSession session, Item item)
        {
            BodyWriteConfiguration configuration = new BodyWriteConfiguration(BodyFormat.TextPlain);

            using (TextWriter textWriter = item.Body.OpenTextWriter(configuration))
            {
                string asString = AuditLogParseSerialize.GetAsString(this);
                textWriter.Write(asString);
            }
            item.ClassName = "IPM.AuditLog";
        }
示例#4
0
        private static CreateItemType GetCreateItemType(IAuditLogRecord auditRecord, BaseFolderIdType targetFolderId, out int recordSize)
        {
            string asString = AuditLogParseSerialize.GetAsString(auditRecord);
            string text     = string.Format("{0} : {1}", auditRecord.UserId, auditRecord.Operation);
            string text2    = string.Format("{0}{1}", auditRecord.UserId, "audit");
            string text3    = string.Format("{0}{1}", auditRecord.ObjectId, "audit");

            recordSize = Encoding.Unicode.GetByteCount(text) + Encoding.Unicode.GetByteCount(asString) + Encoding.Unicode.GetByteCount(text2) + Encoding.Unicode.GetByteCount(text3);
            return(new CreateItemType
            {
                MessageDisposition = MessageDispositionType.SaveOnly,
                MessageDispositionSpecified = true,
                SavedItemFolderId = new TargetFolderIdType
                {
                    Item = targetFolderId
                },
                Items = new NonEmptyArrayOfAllItemsType
                {
                    Items = new ItemType[]
                    {
                        new MessageType
                        {
                            ItemClass = "IPM.AuditLog",
                            Subject = text,
                            Body = new BodyType
                            {
                                Value = asString,
                                BodyType1 = BodyTypeType.Text
                            },
                            From = new SingleRecipientType
                            {
                                Item = new EmailAddressType
                                {
                                    Name = text2
                                }
                            },
                            ToRecipients = new EmailAddressType[]
                            {
                                new EmailAddressType
                                {
                                    Name = text3
                                }
                            }
                        }
                    }
                }
            });
        }