private void AddPrimaryOrArchiveMailboxInfo(IMailboxLocationInfo locationInfo) { this.ValidateIsPrimaryOrArchive(locationInfo.MailboxLocationType); if (this.propertyBag == null) { this.newArchiveAndExchangeInfo.Add(locationInfo); return; } if (locationInfo.MailboxLocationType == MailboxLocationType.Primary) { this.propertyBag[IADMailStorageSchema.ExchangeGuid] = locationInfo.MailboxGuid; this.propertyBag[IADMailStorageSchema.Database] = locationInfo.DatabaseLocation; return; } this.propertyBag[IADMailStorageSchema.ArchiveGuid] = locationInfo.MailboxGuid; ADRecipient.ArchiveDatabaseSetter(locationInfo.DatabaseLocation, this.propertyBag); }
private void RemovePrimaryOrArchiveMailboxInfo(MailboxLocationType mailboxLocationType) { this.ValidateIsPrimaryOrArchive(mailboxLocationType); if (this.propertyBag == null) { for (int i = 0; i < this.newArchiveAndExchangeInfo.Count; i++) { if (this.newArchiveAndExchangeInfo[i].MailboxLocationType == mailboxLocationType) { this.newArchiveAndExchangeInfo.RemoveAt(i); return; } } return; } if (mailboxLocationType == MailboxLocationType.Primary) { this.propertyBag[IADMailStorageSchema.ExchangeGuid] = null; this.propertyBag[IADMailStorageSchema.Database] = null; return; } this.propertyBag[IADMailStorageSchema.ArchiveGuid] = null; ADRecipient.ArchiveDatabaseSetter(null, this.propertyBag); }