// Token: 0x06000C32 RID: 3122 RVA: 0x00026710 File Offset: 0x00024910 IEnumerable <T> IIdentityParameter.GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason) { if (session == null) { throw new ArgumentNullException("session"); } if (null == this.InternalMessageCategoryId) { throw new InvalidOperationException(Strings.ErrorOperationOnInvalidObject); } MessageCategoryDataProvider messageCategoryDataProvider = session as MessageCategoryDataProvider; if (messageCategoryDataProvider == null) { throw new NotSupportedException("DataProvider: " + session.GetType().FullName); } IConfigurable[] array = messageCategoryDataProvider.Find <T>(null, this.InternalMessageCategoryId, false, null); if (array == null || array.Length == 0) { notFoundReason = new LocalizedString?(Strings.ErrorManagementObjectNotFound(this.ToString())); return(new T[0]); } notFoundReason = null; T[] array2 = new T[array.Length]; int num = 0; foreach (IConfigurable configurable in array) { array2[num++] = (T)((object)configurable); } return(array2); }
protected override IConfigDataProvider CreateSession() { IRecipientSession tenantGlobalCatalogSession = base.TenantGlobalCatalogSession; MailboxIdParameter mailboxIdParameter = null; if (this.Identity != null) { if (this.Identity.InternalMessageCategoryId != null) { mailboxIdParameter = new MailboxIdParameter(this.Identity.InternalMessageCategoryId.MailboxOwnerId); } else { mailboxIdParameter = this.Identity.RawMailbox; } } if (mailboxIdParameter != null && this.Mailbox != null) { base.WriteError(new InvalidOperationException(Strings.ErrorConflictingMailboxes), ErrorCategory.InvalidArgument, this.Identity); } if (mailboxIdParameter == null) { ADObjectId executingUserId; base.TryGetExecutingUserId(out executingUserId); mailboxIdParameter = (this.Mailbox ?? MailboxTaskHelper.ResolveMailboxIdentity(executingUserId, new Task.ErrorLoggerDelegate(base.WriteError))); } ADUser aduser = (ADUser)base.GetDataObject <ADUser>(mailboxIdParameter, tenantGlobalCatalogSession, null, new LocalizedString?(Strings.ErrorMailboxNotFound(mailboxIdParameter.ToString())), new LocalizedString?(Strings.ErrorMailboxNotUnique(mailboxIdParameter.ToString()))); if (this.Identity != null && this.Identity.InternalMessageCategoryId == null) { this.Identity.InternalMessageCategoryId = new MessageCategoryId(aduser.Id, this.Identity.RawCategoryName, this.Identity.RawCategoryId); } base.VerifyIsWithinScopes(tenantGlobalCatalogSession, aduser, true, new DataAccessTask <MessageCategory> .ADObjectOutOfScopeString(Strings.ErrorCannotChangeMailboxOutOfWriteScope)); Exception ex = null; ExchangeErrorCategory category = (ExchangeErrorCategory)0; MessageCategoryDataProvider result = null; try { result = new MessageCategoryDataProvider(base.SessionSettings, aduser, "Get-MessageCategory"); } catch (MapiPermanentException ex2) { ex = ex2; category = ExchangeErrorCategory.ServerOperation; } catch (MapiRetryableException ex3) { ex = ex3; category = ExchangeErrorCategory.ServerTransient; } if (ex != null) { base.WriteError(new InvalidOperationException(Strings.ErrorUnableToAccessMessageCategoriesGenericMessage(ex.Message), ex), (ErrorCategory)category, aduser.Identity); } return(result); }