DesignerVerbCollection Klass
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Representerar en samling DesignerVerb objekt.
public ref class DesignerVerbCollection : System::Collections::CollectionBase
[System.Runtime.InteropServices.ComVisible(true)]
public class DesignerVerbCollection : System.Collections.CollectionBase
public class DesignerVerbCollection : System.Collections.CollectionBase
[<System.Runtime.InteropServices.ComVisible(true)>]
type DesignerVerbCollection = class
inherit CollectionBase
type DesignerVerbCollection = class
inherit CollectionBase
Public Class DesignerVerbCollection
Inherits CollectionBase
- Arv
- Härledda
- Attribut
Exempel
Följande kodexempel visar hur du DesignerVerbCollection använder klassen. Exemplet skapar en ny instans av klassen och använder flera metoder för att lägga till instruktioner i samlingen, returnera deras index och lägga till eller ta bort attribut på en specifik indexpunkt.
// Creates an empty DesignerVerbCollection.
DesignerVerbCollection^ collection = gcnew DesignerVerbCollection;
// Adds a DesignerVerb to the collection.
collection->Add( gcnew DesignerVerb( "Example designer verb",gcnew EventHandler( this, &Class1::ExampleEvent ) ) );
// Adds an array of DesignerVerb objects to the collection.
array<DesignerVerb^>^ verbs = {
gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ),
gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) )};
collection->AddRange( verbs );
// Adds a collection of DesignerVerb objects to the collection.
DesignerVerbCollection^ verbsCollection = gcnew DesignerVerbCollection;
verbsCollection->Add( gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ) );
verbsCollection->Add( gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ) );
collection->AddRange( verbsCollection );
// Tests for the presence of a DesignerVerb in the collection,
// and retrieves its index if it is found.
DesignerVerb^ testVerb = gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) );
int itemIndex = -1;
if ( collection->Contains( testVerb ) )
itemIndex = collection->IndexOf( testVerb );
// 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.
int collectionCount = collection->Count;
// Inserts a DesignerVerb at index 0 of the collection.
collection->Insert( 0, gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ) );
// Removes the specified DesignerVerb from the collection.
DesignerVerb^ verb = gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) );
collection->Remove( verb );
// Removes the DesignerVerb at index 0.
collection->RemoveAt( 0 );
// Creates an empty DesignerVerbCollection.
DesignerVerbCollection collection = new DesignerVerbCollection();
// Adds a DesignerVerb to the collection.
collection.Add( new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );
// Adds an array of DesignerVerb objects to the collection.
DesignerVerb[] verbs = { new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)), new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) };
collection.AddRange( verbs );
// Adds a collection of DesignerVerb objects to the collection.
DesignerVerbCollection verbsCollection = new DesignerVerbCollection();
verbsCollection.Add( new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );
verbsCollection.Add( new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );
collection.AddRange( verbsCollection );
// Tests for the presence of a DesignerVerb in the collection,
// and retrieves its index if it is found.
DesignerVerb testVerb = new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent));
int itemIndex = -1;
if( collection.Contains( testVerb ) )
itemIndex = collection.IndexOf( testVerb );
// 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.
int collectionCount = collection.Count;
// Inserts a DesignerVerb at index 0 of the collection.
collection.Insert( 0, new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );
// Removes the specified DesignerVerb from the collection.
DesignerVerb verb = new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent));
collection.Remove( verb );
// Removes the DesignerVerb at index 0.
collection.RemoveAt(0);
' 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)
Kommentarer
Den här klassen innehåller en samling som kan innehålla DesignerVerb objekt.
Konstruktorer
| Name | Description |
|---|---|
| DesignerVerbCollection() |
Initierar en ny instans av DesignerVerbCollection klassen. |
| DesignerVerbCollection(DesignerVerb[]) |
Initierar en ny instans av klassen med hjälp av DesignerVerbCollection den angivna matrisen med DesignerVerb objekt. |
Egenskaper
| Name | Description |
|---|---|
| Capacity |
Hämtar eller anger antalet element som CollectionBase kan innehålla. (Ärvd från CollectionBase) |
| Count |
Hämtar antalet element som finns i instansen CollectionBase . Den här egenskapen kan inte åsidosättas. (Ärvd från CollectionBase) |
| InnerList |
Hämtar en ArrayList lista med element i instansen CollectionBase . (Ärvd från CollectionBase) |
| Item[Int32] |
Hämtar eller anger DesignerVerb vid det angivna indexet. |
| List |
Hämtar en IList lista med element i instansen CollectionBase . (Ärvd från CollectionBase) |
Metoder
| Name | Description |
|---|---|
| Add(DesignerVerb) |
Lägger till den angivna DesignerVerb i samlingen. |
| AddRange(DesignerVerb[]) |
Lägger till den angivna uppsättningen designerverb i samlingen. |
| AddRange(DesignerVerbCollection) |
Lägger till den angivna samlingen med designerverb i samlingen. |
| Clear() |
Tar bort alla objekt från instansen CollectionBase . Den här metoden kan inte åsidosättas. (Ärvd från CollectionBase) |
| Contains(DesignerVerb) |
Hämtar ett värde som anger om den angivna DesignerVerb finns i samlingen. |
| CopyTo(DesignerVerb[], Int32) |
Kopierar samlingsmedlemmarna till den angivna DesignerVerb matrisen med början vid det angivna målindexet. |
| Equals(Object) |
Avgör om det angivna objektet är lika med det aktuella objektet. (Ärvd från Object) |
| GetEnumerator() |
Returnerar en uppräkning som itererar genom instansen CollectionBase . (Ärvd från CollectionBase) |
| GetHashCode() |
Fungerar som standard-hash-funktion. (Ärvd från Object) |
| GetType() |
Hämtar den aktuella instansen Type . (Ärvd från Object) |
| IndexOf(DesignerVerb) |
Hämtar indexet för den angivna DesignerVerb. |
| Insert(Int32, DesignerVerb) |
Infogar angivet DesignerVerb vid det angivna indexet. |
| MemberwiseClone() |
Skapar en ytlig kopia av den aktuella Object. (Ärvd från Object) |
| OnClear() |
Genererar händelsen |
| OnClearComplete() |
Utför ytterligare anpassade processer när innehållet i instansen har rensats CollectionBase . (Ärvd från CollectionBase) |
| OnInsert(Int32, Object) |
Genererar händelsen |
| OnInsertComplete(Int32, Object) |
Utför ytterligare anpassade processer när du har infogat ett nytt element i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnRemove(Int32, Object) |
Genererar händelsen |
| OnRemoveComplete(Int32, Object) |
Utför ytterligare anpassade processer när du har tagit bort ett element från instansen CollectionBase . (Ärvd från CollectionBase) |
| OnSet(Int32, Object, Object) |
Genererar händelsen |
| OnSetComplete(Int32, Object, Object) |
Utför ytterligare anpassade processer när du har angett ett värde i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnValidate(Object) |
Genererar händelsen |
| Remove(DesignerVerb) |
Tar bort den angivna DesignerVerb från samlingen. |
| RemoveAt(Int32) |
Tar bort elementet vid det angivna indexet för instansen CollectionBase . Den här metoden kan inte åsidosättas. (Ärvd från CollectionBase) |
| ToString() |
Returnerar en sträng som representerar det aktuella objektet. (Ärvd från Object) |
Explicita gränssnittsimplementeringar
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Kopierar hela CollectionBase till en kompatibel endimensionell Array, med början vid det angivna indexet för målmatrisen. (Ärvd från CollectionBase) |
| ICollection.IsSynchronized |
Hämtar ett värde som anger om åtkomsten CollectionBase till är synkroniserad (trådsäker). (Ärvd från CollectionBase) |
| ICollection.SyncRoot |
Hämtar ett objekt som kan användas för att synkronisera åtkomsten CollectionBasetill . (Ärvd från CollectionBase) |
| IList.Add(Object) |
Lägger till ett objekt i slutet av CollectionBase. (Ärvd från CollectionBase) |
| IList.Contains(Object) |
Avgör om innehåller CollectionBase ett specifikt element. (Ärvd från CollectionBase) |
| IList.IndexOf(Object) |
Söker efter den angivna Object och returnerar det nollbaserade indexet för den första förekomsten i hela CollectionBase. (Ärvd från CollectionBase) |
| IList.Insert(Int32, Object) |
Infogar ett element i CollectionBase det angivna indexet. (Ärvd från CollectionBase) |
| IList.IsFixedSize |
Hämtar ett värde som anger om har CollectionBase en fast storlek. (Ärvd från CollectionBase) |
| IList.IsReadOnly |
Hämtar ett värde som anger om är CollectionBase skrivskyddat. (Ärvd från CollectionBase) |
| IList.Item[Int32] |
Hämtar eller anger elementet vid det angivna indexet. (Ärvd från CollectionBase) |
| IList.Remove(Object) |
Tar bort den första förekomsten av ett specifikt objekt från CollectionBase. (Ärvd från CollectionBase) |
Tilläggsmetoder
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Möjliggör parallellisering av en fråga. |
| AsQueryable(IEnumerable) |
Konverterar en IEnumerable till en IQueryable. |
| Cast<TResult>(IEnumerable) |
Omvandlar elementen i en IEnumerable till den angivna typen. |
| OfType<TResult>(IEnumerable) |
Filtrerar elementen i en IEnumerable baserat på en angiven typ. |