public override IConfigurable Read <T>(ObjectId identity)
            {
                AuditLogSearchId auditLogSearchId = identity as AuditLogSearchId;

                if (auditLogSearchId != null)
                {
                    SearchFilter filter = new SearchFilter.IsEqualTo(AuditLogSearchBaseEwsSchema.Identity.StorePropertyDefinition, auditLogSearchId.Guid.ToString());
                    using (IEnumerator <AdminAuditLogSearch> enumerator = this.FindInFolder <AdminAuditLogSearch>(filter, this.GetDefaultFolder()).GetEnumerator())
                    {
                        if (enumerator.MoveNext())
                        {
                            AdminAuditLogSearch adminAuditLogSearch  = enumerator.Current;
                            AdminAuditLogSearch adminAuditLogSearch2 = new AdminAuditLogSearch();
                            adminAuditLogSearch2.SetId(adminAuditLogSearch.Identity);
                            adminAuditLogSearch2.Name                 = adminAuditLogSearch.Name;
                            adminAuditLogSearch2.StartDateUtc         = new DateTime?(adminAuditLogSearch.StartDateUtc.Value);
                            adminAuditLogSearch2.EndDateUtc           = new DateTime?(adminAuditLogSearch.EndDateUtc.Value);
                            adminAuditLogSearch2.StatusMailRecipients = NewAuditLogSearchBase <AdminAuditLogSearch> .GetMultiValuedStringsAsSmptAddresses(adminAuditLogSearch.StatusMailRecipients);

                            adminAuditLogSearch2.CreatedBy   = adminAuditLogSearch.CreatedBy;
                            adminAuditLogSearch2.CreatedByEx = adminAuditLogSearch.CreatedByEx;
                            adminAuditLogSearch2.Cmdlets     = adminAuditLogSearch.Cmdlets;
                            adminAuditLogSearch2.Parameters  = adminAuditLogSearch.Parameters;
                            adminAuditLogSearch2.ObjectIds   = adminAuditLogSearch.ObjectIds;
                            bool value;
                            if (!string.IsNullOrEmpty(adminAuditLogSearch.ExternalAccess) && bool.TryParse(adminAuditLogSearch.ExternalAccess, out value))
                            {
                                adminAuditLogSearch2.ExternalAccess = new bool?(value);
                            }
                            adminAuditLogSearch2.UserIds       = adminAuditLogSearch.UserIds;
                            adminAuditLogSearch2.ResolvedUsers = adminAuditLogSearch.ResolvedUsers;
                            return(adminAuditLogSearch2);
                        }
                    }
                }
                return(null);
            }
Esempio n. 2
0
            public override IConfigurable Read <T>(ObjectId identity)
            {
                AuditLogSearchId auditLogSearchId = identity as AuditLogSearchId;

                if (auditLogSearchId != null)
                {
                    SearchFilter filter = new SearchFilter.IsEqualTo(AuditLogSearchBaseEwsSchema.Identity.StorePropertyDefinition, auditLogSearchId.Guid.ToString());
                    using (IEnumerator <MailboxAuditLogSearch> enumerator = this.FindInFolder <MailboxAuditLogSearch>(filter, this.GetDefaultFolder()).GetEnumerator())
                    {
                        if (enumerator.MoveNext())
                        {
                            MailboxAuditLogSearch mailboxAuditLogSearch  = enumerator.Current;
                            MailboxAuditLogSearch mailboxAuditLogSearch2 = new MailboxAuditLogSearch();
                            mailboxAuditLogSearch2.SetId(mailboxAuditLogSearch.Identity);
                            mailboxAuditLogSearch2.Name                 = mailboxAuditLogSearch.Name;
                            mailboxAuditLogSearch2.StartDateUtc         = new DateTime?(mailboxAuditLogSearch.StartDateUtc.Value);
                            mailboxAuditLogSearch2.EndDateUtc           = new DateTime?(mailboxAuditLogSearch.EndDateUtc.Value);
                            mailboxAuditLogSearch2.StatusMailRecipients = NewAuditLogSearchBase <MailboxAuditLogSearch> .GetMultiValuedStringsAsSmptAddresses(mailboxAuditLogSearch.StatusMailRecipients);

                            mailboxAuditLogSearch2.CreatedBy   = mailboxAuditLogSearch.CreatedBy;
                            mailboxAuditLogSearch2.CreatedByEx = mailboxAuditLogSearch.CreatedByEx;
                            mailboxAuditLogSearch2.Mailboxes   = mailboxAuditLogSearch.Mailboxes;
                            mailboxAuditLogSearch2.LogonTypes  = mailboxAuditLogSearch.LogonTypes;
                            mailboxAuditLogSearch2.Operations  = mailboxAuditLogSearch.Operations;
                            mailboxAuditLogSearch2.ShowDetails = (mailboxAuditLogSearch.ShowDetails != null && mailboxAuditLogSearch.ShowDetails.Value);
                            bool value;
                            if (!string.IsNullOrEmpty(mailboxAuditLogSearch.ExternalAccess) && bool.TryParse(mailboxAuditLogSearch.ExternalAccess, out value))
                            {
                                mailboxAuditLogSearch2.ExternalAccess = new bool?(value);
                            }
                            return(mailboxAuditLogSearch2);
                        }
                    }
                }
                return(null);
            }