FromAttributeAttribute Class
Marks an instance method to be notified with the XML attribute.
[AttributeUsage(System.AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public sealed class FromAttributeAttribute : Attribute
- Inheritance
- Attributes
Remarks
If the Oxbinder<T> finds the XML attribute, it invokes
the annotated method corresponding to the attribute name, with that
value as a single parameter. This annotation must mark an instance
method, of which the return type must be void
, and that must
have a single parameter whose type is string. And the
class that has the instance method 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
method is annotated with [FromAttribute("name")]
, there must be
no other methods annotated with [FromAttribute("name")]
and also
be no fields annotated with [ForAttribute("name")]
.
Constructors
From |
Initializes a new instance of the FromAttributeAttribute 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
FromAttributeAttribute(string, string)
Initializes a new instance of the FromAttributeAttribute class.
public FromAttributeAttribute(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.
public XmlQualifiedName QName { get; }