TextMetadata Class
Represents metadata that binds the text content of an XML element to a constructor parameter marked with the ForTextAttribute annotation.
public sealed class TextMetadata : Metadata
- Inheritance
Constructors
Text |
Represents metadata that binds the text content of an XML element to a constructor parameter marked with the ForTextAttribute annotation. |
Properties
Methods
Handle |
Description copied from class: Metadata
|
Handle |
|
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.
public TextMetadata(AttributeBank bank, ParameterInfo info)
Parameters
- bank
-
Attribute
Bank
The attribute bank to be associated with this metadata.
- info
-
Parameter
Info
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.
protected override void HandleComponentsWithContent(object[] arguments, XmlReader @in, Func<Type, Metadata> getMetadata)
Parameters
- arguments
- object[]
- in
-
Xml
Reader
HandleComponentsWithEmptyElement(object[], XmlReader, Func<Type, Metadata>)
protected override void HandleComponentsWithEmptyElement(object[] arguments, XmlReader @in, Func<Type, Metadata> getMetadata)
Parameters
- arguments
- object[]
- in
-
Xml
Reader
Remarks
Treats an empty element like the same as
, resulting in an empty string.