예제 #1
0
 private IMailboxLocationInfo GetPrimaryOrArchiveMailboxInfo(MailboxLocationType locationType)
 {
     this.ValidateIsPrimaryOrArchive(locationType);
     if (this.propertyBag != null)
     {
         if (locationType == MailboxLocationType.Primary)
         {
             if (this.propertyBag[IADMailStorageSchema.ExchangeGuid] != null && !((Guid)this.propertyBag[IADMailStorageSchema.ExchangeGuid]).Equals(Guid.Empty))
             {
                 return(new MailboxLocationInfo((Guid)this.propertyBag[IADMailStorageSchema.ExchangeGuid], (ADObjectId)this.propertyBag[IADMailStorageSchema.Database], MailboxLocationType.Primary));
             }
         }
         else if (this.propertyBag[IADMailStorageSchema.ArchiveGuid] != null && !((Guid)this.propertyBag[IADMailStorageSchema.ArchiveGuid]).Equals(Guid.Empty))
         {
             return(new MailboxLocationInfo((Guid)this.propertyBag[IADMailStorageSchema.ArchiveGuid], (ADObjectId)ADRecipient.ArchiveDatabaseGetter(this.propertyBag), MailboxLocationType.MainArchive));
         }
     }
     else
     {
         foreach (IMailboxLocationInfo mailboxLocationInfo in this.newArchiveAndExchangeInfo)
         {
             if (mailboxLocationInfo.MailboxLocationType == locationType)
             {
                 return(mailboxLocationInfo);
             }
         }
     }
     return(null);
 }