TextMetadata Class

Represents metadata that binds the text content of an XML element to a constructor parameter marked with the ForTextAttribute annotation.

C#
public sealed class TextMetadata : Metadata
Inheritance
TextMetadata

Constructors

TextMetadata(AttributeBank, ParameterInfo)

Represents metadata that binds the text content of an XML element to a constructor parameter marked with the ForTextAttribute annotation.

Properties

Bank

Gets the attribute bank associated with this metadata.

(Inherited from Metadata)

Methods

HandleComponentsWithContent(object[], XmlReader, Func<Type, Metadata>)

Description copied from class: Metadata

Handles the components of the instance using the content of the current XML element provided by the specified XML reader.

HandleComponentsWithEmptyElement(object[], XmlReader, Func<Type, Metadata>)
RequiredElement(XmlReader, Func<Type, Metadata>)

Returns a new instance bound to the root XML element that is read from the specified XML reader.

(Inherited from Metadata)
CreateInstance(XmlReader, Func<Type, Metadata>)

Creates a new instance bound to the next XML element in the specified XML reader.

(Inherited from Metadata)
HandleComponentsWithContent(object[], XmlReader, Func<Type, Metadata>)

Handles the components of the instance using the content of the current XML element provided by the specified XML reader.

(Inherited from Metadata)
HandleComponentsWithEmptyElement(object[], XmlReader, Func<Type, Metadata>)

Handles component binding when the XML reader encounters an empty element.

(Inherited from Metadata)
Equals(object) (Inherited from object)
GetHashCode() (Inherited from object)
GetType() (Inherited from object)
MemberwiseClone() (Inherited from object)
ToString() (Inherited from object)

Constructors Detail

TextMetadata(AttributeBank, ParameterInfo)

Represents metadata that binds the text content of an XML element to a constructor parameter marked with the ForTextAttribute annotation.

C#
public TextMetadata(AttributeBank bank, ParameterInfo info)

Parameters

bank
AttributeBank

The attribute bank to be associated with this metadata.

info
ParameterInfo

The constructor parameter marked with the attribute ForTextAttribute. Its type must be string or BindResult<string>.

Methods Detail

HandleComponentsWithContent(object[], XmlReader, Func<Type, Metadata>)

Description copied from class: Metadata

Handles the components of the instance using the content of the current XML element provided by the specified XML reader.

C#
protected override void HandleComponentsWithContent(object[] arguments, XmlReader @in, Func<Type, Metadata> getMetadata)

Parameters

arguments
object[]
getMetadata
Func<Type, Metadata>

HandleComponentsWithEmptyElement(object[], XmlReader, Func<Type, Metadata>)

C#
protected override void HandleComponentsWithEmptyElement(object[] arguments, XmlReader @in, Func<Type, Metadata> getMetadata)

Parameters

arguments
object[]
getMetadata
Func<Type, Metadata>

Remarks

Treats an empty element like the same as , resulting in an empty string.