Definition
Assembly: CloudNimble.XmlEssentials.dll Namespace: CloudNimble.Text.Xml.Serialization Inheritance: CloudNimble.Text.Xml.Serialization.XmlArrayItemAttributeSyntax
Summary
Specifies the element name of the items of type T in a collection member. This class cannot be inherited.Usage
Apply[XmlArrayItem] together with [XmlArray] to name the item elements inside the wrapper element of a collection.
Type Parameters
T- The type of the items that the element name applies to.
Considerations
- The attribute has an effect only on a wrapped collection: one with
[XmlArray], or one thatDefaultCollectionMapping = XmlCollectionMapping.Wrappedwraps. On a collection with no wrapper, the repeated elements keep the member’s name. To rename those, use[XmlElement("Name")]or[XmlPropertyName("Name")]on the member. - Without the attribute, each item of a wrapped collection is named after its type:
int,string, and the other XML Schema names for built-in types, and the type’s name, converted by the element naming policy, otherwise. - A name set here isn’t converted by a naming policy.
Namespaceis the namespace of the items of a collection in a wrapper, which is a member with[XmlArray]. Leftnull, an item is written under its name alone, so it is in the namespace of its wrapper when the wrapper has one. An empty string puts the items in no namespace (xmlns=""). This is whatSystem.Xml.Serializationwrites.- With no wrapper the item is the element of the member, so
Namespacenames nothing: the item has the namespace of the member. - When a collection is read, every element in the wrapper is an item, whatever its name and namespace.
- For collections whose items are of different derived types, see Polymorphism.
Constructors
.ctor
Initializes a new instance of theXmlArrayItemAttribute1` class that uses the default item element name.
Syntax
.ctor
Initializes a new instance of theXmlArrayItemAttribute1` class with the specified item element name.
Syntax
Parameters
Exceptions
.ctor Inherited
Inherited from
CloudNimble.Text.Xml.Serialization.XmlArrayItemAttributeSyntax
.ctor Inherited
Inherited from
CloudNimble.Text.Xml.Serialization.XmlArrayItemAttributeSyntax
Parameters
Exceptions
.ctor Inherited
Inherited from
System.AttributeSyntax
.ctor Inherited
Inherited from
objectSyntax
Properties
ElementName Inherited
Inherited from
CloudNimble.Text.Xml.Serialization.XmlArrayItemAttributeSyntax
Property Value
Type:string?
The local name of the item elements. If the value is null or empty, the name of the item type is used
for a collection wrapped by XmlArrayAttribute, converted by the element naming policy, and the member’s
element name is used for a collection that is not wrapped. The default is null.
Namespace Inherited
Inherited from
CloudNimble.Text.Xml.Serialization.XmlArrayItemAttributeSyntax
Property Value
Type:string?
The namespace URI of the item elements. The default is null, which writes an item
under its name alone, so it is in the default namespace that is in scope: the namespace of the wrapper
when the wrapper has one. An empty string puts the items in no namespace.
Remarks
The value applies to the items of a collection in a wrapper, which is a member with XmlArrayAttribute. With no wrapper an item is the element of the member, and has the namespace of the member. The value is used when the items are written. When they are read, every element in the wrapper is an item, whatever its name and namespace.Type Override
Syntax
Property Value
Type:System.Type
Type Inherited Virtual
Inherited from
CloudNimble.Text.Xml.Serialization.XmlArrayItemAttributeSyntax
Property Value
Type:System.Type?
The item type, or null if the element type of the collection is used.
TypeId Inherited Virtual
Inherited from
System.AttributeSyntax
Property Value
Type:object
Methods
Equals Override
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetHashCode Override
Inherited from
System.AttributeSyntax
Returns
Type:int
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
IsDefaultAttribute Inherited Virtual
Inherited from
System.AttributeSyntax
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
Match Inherited Virtual
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?
Related APIs
- CloudNimble.Text.Xml.Serialization.XmlArrayAttribute
- CloudNimble.Text.Xml.Serialization.XmlElementAttribute
- CloudNimble.Text.Xml.Serialization.XmlPropertyNameAttribute
- CloudNimble.Text.Xml.Serialization.XmlDerivedTypeAttribute