Пример #1
0
        private void MergeDefaultMailTipIntoTranslation(TPublicObject dynamicParametersInstance)
        {
            string defaultMailTipTranslation = SetMailEnabledRecipientObjectTask <TIdentity, TPublicObject, TDataObject> .GetDefaultMailTipTranslation(dynamicParametersInstance.MailTip);

            if (dynamicParametersInstance.MailTipTranslations == null)
            {
                dynamicParametersInstance.MailTipTranslations = new MultiValuedProperty <string>(defaultMailTipTranslation);
                return;
            }
            dynamicParametersInstance.MailTipTranslations.Add(defaultMailTipTranslation);
        }
Пример #2
0
        protected override void ResolveLocalSecondaryIdentities()
        {
            base.ResolveLocalSecondaryIdentities();
            TPublicObject tpublicObject = (TPublicObject)((object)this.GetDynamicParameters());

            this.SetMultiReferenceParameter <DeliveryRecipientIdParameter>(ADRecipientSchema.AcceptMessagesOnlyFrom, this.AcceptMessagesOnlyFrom, tpublicObject, new GetRecipientDelegate <DeliveryRecipientIdParameter>(this.GetRecipient), new ValidateRecipientDelegate(this.ValidateMessageDeliveryRestrictionIndividual));
            this.SetMultiReferenceParameter <DeliveryRecipientIdParameter>(ADRecipientSchema.AcceptMessagesOnlyFromDLMembers, this.AcceptMessagesOnlyFromDLMembers, tpublicObject, new GetRecipientDelegate <DeliveryRecipientIdParameter>(this.GetRecipient), new ValidateRecipientDelegate(this.ValidateMessageDeliveryRestrictionGroup));
            if (base.Fields.IsModified(ADRecipientSchema.AcceptMessagesOnlyFromSendersOrMembers))
            {
                tpublicObject.AcceptMessagesOnlyFrom.Clear();
                tpublicObject.AcceptMessagesOnlyFromDLMembers.Clear();
                if (this.AcceptMessagesOnlyFromSendersOrMembers != null)
                {
                    MultiValuedProperty <ADObjectId> multiValuedProperty;
                    MultiValuedProperty <ADObjectId> multiValuedProperty2;
                    SetMailEnabledRecipientObjectTask <TIdentity, TPublicObject, TDataObject> .ResolveAndSeparateMessageDeliveryRestrictionRecipientIdentities(this.AcceptMessagesOnlyFromSendersOrMembers, "AcceptMessagesOnlyFromSendersOrMembers", base.TenantGlobalCatalogSession, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADRecipient>), new Task.ErrorLoggerDelegate(base.WriteError), out multiValuedProperty, out multiValuedProperty2);

                    if (multiValuedProperty != null)
                    {
                        tpublicObject.AcceptMessagesOnlyFromDLMembers = multiValuedProperty;
                    }
                    if (multiValuedProperty2 != null)
                    {
                        tpublicObject.AcceptMessagesOnlyFrom = multiValuedProperty2;
                    }
                }
            }
            this.SetMultiReferenceParameter <DeliveryRecipientIdParameter>(ADRecipientSchema.RejectMessagesFrom, this.RejectMessagesFrom, tpublicObject, new GetRecipientDelegate <DeliveryRecipientIdParameter>(this.GetRecipient), new ValidateRecipientDelegate(this.ValidateMessageDeliveryRestrictionIndividual));
            this.SetMultiReferenceParameter <DeliveryRecipientIdParameter>(ADRecipientSchema.RejectMessagesFromDLMembers, this.RejectMessagesFromDLMembers, tpublicObject, new GetRecipientDelegate <DeliveryRecipientIdParameter>(this.GetRecipient), new ValidateRecipientDelegate(this.ValidateMessageDeliveryRestrictionGroup));
            if (base.Fields.IsModified(ADRecipientSchema.RejectMessagesFromSendersOrMembers))
            {
                tpublicObject.RejectMessagesFrom.Clear();
                tpublicObject.RejectMessagesFromDLMembers.Clear();
                if (this.RejectMessagesFromSendersOrMembers != null)
                {
                    MultiValuedProperty <ADObjectId> multiValuedProperty3;
                    MultiValuedProperty <ADObjectId> multiValuedProperty4;
                    SetMailEnabledRecipientObjectTask <TIdentity, TPublicObject, TDataObject> .ResolveAndSeparateMessageDeliveryRestrictionRecipientIdentities(this.RejectMessagesFromSendersOrMembers, "RejectMessagesFromSendersOrMembers", base.TenantGlobalCatalogSession, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADRecipient>), new Task.ErrorLoggerDelegate(base.WriteError), out multiValuedProperty3, out multiValuedProperty4);

                    if (multiValuedProperty3 != null)
                    {
                        tpublicObject.RejectMessagesFromDLMembers = multiValuedProperty3;
                    }
                    if (multiValuedProperty4 != null)
                    {
                        tpublicObject.RejectMessagesFrom = multiValuedProperty4;
                    }
                }
            }
            if (base.Fields.IsModified(ADRecipientSchema.BypassModerationFromSendersOrMembers))
            {
                tpublicObject.BypassModerationFrom.Clear();
                tpublicObject.BypassModerationFromDLMembers.Clear();
                if (this.BypassModerationFromSendersOrMembers != null)
                {
                    MultiValuedProperty <ADObjectId> multiValuedProperty5;
                    MultiValuedProperty <ADObjectId> multiValuedProperty6;
                    SetMailEnabledRecipientObjectTask <TIdentity, TPublicObject, TDataObject> .ResolveAndSeparateMessageDeliveryRestrictionRecipientIdentities(this.BypassModerationFromSendersOrMembers, "BypassModerationFromSendersOrMembers", base.TenantGlobalCatalogSession, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADRecipient>), new Task.ErrorLoggerDelegate(base.WriteError), out multiValuedProperty5, out multiValuedProperty6);

                    if (multiValuedProperty5 != null)
                    {
                        tpublicObject.BypassModerationFromDLMembers = multiValuedProperty5;
                    }
                    if (multiValuedProperty6 != null)
                    {
                        tpublicObject.BypassModerationFrom = multiValuedProperty6;
                    }
                }
            }
            this.SetMultiReferenceParameter <RecipientIdParameter>(ADRecipientSchema.GrantSendOnBehalfTo, this.GrantSendOnBehalfTo, tpublicObject, new GetRecipientDelegate <RecipientIdParameter>(this.GetRecipient), new ValidateRecipientDelegate(this.ValidateGrantSendOnBehalfTo));
            if (tpublicObject.IsChanged(ADRecipientSchema.PrimarySmtpAddress) && tpublicObject.IsChanged(ADRecipientSchema.WindowsEmailAddress) && tpublicObject.PrimarySmtpAddress != tpublicObject.WindowsEmailAddress)
            {
                base.ThrowTerminatingError(new TaskArgumentException(Strings.ErrorPrimarySmtpAndWindowsAddressDifferent), ExchangeErrorCategory.Client, null);
            }
            if (base.Fields.Contains(ADRecipientSchema.ModeratedBy))
            {
                MultiValuedProperty <ModeratorIDParameter> multiValuedProperty7 = (MultiValuedProperty <ModeratorIDParameter>)base.Fields[ADRecipientSchema.ModeratedBy];
                if (multiValuedProperty7 != null && multiValuedProperty7.Count > 25)
                {
                    base.WriteError(new RecipientTaskException(Strings.ErrorTooManyModerators(25)), ExchangeErrorCategory.Client, null);
                }
                this.SetMultiReferenceParameter <ModeratorIDParameter>(ADRecipientSchema.ModeratedBy, this.ModeratedBy, tpublicObject, new GetRecipientDelegate <ModeratorIDParameter>(this.GetRecipient), new ValidateRecipientDelegate(RecipientTaskHelper.ValidateModeratedBy));
            }
            if (this.ArbitrationMailbox != null)
            {
                this.arbitrationMbx = (ADRecipient)base.GetDataObject <ADRecipient>(this.ArbitrationMailbox, base.TenantGlobalCatalogSession, null, new LocalizedString?(Strings.ErrorMailboxNotFound(this.ArbitrationMailbox.ToString())), new LocalizedString?(Strings.ErrorMailboxNotUnique(this.ArbitrationMailbox.ToString())), ExchangeErrorCategory.Client);
                if (MultiValuedPropertyBase.IsNullOrEmpty((ADMultiValuedProperty <ADObjectId>) this.arbitrationMbx[ADUserSchema.ApprovalApplications]))
                {
                    base.ThrowTerminatingError(new RecipientTaskException(Strings.ErrorInvalidArbitrationMbxTypeForModerationAndAutogroup(this.arbitrationMbx.Identity.ToString())), ExchangeErrorCategory.Client, null);
                }
                if (this.arbitrationMbx.RecipientTypeDetails != RecipientTypeDetails.ArbitrationMailbox)
                {
                    base.ThrowTerminatingError(new RecipientTaskException(Strings.ErrorInvalidArbitrationMbxType(this.ArbitrationMailbox.ToString())), ExchangeErrorCategory.Client, null);
                }
            }
        }