DesignerVerbCollection Class
.NET Framework 3.0
Represents a collection of DesignerVerb objects.
Namespace: System.ComponentModel.Design
Assembly: System (in system.dll)
Assembly: System (in system.dll)
'Declaration <ComVisibleAttribute(True)> _ Public Class DesignerVerbCollection Inherits CollectionBase 'Usage Dim instance As DesignerVerbCollection
/** @attribute ComVisibleAttribute(true) */ public class DesignerVerbCollection extends CollectionBase
ComVisibleAttribute(true) public class DesignerVerbCollection extends CollectionBase
Not applicable.
The following code example demonstrates how to use the DesignerVerbCollection class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
' Creates an empty DesignerVerbCollection. Dim collection As New DesignerVerbCollection() ' Adds a DesignerVerb to the collection. collection.Add(New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))) ' Adds an array of DesignerVerb objects to the collection. Dim verbs As DesignerVerb() = {New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)), New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))} collection.AddRange(verbs) ' Adds a collection of DesignerVerb objects to the collection. Dim verbsCollection As New DesignerVerbCollection() verbsCollection.Add(New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))) verbsCollection.Add(New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))) collection.AddRange(verbsCollection) ' Tests for the presence of a DesignerVerb in the collection, ' and retrieves its index if it is found. Dim testVerb As New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)) Dim itemIndex As Integer = -1 If collection.Contains(testVerb) Then itemIndex = collection.IndexOf(testVerb) End If ' Copies the contents of the collection, beginning at index 0, ' to the specified DesignerVerb array. ' 'verbs' is a DesignerVerb array. collection.CopyTo(verbs, 0) ' Retrieves the count of the items in the collection. Dim collectionCount As Integer = collection.Count ' Inserts a DesignerVerb at index 0 of the collection. collection.Insert(0, New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))) ' Removes the specified DesignerVerb from the collection. Dim verb As New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)) collection.Remove(verb) ' Removes the DesignerVerb at index 0. collection.RemoveAt(0)
System.Object
System.Collections.CollectionBase
System.ComponentModel.Design.DesignerVerbCollection
System.Workflow.ComponentModel.Design.ActivityDesignerVerbCollection
System.Collections.CollectionBase
System.ComponentModel.Design.DesignerVerbCollection
System.Workflow.ComponentModel.Design.ActivityDesignerVerbCollection
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: