[]
        
(Showing Draft Content)

GrapeCity.Documents.Word.CustomXmlPartCollection

Class CustomXmlPartCollection

Namespace
GrapeCity.Documents.Word
Assembly
GcDocs.Word.dll

Represents a collection of CustomXmlPart objects in the document.

public class CustomXmlPartCollection : IReadOnlyList<CustomXmlPart>, IReadOnlyCollection<CustomXmlPart>, IEnumerable<CustomXmlPart>, IEnumerable
Inheritance
object
CustomXmlPartCollection
Implements
System.Collections.Generic.IReadOnlyList<T><CustomXmlPart>
System.Collections.Generic.IReadOnlyCollection<T><CustomXmlPart>
System.Collections.Generic.IEnumerable<T><CustomXmlPart>
System.Collections.IEnumerable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Properties

Count

Gets the number of CustomXmlPart in the collection.

public int Count { get; }

Property Value

int

this[int]

Gets the CustomXmlPart at the specified index in the collection.

public CustomXmlPart this[int index] { get; }

Parameters

index int

The zero-based index of the CustomXmlPart to get.

Property Value

CustomXmlPart

The CustomXmlPart at the specified index in the collection.

this[string]

Gets the CustomXmlPart by the specified id in the collection.

public CustomXmlPart this[string id] { get; }

Parameters

id string

The id of the CustomXmlPart to get.

Property Value

CustomXmlPart

The CustomXmlPart with the specified id in the collection.

Methods

Add(XmlDocument, string, string[], string)

Adds a new CustomXmlPart into the collection.

public CustomXmlPart Add(XmlDocument xmlDocument, string id = null, string[] schemas = null, string contentType = "application/xml")

Parameters

xmlDocument System.Xml.XmlDocument

The System.Xml.XmlDocument that contains data for this part.

id string

A 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 string

The content type of the part.

Returns

CustomXmlPart

A newly created CustomXmlPart.

Contains(string)

Checks whether this collection contains a custom xml part with specified id.

public bool Contains(string id)

Parameters

id string

The custom xml id check.

Returns

bool

True if the collection contains a custom xml part with the specified id, false otherwise.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<CustomXmlPart> GetEnumerator()

Returns

System.Collections.Generic.IEnumerator<T><CustomXmlPart>

An enumerator that can be used to iterate through the collection.

Remove(CustomXmlPart)

Removes the specified CustomXmlPart from the collection.

public bool Remove(CustomXmlPart part)

Parameters

part CustomXmlPart

The CustomXmlPart to remove.

Returns

bool

true if the CustomXmlPart has been removed form the collection, otherwise false.

TryGetValue(string, out CustomXmlPart)

Tries to get a custom xml part from the collection by its id.

public bool TryGetValue(string id, out CustomXmlPart customXmlPart)

Parameters

id string

The custom xml part id.

customXmlPart CustomXmlPart

When this method returns true, contains the custom xml part with the specified id, or null otherwise.

Returns

bool

True if the custom xml part with the specified id was found, false otherwise.