ForAttributeAttribute Class

Marks an instance field to be bound with the XML attribute.

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

Remarks

If the Oxbinder<T> finds the XML attribute, it populates the annotated field corresponding to the attribute name, with that value.

This annotation must mark an instance field whose type is string. And the class that has the instance field must be annotated with ForElementAttribute.

Each attribute name of the annotation ForAttributeAttribute and FromAttributeAttribute must be unique in one class. For example, in a class, if an instance field is annotated with [ForAttribute("name")], there must be no other fields annotated with [ForAttribute("name")] and also be no methods annotated with [FromAttribute("name")].

Constructors

ForAttributeAttribute(string, string)

Initializes a new instance of the ForAttributeAttribute class.

Properties

QName

Gets the qualified name of the attribute.

Methods

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

See Also

Constructors Detail

ForAttributeAttribute(string, string)

Initializes a new instance of the ForAttributeAttribute class.

C#
public ForAttributeAttribute(string name, [string ns = ""])

Parameters

name
string

The attribute name.

ns
string

The namespace URI.

Properties Detail

QName

Gets the qualified name of the attribute.

C#
public XmlQualifiedName QName { get; }

Property Value