protected void SwitchUser(UserInformation userInformation, bool isFolderSyncNeeded)
{
this.ASAIRSAdapter.SwitchUser(userInformation.UserName, userInformation.UserPassword, userInformation.UserDomain);
if (isFolderSyncNeeded)
{
FolderSyncResponse folderSyncResponse = this.FolderSync();
// Get the folder collectionId of User1
if (userInformation.UserName == this.User1Information.UserName)
{
if (string.IsNullOrEmpty(this.User1Information.InboxCollectionId))
{
this.User1Information.InboxCollectionId = Common.GetDefaultFolderServerId(folderSyncResponse, FolderType.Inbox, this.Site);
}
if (string.IsNullOrEmpty(this.User1Information.ContactsCollectionId))
{
this.User1Information.ContactsCollectionId = Common.GetDefaultFolderServerId(folderSyncResponse, FolderType.Contacts, this.Site);
}
if (string.IsNullOrEmpty(this.User1Information.CalendarCollectionId))
{
this.User1Information.CalendarCollectionId = Common.GetDefaultFolderServerId(folderSyncResponse, FolderType.Calendar, this.Site);
}
}
// Get the folder collectionId of User2
if (userInformation.UserName == this.User2Information.UserName)
{
if (string.IsNullOrEmpty(this.User2Information.InboxCollectionId))
{
this.User2Information.InboxCollectionId = Common.GetDefaultFolderServerId(folderSyncResponse, FolderType.Inbox, this.Site);
}
if (string.IsNullOrEmpty(this.User2Information.CalendarCollectionId))
{
this.User2Information.CalendarCollectionId = Common.GetDefaultFolderServerId(folderSyncResponse, FolderType.Calendar, this.Site);
}
}
}
}
#endregion