protected override void InternalValidate()
        {
            base.InternalValidate();
            this.policyObject = HygieneUtils.ResolvePolicyObject <MalwareFilterPolicy>(this, this.ConfigurationSession, this.MalwareFilterPolicy);
            TransportRule transportRule = HygieneUtils.ResolvePolicyRuleObject <MalwareFilterPolicy>(this.policyObject, this.ConfigurationSession, this.ruleCollectionName);

            if (transportRule != null)
            {
                base.WriteError(new OperationNotAllowedException(Strings.ErrorPolicyRuleExists(this.policyObject.Name, transportRule.Name)), ErrorCategory.InvalidOperation, null);
            }
            if (this.policyObject != null && this.policyObject.IsDefault)
            {
                base.WriteError(new OperationNotAllowedException(Strings.ErrorDefaultPolicyCannotHaveRule(this.policyObject.Name)), ErrorCategory.InvalidOperation, null);
            }
        }
 protected override void InternalValidate()
 {
     base.InternalValidate();
     if (this.HostedContentFilterPolicy != null)
     {
         this.policyObject          = HygieneUtils.ResolvePolicyObject <HostedContentFilterPolicy>(this, base.DataSession, this.HostedContentFilterPolicy);
         this.effectivePolicyObject = this.policyObject;
         TransportRule transportRule = HygieneUtils.ResolvePolicyRuleObject <HostedContentFilterPolicy>((HostedContentFilterPolicy)this.policyObject, base.DataSession, this.ruleCollectionName);
         if (transportRule != null)
         {
             base.WriteError(new OperationNotAllowedException(Strings.ErrorPolicyRuleExists(this.policyObject.Name, transportRule.Name)), ErrorCategory.InvalidOperation, null);
         }
         if (this.policyObject != null && ((HostedContentFilterPolicy)this.policyObject).IsDefault)
         {
             base.WriteError(new OperationNotAllowedException(Strings.ErrorDefaultPolicyCannotHaveRule(this.policyObject.Name)), ErrorCategory.InvalidOperation, null);
             return;
         }
     }
     else
     {
         HostedContentFilterRule hostedContentFilterRule = HostedContentFilterRule.CreateFromInternalRule((TransportRule)TransportRuleParser.Instance.GetRule(this.DataObject.Xml), -1, this.DataObject);
         this.effectivePolicyObject = HygieneUtils.ResolvePolicyObject <HostedContentFilterPolicy>(this, base.DataSession, hostedContentFilterRule.HostedContentFilterPolicy);
     }
 }