internal AADDirectoryObjectPresentationObject(DirectoryObject directoryObject) : base(new SimpleProviderPropertyBag()) { base.SetExchangeVersion(ExchangeObjectVersion.Exchange2012); AADDirectoryObjectPresentationObject[] members; if (directoryObject.members == null) { members = null; } else { members = (from member in directoryObject.members select AADPresentationObjectFactory.Create(member)).ToArray <AADDirectoryObjectPresentationObject>(); } this.Members = members; this.ObjectId = directoryObject.objectId; this.ObjectType = directoryObject.objectType; AADDirectoryObjectPresentationObject[] owners; if (directoryObject.owners == null) { owners = null; } else { owners = (from owner in directoryObject.owners select AADPresentationObjectFactory.Create(owner)).ToArray <AADDirectoryObjectPresentationObject>(); } this.Owners = owners; }
internal AADGroupPresentationObject(Group group) : base(group) { AADDirectoryObjectPresentationObject[] allowAccessTo; if (group.allowAccessTo == null) { allowAccessTo = null; } else { allowAccessTo = (from directoryObject in @group.allowAccessTo select AADPresentationObjectFactory.Create(directoryObject)).ToArray <AADDirectoryObjectPresentationObject>(); } this.AllowAccessTo = allowAccessTo; this.Description = group.description; this.DisplayName = group.displayName; this.ExchangeResources = ((group.exchangeResources != null) ? group.exchangeResources.ToArray <string>() : null); this.GroupType = group.groupType; this.IsPublic = group.isPublic; this.Mail = group.mail; this.MailEnabled = group.mailEnabled; AADDirectoryObjectPresentationObject[] pendingMembers; if (group.pendingMembers == null) { pendingMembers = null; } else { pendingMembers = (from directoryObject in @group.pendingMembers select AADPresentationObjectFactory.Create(directoryObject)).ToArray <AADDirectoryObjectPresentationObject>(); } this.PendingMembers = pendingMembers; this.ProxyAddresses = ((group.proxyAddresses != null) ? group.proxyAddresses.ToArray <string>() : null); this.SecurityEnabled = group.securityEnabled; this.SharePointResources = ((group.sharepointResources != null) ? group.sharepointResources.ToArray <string>() : null); }