Class XmlTypeCollection
- Namespace
- NMF.Serialization
- Assembly
- NMF.Serialization.dll
Defines a collection of types known to a XmlSerializer
public sealed class XmlTypeCollection : ICollection<Type>, IEnumerable<Type>, IEnumerable
- Inheritance
-
XmlTypeCollection
- Implements
- Inherited Members
Remarks
This collection is only a wrapper for an internal collection of type serialization information
Constructors
XmlTypeCollection(XmlSerializer)
Creates a new typecollection for the given XmlSerializer
public XmlTypeCollection(XmlSerializer serializer)
Parameters
serializerXmlSerializerThe XmlSerializer that will work with this set of types
Properties
Count
Gives the amount of types known to the XmlSerializer
public int Count { get; }
Property Value
Serializer
The corresponding XmlSerializer
public XmlSerializer Serializer { get; }
Property Value
Methods
Add(Type)
Imports the given type to the XmlSerializer
public void Add(Type type)
Parameters
typeTypeThe 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
public void Clear()
Contains(Type)
Gets a value that indicates whether the given type is already known to the XmlSerializer
public bool Contains(Type item)
Parameters
itemTypeThe type to look for
Returns
- bool
True, if the type is already known to the XmlSerializer, otherwise False
CopyTo(Type[], int)
Copies the known types into an array
public void CopyTo(Type[] array, int arrayIndex)
Parameters
GetEnumerator()
Gets an enumerator to go through the collection
public IEnumerator<Type> GetEnumerator()
Returns
- IEnumerator<Type>
An IEnumerator object
Remove(Type)
Removes the given type from the set
public bool Remove(Type item)
Parameters
itemTypeThe type to remove
Returns
- bool
A value indicating whether removal was successful