예제 #1
0
        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");
        }
예제 #2
0
 internal static GroupMailboxLocator Convert(GroupLocatorType locatorType, IRecipientSession adSession)
 {
     ArgumentValidator.ThrowIfNull("locatorType", locatorType);
     ArgumentValidator.ThrowIfNull("adSession", adSession);
     return(new GroupMailboxLocator(adSession, locatorType.ExternalDirectoryObjectId, locatorType.LegacyDn));
 }