[]
Represents a collection of CustomXmlPart objects in the document.
public class CustomXmlPartCollection : IReadOnlyList<CustomXmlPart>, IReadOnlyCollection<CustomXmlPart>, IEnumerable<CustomXmlPart>, IEnumerable
Gets the number of CustomXmlPart in the collection.
public int Count { get; }
Gets the CustomXmlPart at the specified index in the collection.
public CustomXmlPart this[int index] { get; }
index
intThe zero-based index of the CustomXmlPart to get.
The CustomXmlPart at the specified index in the collection.
Gets the CustomXmlPart by the specified id in the collection.
public CustomXmlPart this[string id] { get; }
id
stringThe id of the CustomXmlPart to get.
The CustomXmlPart with the specified id in the collection.
Adds a new CustomXmlPart into the collection.
public CustomXmlPart Add(XmlDocument xmlDocument, string id = null, string[] schemas = null, string contentType = "application/xml")
xmlDocument
System.Xml.XmlDocumentThe System.Xml.XmlDocument that contains data for this part.
id
stringA globally unique identifier (GUID) that uniquely identifies this part in the document.
schemas
string[]A list of XML schemes that are associated with the part.
contentType
stringThe content type of the part.
A newly created CustomXmlPart.
Checks whether this collection contains a custom xml part with specified id.
public bool Contains(string id)
id
stringThe custom xml id check.
True if the collection contains a custom xml part with the specified id, false otherwise.
Returns an enumerator that iterates through the collection.
public IEnumerator<CustomXmlPart> GetEnumerator()
An enumerator that can be used to iterate through the collection.
Removes the specified CustomXmlPart from the collection.
public bool Remove(CustomXmlPart part)
part
CustomXmlPartThe CustomXmlPart to remove.
true if the CustomXmlPart has been removed form the collection, otherwise false.
Tries to get a custom xml part from the collection by its id.
public bool TryGetValue(string id, out CustomXmlPart customXmlPart)
id
stringThe custom xml part id.
customXmlPart
CustomXmlPartWhen this method returns true, contains the custom xml part with the specified id, or null otherwise.
True if the custom xml part with the specified id was found, false otherwise.