private void ValidateIsPrimaryOrArchive(MailboxLocationType locationType) { if (locationType != MailboxLocationType.Primary && locationType != MailboxLocationType.MainArchive) { throw new ADOperationException(DirectoryStrings.ExArgumentException("locationType", MailboxLocationType.Primary + ", " + MailboxLocationType.MainArchive)); } }
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); }
// Token: 0x06001D08 RID: 7432 RVA: 0x00078A14 File Offset: 0x00076C14 public MailboxLocationInfo(Guid mailboxGuid, ADObjectId databaseLocation, MailboxLocationType mailboxLocationType) { MailboxLocationInfo.ValidateMailboxInfo(mailboxGuid, databaseLocation); this.MailboxGuid = mailboxGuid; this.databaseLocation = ((databaseLocation != null) ? new ADObjectId(databaseLocation.ObjectGuid, databaseLocation.PartitionFQDN) : null); this.MailboxLocationType = mailboxLocationType; this.infoToString = null; }
public IMailboxLocationInfo GetMailboxLocation(MailboxLocationType mailboxLocationType) { if (MailboxLocationCollection.NonSingletonMailboxLocationType.Contains(mailboxLocationType)) { throw new MailboxLocationException(DirectoryStrings.ErrorNonUniqueMailboxGetMailboxLocation(mailboxLocationType.ToString())); } if (this.mailboxTypeCount[(int)mailboxLocationType] == 0) { return(null); } IList <IMailboxLocationInfo> mailboxLocations = this.GetMailboxLocations(mailboxLocationType); if (mailboxLocations.Count != 0) { return(mailboxLocations[0]); } return(null); }
public IList <IMailboxLocationInfo> GetMailboxLocations(MailboxLocationType mailboxLocationType) { IList <IMailboxLocationInfo> list = new List <IMailboxLocationInfo>(); if (mailboxLocationType == MailboxLocationType.Primary || mailboxLocationType == MailboxLocationType.MainArchive) { IMailboxLocationInfo primaryOrArchiveMailboxInfo = this.GetPrimaryOrArchiveMailboxInfo(mailboxLocationType); if (primaryOrArchiveMailboxInfo != null) { list.Add(primaryOrArchiveMailboxInfo); } } else { foreach (IMailboxLocationInfo mailboxLocationInfo in this.mailboxInfo.Values) { if (mailboxLocationInfo.MailboxLocationType == mailboxLocationType) { list.Add(mailboxLocationInfo); } } } return(list); }
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); }
public void AddMailboxLocation(Guid mailboxGuid, ADObjectId databaseLocation, MailboxLocationType mailboxLocationType) { IMailboxLocationInfo mailboxLocation = new MailboxLocationInfo(mailboxGuid, databaseLocation, mailboxLocationType); this.AddMailboxLocation(mailboxLocation); }