BaseWebExtensionCollectionT Class |
Namespace: Aspose.Words.WebExtensions
public abstract class BaseWebExtensionCollection<T> : IEnumerable<T>, IEnumerable where T : class
The BaseWebExtensionCollectionT type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | Count |
Gets the number of elements contained in the collection.
|
![]() ![]() | Item |
Gets or sets an item at the specified index.
|
Name | Description | |
---|---|---|
![]() ![]() | Add |
Adds specified item to the collection.
|
![]() ![]() | Clear |
Removes all elements from the collection.
|
![]() | Equals | (Inherited from Object.) |
![]() ![]() | GetEnumerator |
Returns an enumerator that can iterate through a collection.
|
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() ![]() | Remove |
Removes the item at the specified index from the collection.
|
![]() | ToString | (Inherited from Object.) |
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();