Rule Class
Represents a condition (an HTML tag name and a set of its attributes) and an action to perform when the condition is met.
Inheritance Hierarchy
SystemObject
  MailBee.HtmlRule

Namespace: MailBee.Html
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public class Rule

The Rule type exposes the following members.

Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyRuleType
Gets the type of the action to perform when processing HTML tags which match the rule condition.
Public propertyTagAttributes
Gets the list of attributes any of which must exist in the tag definiton in order to satisfy the rule condition for TagName tag.
Public propertyTagName
Gets the name of the HTML tag for which to apply the rule.
Top
Remarks

A rule specifies for which tag to apply a certain action. The rule can additionally specify that only tags with certain attributes should be processed (for instance, <A> tags with HREF attributes).

The actions can be pre-defined or user-defined (see TagRuleTypes). To implement user-defined action, create a method of ProcessElementDelegate type and pass a reference to it when calling Process(RuleSet, ProcessElementDelegate) or ProcessToString(RuleSet, ProcessElementDelegate) method.

To define rules, use RuleSet object methods.

To define a set of rules which tells Process(RuleSet, ProcessElementDelegate) method to remove any ponentially unsafe contents from the HTML document, use GetSafeHtmlRules method.

Note Note
A rule, once created and added to the RuleSet, cannot be changed. You can, however, remove an existing rule from the RuleSet and add anonther one.
See Also