Rule Class |
Namespace: MailBee.Html
The Rule type exposes the following members.
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
RuleType |
Gets the type of the action to perform when processing HTML tags which match the rule condition.
| |
TagAttributes |
Gets the list of attributes any of which must exist in the tag definiton in
order to satisfy the rule condition for TagName tag.
| |
TagName |
Gets the name of the HTML tag for which to apply the rule.
|
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.