ForTextAttribute Class

Marks a constructor parameter to be bound to the text inside an XML element.

C#
[AttributeUsage(System.AttributeTargets.Parameter, Inherited = false, AllowMultiple = false)]
public sealed class ForTextAttribute : Attribute
Inheritance
ForTextAttribute
Attributes

Remarks

If the Oxbinder<T> encounters an XML element containing a text node, it populates the constructor parameter with the content of the text node.

This attribute must be applied to a constructor parameter of type string or BindResult<T>. The class containing this constructor must also be annotated with ForElementAttribute.

The parameter attributed with ForTextAttribute must be the last parameter of the constructor.

A constructor with a parameter attributed with ForTextAttribute must not contain:

The parameter will never be null. If the element does not contain a text node, or the text node is empty, the parameter will be set to an empty string ("").

Properties

TypeId (Inherited from Attribute)

Methods

Equals(object) (Inherited from Attribute)
GetHashCode() (Inherited from Attribute)
IsDefaultAttribute() (Inherited from Attribute)
Match(object) (Inherited from Attribute)
GetType() (Inherited from object)
MemberwiseClone() (Inherited from object)
ToString() (Inherited from object)