예제 #1
0
        protected override void InternalValidate()
        {
            base.InternalValidate();
            if (this.DataObject.IsDefault)
            {
                this.existingDefaultPolicies = DefaultMobileMailboxPolicyUtility <MobileMailboxPolicy> .GetDefaultPolicies((IConfigurationSession)base.DataSession);

                if (this.existingDefaultPolicies.Count > 0)
                {
                    this.updateExistingDefaultPolicies = true;
                }
            }
            if (!DefaultMobileMailboxPolicyUtility <MobileMailboxPolicy> .ValidateLength(this.DataObject.UnapprovedInROMApplicationList, 5120, 2048))
            {
                base.WriteError(new ArgumentException(Strings.MobileDevicePolicyApplicationListTooLong(5120, 2048), "UnapprovedInROMApplicationList"), ErrorCategory.InvalidArgument, this.DataObject.Identity);
            }
            if (!DefaultMobileMailboxPolicyUtility <MobileMailboxPolicy> .ValidateLength(this.DataObject.ApprovedApplicationList, 7168, 2048))
            {
                base.WriteError(new ArgumentException(Strings.MobileDevicePolicyApplicationListTooLong(7168, 2048), "ApprovedApplicationList"), ErrorCategory.InvalidArgument, this.DataObject.Identity);
            }
        }
        protected override void InternalValidate()
        {
            base.InternalValidate();
            if (this.DataObject.IsDefault)
            {
                QueryFilter extraFilter = new ComparisonFilter(ComparisonOperator.NotEqual, ADObjectSchema.Guid, this.DataObject.Id.ObjectGuid);
                this.otherDefaultPolicies = DefaultMobileMailboxPolicyUtility <ActiveSyncMailboxPolicy> .GetDefaultPolicies((IConfigurationSession)base.DataSession, extraFilter);

                if (this.otherDefaultPolicies.Count > 0)
                {
                    this.updateOtherDefaultPolicies = true;
                }
            }
            if (!DefaultMobileMailboxPolicyUtility <ActiveSyncMailboxPolicy> .ValidateLength(this.DataObject.UnapprovedInROMApplicationList, 5120, 2048))
            {
                base.WriteError(new ArgumentException(Strings.ActiveSyncPolicyApplicationListTooLong(5120, 2048), "UnapprovedInROMApplicationList"), ErrorCategory.InvalidArgument, this.DataObject.Identity);
            }
            if (!DefaultMobileMailboxPolicyUtility <ActiveSyncMailboxPolicy> .ValidateLength(this.DataObject.ApprovedApplicationList, 7168, 2048))
            {
                base.WriteError(new ArgumentException(Strings.ActiveSyncPolicyApplicationListTooLong(7168, 2048), "ApprovedApplicationList"), ErrorCategory.InvalidArgument, this.DataObject.Identity);
            }
        }