Abstract base class for all classes representing message components.
For a list of all members of this type, see Node Members.
System.Object
Node
Node is the root of an inheritance hierarchy that
includes many classes in MIME.NET. All classes that represent
MIME document components are subclasses of Node. The
Node class defines important features that are inherited by
these subclasses. These features are the following:
A string representation. The string
representation is the serialized representation of a MIME
document component. The Node class provides a property String to get or set the string representation.
A broken-down representation. The
broken-down representation is the parsed
representation of a MIME document component. For example, the
broken-down representation of an RFC 2822 date-time
consists of the year, month, day, hour, minute, second, and time zone.
Subclasses of Node provide properties or methods to set or get
elements of the broken-down representation.
A parse operation to create or update the
broken-down representation from the string representation. In the
DateTime class, for example, the parse operation parses the
year, month, day, hour, minute, second, and time zone from the
RFC 2822 date-time string contained in the string
representation. Node provides an abstract method Parse() that subclasses override to execute the parse
operation.
An assemble operation to create or update the
string representation from the broken-down representation. This is the
opposite of the parse operation. In the DateTime class, for
example, the assemble operation creates an RFC 2822
date-time string from values of the year, month, day, hour,
minute, second, and time zone. Node provides an abstract method
Assemble() that subclasses override to execute the
assemble operation.
An is-modified flag. When the string
representation and the broken-down representation are consistent, the
assemble operation does not need to be executed. The is-modified flag
indicates if the string representation and the broken-down
representation are consistent. The flag is cleared when the two
representations are consistent, and is set when they are inconsistent.
The flag is set when a Node object's broken-down representation
is changed by calling one of its methods. It is cleared when the
assemble or parse operation is executed. Node also provides a
property Modified that gets or sets the is-modified
flag.
Normally, you can ignore the is-modified flag. The
Assemble() method always checks the is-modified flag and returns
immediately if the flag is cleared. The library uses the is-modified
flag to optimize the Assemble() method.
A parent node. MIME.NET maintains a
tree structure of Node objects. The parent-child relationship
among Node objects parallels the superstring-substring
relationship among the "components" of a MIME document. For example,
where a MIME message contains substrings for the
headers and the body, MIME.NET provides a
Message node object that has a Headers child node and a
Body child node. Where a MIME headers string contains
a substring for each header field, MIME.NET provides a
Headers node object that has a collection of Field child
nodes.
To maintain consistency in the tree, whenever a node's is-modified flag is set, the node requests its parent to also set its is-modified flag. In this way, an is-modified flag set anywhere in the tree always propagates to the root node.
Child nodes. Subclasses of Node
provide methods to access their child nodes. A node's parse operation
invokes the parse operations of its child nodes after it has
updated its broken-down representation. Also, a node's assemble
operation invokes the assemble operations of its child nodes
before it updates its string representation.
Namespace: Hunny.Mime
Assembly: Hunny.Mime (in Hunny.Mime.dll)
Node Members | Hunny.Mime Namespace