DesignerVerbCollection Class
Represents a collection of DesignerVerb objects.
Assembly: System (in System.dll)
'Declaration <ComVisibleAttribute(True)> _ <PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _ <PermissionSetAttribute(SecurityAction.LinkDemand, Name := "FullTrust")> _ <HostProtectionAttribute(SecurityAction.LinkDemand, SharedState := True)> _ Public Class DesignerVerbCollection _ Inherits CollectionBase 'Usage Dim instance As DesignerVerbCollection
Note: |
|---|
The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: SharedState. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes. |
This class provides a collection that can contain DesignerVerb objects.
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.Collections.CollectionBase
System.ComponentModel.Design.DesignerVerbCollection
System.Workflow.ComponentModel.Design.ActivityDesignerVerbCollection
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: