protected override void InternalProcessRecord()
        {
            MalwareFilterRule malwareFilterRule = new MalwareFilterRule(null, base.Name, base.Priority, base.Enabled ? RuleState.Enabled : RuleState.Disabled, base.Comments, base.Conditions, base.Exceptions, new MalwareFilterPolicyIdParameter(this.policyObject.Name));
            int           priority      = base.Fields.IsModified("Priority") ? malwareFilterRule.Priority : -1;
            TransportRule transportRule = null;

            try
            {
                TransportRule        rule = malwareFilterRule.ToInternalRule();
                ADRuleStorageManager adruleStorageManager = new ADRuleStorageManager(this.ruleCollectionName, base.DataSession);
                adruleStorageManager.LoadRuleCollection();
                adruleStorageManager.NewRule(rule, this.ResolveCurrentOrganization(), ref priority, out transportRule);
            }
            catch (RulesValidationException exception)
            {
                base.WriteError(exception, ErrorCategory.InvalidArgument, base.Name);
            }
            catch (InvalidPriorityException exception2)
            {
                base.WriteError(exception2, ErrorCategory.InvalidArgument, null);
            }
            catch (ParserException exception3)
            {
                base.WriteError(exception3, ErrorCategory.InvalidData, null);
            }
            malwareFilterRule.Priority = priority;
            malwareFilterRule.SetTransportRule(transportRule);
            base.WriteObject(malwareFilterRule);
        }
        internal override IConfigurable CreateTaskRuleFromInternalRule(TransportRule rule, int priority, TransportRule transportRule)
        {
            MalwareFilterRule result;

            try
            {
                result = MalwareFilterRule.CreateFromInternalRule(rule, priority, transportRule);
            }
            catch (CorruptFilterRuleException ex)
            {
                result = MalwareFilterRule.CreateCorruptRule(priority, transportRule, ex.LocalizedString);
            }
            return(result);
        }
 internal override IConfigurable CreateCorruptTaskRule(int priority, TransportRule transportRule, string errorMessage)
 {
     return(MalwareFilterRule.CreateCorruptRule(priority, transportRule, Strings.CorruptRule(transportRule.Name, errorMessage)));
 }