BaseWebExtensionCollectionT Class

Inheritance Hierarchy

Namespace:  Aspose.Words.WebExtensions
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public abstract class BaseWebExtensionCollection<T> : IEnumerable<T>, 
	IEnumerable
where T : class

Type Parameters

T
Type of a collection item.

The BaseWebExtensionCollectionT type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleCount
Gets the number of elements contained in the collection.
Public propertyCode exampleItem
Gets or sets an item at the specified index.
Methods
  NameDescription
Public methodCode exampleAdd
Adds specified item to the collection.
Public methodCode exampleClear
Removes all elements from the collection.
Public methodEquals (Inherited from Object.)
Public methodCode exampleGetEnumerator
Returns an enumerator that can iterate through a collection.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodCode exampleRemove
Removes the item at the specified index from the collection.
Public methodToString (Inherited from Object.)
Examples
Shows how to work with web extension collections.
Document doc = new Document(MyDir + "Web extension.docx");

Assert.AreEqual(1, doc.WebExtensionTaskPanes.Count);

// Add new taskpane to the collection
TaskPane newTaskPane = new TaskPane();
doc.WebExtensionTaskPanes.Add(newTaskPane);
Assert.AreEqual(2, doc.WebExtensionTaskPanes.Count);

// Enumerate all WebExtensionProperty in a collection
WebExtensionPropertyCollection webExtensionPropertyCollection = doc.WebExtensionTaskPanes[0].WebExtension.Properties;
using (IEnumerator<WebExtensionProperty> enumerator = webExtensionPropertyCollection.GetEnumerator())
{
    while (enumerator.MoveNext())
    {
        WebExtensionProperty webExtensionProperty = enumerator.Current;
        Console.WriteLine($"Binding name: {webExtensionProperty.Name}; Binding value: {webExtensionProperty.Value}");
    }
}

// Delete specific taskpane from the collection
doc.WebExtensionTaskPanes.Remove(1);

// Or remove all items from the collection
doc.WebExtensionTaskPanes.Clear();
See Also