Exemple #1
0
        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();
        }
Exemple #2
0
        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();
        }
Exemple #3
0
        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);
        }