Class CustomXmlPartCollection
Contents
[
Hide
]CustomXmlPartCollection class
Represents a Custom XML Data Storage Part (custom XML data within a package).
public class CustomXmlPartCollection : CollectionBase<CustomXmlPart>
Properties
Name | Description |
---|---|
Capacity { get; set; } | |
Count { get; } | |
Item { get; } | Gets an item at the specified index. |
Item { get; set; } |
Methods
Name | Description |
---|---|
Add(byte[], byte[]) | Adds an item to the collection. |
BinarySearch(CustomXmlPart) | |
BinarySearch(CustomXmlPart, IComparer<CustomXmlPart>) | |
BinarySearch(int, int, CustomXmlPart, IComparer<CustomXmlPart>) | |
Clear() | |
Contains(CustomXmlPart) | |
CopyTo(CustomXmlPart[]) | |
CopyTo(CustomXmlPart[], int) | |
CopyTo(int, CustomXmlPart[], int, int) | |
Exists(Predicate<CustomXmlPart>) | |
Find(Predicate<CustomXmlPart>) | |
FindAll(Predicate<CustomXmlPart>) | |
FindIndex(Predicate<CustomXmlPart>) | |
FindIndex(int, Predicate<CustomXmlPart>) | |
FindIndex(int, int, Predicate<CustomXmlPart>) | |
FindLast(Predicate<CustomXmlPart>) | |
FindLastIndex(Predicate<CustomXmlPart>) | |
FindLastIndex(int, Predicate<CustomXmlPart>) | |
FindLastIndex(int, int, Predicate<CustomXmlPart>) | |
GetEnumerator() | |
IndexOf(CustomXmlPart) | |
IndexOf(CustomXmlPart, int) | |
IndexOf(CustomXmlPart, int, int) | |
LastIndexOf(CustomXmlPart) | |
LastIndexOf(CustomXmlPart, int) | |
LastIndexOf(CustomXmlPart, int, int) | |
RemoveAt(int) | |
SelectByID(string) | Gets an item by id. |
Examples
namespace AsposeCellsExamples
{
using Aspose.Cells;
using Aspose.Cells.Markup;
using System;
public class MarkupClassCustomXmlPartCollectionDemo
{
public static void Run()
{
// Create a new workbook
Workbook workbook = new Workbook();
// Get the CustomXmlPartCollection from the workbook
CustomXmlPartCollection customXmlParts = workbook.CustomXmlParts;
// Create sample XML data and schema
byte[] xmlData = System.Text.Encoding.UTF8.GetBytes("<root><item>Test</item></root>");
byte[] schemaData = System.Text.Encoding.UTF8.GetBytes("<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'></xsd:schema>");
// Add a new custom XML part
int index = customXmlParts.Add(xmlData, schemaData);
// Get the added XML part by index
CustomXmlPart part = customXmlParts[index];
// Select XML part by ID (if known)
string partId = part.ID;
CustomXmlPart selectedPart = customXmlParts.SelectByID(partId);
// Add another XML part
byte[] xmlData2 = System.Text.Encoding.UTF8.GetBytes("<data><value>123</value></data>");
customXmlParts.Add(xmlData2, null);
// Display count of custom XML parts
Console.WriteLine("Custom XML parts count: " + customXmlParts.Count);
// Save the workbook
workbook.Save("CustomXmlPartCollectionDemo.xlsx");
}
}
}
See Also
- class CollectionBase<T>
- class CustomXmlPart
- namespace Aspose.Cells.Markup
- assembly Aspose.Cells