internal static MailboxLocator Convert(MailboxLocatorType locatorType, IRecipientSession adSession) { ArgumentValidator.ThrowIfNull("locatorType", locatorType); ArgumentValidator.ThrowIfNull("adSession", adSession); GroupLocatorType groupLocatorType = locatorType as GroupLocatorType; if (groupLocatorType != null) { return(EwsAssociationDataConverter.Convert(groupLocatorType, adSession)); } UserLocatorType userLocatorType = locatorType as UserLocatorType; if (userLocatorType != null) { return(EwsAssociationDataConverter.Convert(userLocatorType, adSession)); } throw new InvalidOperationException("Unsupported type of Mailbox Locator"); }
internal static UserMailboxLocator Convert(UserLocatorType locatorType, IRecipientSession adSession) { ArgumentValidator.ThrowIfNull("locatorType", locatorType); ArgumentValidator.ThrowIfNull("adSession", adSession); return(new UserMailboxLocator(adSession, locatorType.ExternalDirectoryObjectId, locatorType.LegacyDn)); }