protected override void InternalProcessRecord() { TaskLogger.LogEnter(); ADUser dataObject = this.DataObject; IMailboxLocationCollection mailboxLocations = dataObject.MailboxLocations; if (this.AuxArchive) { IMailboxLocationInfo mailboxLocation = mailboxLocations.GetMailboxLocation(MailboxLocationType.MainArchive); mailboxLocations.AddMailboxLocation(Guid.NewGuid(), mailboxLocation.DatabaseLocation, MailboxLocationType.AuxArchive); } else if (this.AuxPrimary) { mailboxLocations.AddMailboxLocation(Guid.NewGuid(), dataObject.Database, MailboxLocationType.AuxPrimary); } base.InternalProcessRecord(); this.WriteResult(); TaskLogger.LogExit(); }
protected override void InternalValidate() { TaskLogger.LogEnter(); base.InternalValidate(); IMailboxLocationCollection mailboxLocations = this.DataObject.MailboxLocations; if (this.AuxArchive) { if (mailboxLocations.GetMailboxLocation(MailboxLocationType.MainArchive) == null) { base.WriteError(new RecipientTaskException(Strings.ErrorMailboxHasNoArchive(this.Identity.ToString())), ExchangeErrorCategory.Client, null); } } else if (this.AuxPrimary && this.DataObject.RecipientTypeDetails != RecipientTypeDetails.AuditLogMailbox) { base.WriteError(new RecipientTaskException(Strings.ErrorMailboxIsNotAudit(this.Identity.ToString())), ExchangeErrorCategory.Client, null); } TaskLogger.LogExit(); }
public override bool Equals(object obj) { IMailboxLocationCollection mailboxLocationCollection = obj as IMailboxLocationCollection; if (mailboxLocationCollection == null) { return(false); } IList <IMailboxLocationInfo> mailboxLocations = mailboxLocationCollection.GetMailboxLocations(); IDictionary <Guid, IMailboxLocationInfo> locationsAsDictionary = this.GetLocationsAsDictionary(); if (locationsAsDictionary.Count != mailboxLocations.Count) { return(false); } foreach (IMailboxLocationInfo mailboxLocationInfo in mailboxLocations) { if (!locationsAsDictionary.ContainsKey(mailboxLocationInfo.MailboxGuid) || !locationsAsDictionary[mailboxLocationInfo.MailboxGuid].Equals(mailboxLocationInfo)) { return(false); } } return(true); }