Class WebExtensionPropertyCollection

WebExtensionPropertyCollection class

Represents the list of web extension properties.

public class WebExtensionPropertyCollection : CollectionBase<WebExtensionProperty>

Constructors

NameDescription
WebExtensionPropertyCollection()The default constructor.

Properties

NameDescription
Capacity { get; set; }
Count { get; }
Item { get; }Gets the property of web extension by the index. (2 indexers)
Item { get; set; }

Methods

NameDescription
Add(string, string)Adds web extension property.
BinarySearch(WebExtensionProperty)
BinarySearch(WebExtensionProperty, IComparer<WebExtensionProperty>)
BinarySearch(int, int, WebExtensionProperty, IComparer<WebExtensionProperty>)
Clear()
Contains(WebExtensionProperty)
CopyTo(WebExtensionProperty[])
CopyTo(WebExtensionProperty[], int)
CopyTo(int, WebExtensionProperty[], int, int)
Exists(Predicate<WebExtensionProperty>)
Find(Predicate<WebExtensionProperty>)
FindAll(Predicate<WebExtensionProperty>)
FindIndex(Predicate<WebExtensionProperty>)
FindIndex(int, Predicate<WebExtensionProperty>)
FindIndex(int, int, Predicate<WebExtensionProperty>)
FindLast(Predicate<WebExtensionProperty>)
FindLastIndex(Predicate<WebExtensionProperty>)
FindLastIndex(int, Predicate<WebExtensionProperty>)
FindLastIndex(int, int, Predicate<WebExtensionProperty>)
GetEnumerator()
IndexOf(WebExtensionProperty)
IndexOf(WebExtensionProperty, int)
IndexOf(WebExtensionProperty, int, int)
LastIndexOf(WebExtensionProperty)
LastIndexOf(WebExtensionProperty, int)
LastIndexOf(WebExtensionProperty, int, int)
RemoveAt(int)
RemoveAt(string)Remove the property by the name.

Examples

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

    public class WebExtensionsClassWebExtensionPropertyCollectionDemo
    {
        public static void Run()
        {
            // Create a new workbook for demonstration
            Workbook workbook = new Workbook();
            
            try
            {
                // Create an instance of WebExtensionPropertyCollection
                WebExtensionPropertyCollection properties = new WebExtensionPropertyCollection();
                
                // Add properties to the collection
                int index1 = properties.Add("Color", "Blue");
                int index2 = properties.Add("Size", "Medium");
                
                // Access properties using indexer
                Console.WriteLine("Property 1: {0} = {1}", 
                    properties[index1].Name, properties[index1].Value);
                Console.WriteLine("Property 2: {0} = {1}", 
                    properties[index2].Name, properties[index2].Value);
                
                // Access property by name
                WebExtensionProperty sizeProperty = properties["Size"];
                Console.WriteLine("Accessed by name: Size = {0}", sizeProperty.Value);
                
                // Remove a property
                properties.RemoveAt("Color");
                Console.WriteLine("After removal - Count: {0}", properties.Count);
                
                // Save the workbook
                workbook.Save("WebExtensionPropertyCollectionDemo.xlsx");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error working with WebExtensionPropertyCollection: {ex.Message}");
            }
        }
    }
}

See Also