Class ContentTypePropertyCollection

ContentTypePropertyCollection class

A collection of ContentTypeProperty objects that represent additional information.

public class ContentTypePropertyCollection : CollectionBase<ContentTypeProperty>

Properties

NameDescription
Capacity { get; set; }
Count { get; }
Item { get; }Gets the content type property by the specific index. (2 indexers)
Item { get; set; }

Methods

NameDescription
Add(string, string)Adds content type property information.
Add(string, string, string)Adds content type property information.
BinarySearch(ContentTypeProperty)
BinarySearch(ContentTypeProperty, IComparer<ContentTypeProperty>)
BinarySearch(int, int, ContentTypeProperty, IComparer<ContentTypeProperty>)
Clear()
Contains(ContentTypeProperty)
CopyTo(ContentTypeProperty[])
CopyTo(ContentTypeProperty[], int)
CopyTo(int, ContentTypeProperty[], int, int)
Exists(Predicate<ContentTypeProperty>)
Find(Predicate<ContentTypeProperty>)
FindAll(Predicate<ContentTypeProperty>)
FindIndex(Predicate<ContentTypeProperty>)
FindIndex(int, Predicate<ContentTypeProperty>)
FindIndex(int, int, Predicate<ContentTypeProperty>)
FindLast(Predicate<ContentTypeProperty>)
FindLastIndex(Predicate<ContentTypeProperty>)
FindLastIndex(int, Predicate<ContentTypeProperty>)
FindLastIndex(int, int, Predicate<ContentTypeProperty>)
GetEnumerator()
IndexOf(ContentTypeProperty)
IndexOf(ContentTypeProperty, int)
IndexOf(ContentTypeProperty, int, int)
LastIndexOf(ContentTypeProperty)
LastIndexOf(ContentTypeProperty, int)
LastIndexOf(ContentTypeProperty, int, int)
RemoveAt(int)

Examples

namespace AsposeCellsExamples
{
    using Aspose.Cells;
    using Aspose.Cells.Properties;
    using System;

    public class ContentTypePropertyCollectionDemo
    {
        public static void ContentTypePropertyCollectionExample()
        {
            // Instantiating a Workbook object
            Workbook workbook = new Workbook();

            // Add a new property to the ContentTypePropertyCollection
            workbook.ContentTypeProperties.Add("Admin", "Aspose", "text");

            // Accessing the ContentTypePropertyCollection
            ContentTypePropertyCollection contentTypeProperties = workbook.ContentTypeProperties;

            // Displaying the count of properties
            Console.WriteLine("Number of ContentTypeProperties: " + contentTypeProperties.Count);

            // Accessing a specific property by index
            ContentTypeProperty property = contentTypeProperties[0];
            Console.WriteLine("Property Name: " + property.Name);
            Console.WriteLine("Property Value: " + property.Value);
            Console.WriteLine("Property Type: " + property.Type);

            // Modifying the capacity of the collection
            contentTypeProperties.Capacity = 10;
            Console.WriteLine("New Capacity: " + contentTypeProperties.Capacity);

            // Save the Excel file
            workbook.Save("ContentTypePropertyCollectionExample.xlsx");
            workbook.Save("ContentTypePropertyCollectionExample.pdf");
        }
    }
}

See Also