Class XmlTypeCollection
Defines a collection of types known to a XmlSerializer
Inherited Members
Namespace: NMF.Serialization
Assembly: NMF.Serialization.dll
Syntax
public sealed class XmlTypeCollection : ICollection<Type>, IEnumerable<Type>, IEnumerable
Remarks
This collection is only a wrapper for an internal collection of type serialization information
Constructors
| Edit this page View SourceXmlTypeCollection(XmlSerializer)
Creates a new typecollection for the given XmlSerializer
Declaration
public XmlTypeCollection(XmlSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
XmlSerializer | serializer | The XmlSerializer that will work with this set of types |
Properties
| Edit this page View SourceCount
Gives the amount of types known to the XmlSerializer
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
Serializer
The corresponding XmlSerializer
Declaration
public XmlSerializer Serializer { get; }
Property Value
Type | Description |
---|---|
XmlSerializer |
Methods
| Edit this page View SourceAdd(Type)
Imports the given type to the XmlSerializer
Declaration
public void Add(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to import |
Remarks
Note that importing a type will also import all the property types of this type, if they aren't already imported
Clear()
Clears the set of types known to the XmlSerializer
Declaration
public void Clear()
Contains(Type)
Gets a value that indicates whether the given type is already known to the XmlSerializer
Declaration
public bool Contains(Type item)
Parameters
Type | Name | Description |
---|---|---|
Type | item | The type to look for |
Returns
Type | Description |
---|---|
bool | True, if the type is already known to the XmlSerializer, otherwise False |
CopyTo(Type[], int)
Copies the known types into an array
Declaration
public void CopyTo(Type[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
Type[] | array | The array to copy to |
int | arrayIndex | The destination start index |
GetEnumerator()
Gets an enumerator to go through the collection
Declaration
public IEnumerator<Type> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<Type> | An IEnumerator object |
Remove(Type)
Removes the given type from the set
Declaration
public bool Remove(Type item)
Parameters
Type | Name | Description |
---|---|---|
Type | item | The type to remove |
Returns
Type | Description |
---|---|
bool | A value indicating whether removal was successful |