DesignerVerbCollection Klasse
Definition
Stellt eine Auflistung vonDesignerVerb-Objekten dar.Represents a collection of DesignerVerb objects.
public ref class DesignerVerbCollection : System::Collections::CollectionBase
public class DesignerVerbCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ComVisible(true)]
public class DesignerVerbCollection : System.Collections.CollectionBase
type DesignerVerbCollection = class
inherit CollectionBase
[<System.Runtime.InteropServices.ComVisible(true)>]
type DesignerVerbCollection = class
inherit CollectionBase
Public Class DesignerVerbCollection
Inherits CollectionBase
- Vererbung
- Abgeleitet
- Attribute
Beispiele
Im folgenden Codebeispiel wird die Verwendung der- DesignerVerbCollection Klasse veranschaulicht.The following code example demonstrates how to use the DesignerVerbCollection class. Im Beispiel wird eine neue Instanz der-Klasse erstellt, und es werden mehrere Methoden zum Hinzufügen von-Anweisungen zur Auflistung, zum Zurückgeben des Indexes und zum Hinzufügen oder Entfernen von Attributen an einem bestimmten Index Punkt verwendet.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.
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)
Hinweise
Diese Klasse stellt eine Auflistung bereit, die-Objekte enthalten kann DesignerVerb .This class provides a collection that can contain DesignerVerb objects.
Konstruktoren
DesignerVerbCollection() |
Initialisiert eine neue Instanz der DesignerVerbCollection-Klasse.Initializes a new instance of the DesignerVerbCollection class. |
DesignerVerbCollection(DesignerVerb[]) |
Initialisiert eine neue Instanz der DesignerVerbCollection-Klasse unter Verwendung des angegebenen Arrays von DesignerVerb-Objekten.Initializes a new instance of the DesignerVerbCollection class using the specified array of DesignerVerb objects. |
Eigenschaften
Capacity |
Ruft die Anzahl der Elemente ab, die die CollectionBase enthalten kann, oder legt diese fest.Gets or sets the number of elements that the CollectionBase can contain. (Geerbt von CollectionBase) |
Count |
Ruft die Anzahl der in der CollectionBase-Instanz enthaltenen Elemente ab.Gets the number of elements contained in the CollectionBase instance. Diese Eigenschaft kann nicht überschrieben werden.This property cannot be overridden. (Geerbt von CollectionBase) |
InnerList |
Ruft eine ArrayList mit der Liste der Elemente in der CollectionBase-Instanz ab.Gets an ArrayList containing the list of elements in the CollectionBase instance. (Geerbt von CollectionBase) |
Item[Int32] |
Ruft die DesignerVerb-Klasse am angegebenen Index ab oder legt diese fest.Gets or sets the DesignerVerb at the specified index. |
List |
Ruft eine IList mit der Liste der Elemente in der CollectionBase-Instanz ab.Gets an IList containing the list of elements in the CollectionBase instance. (Geerbt von CollectionBase) |
Methoden
Add(DesignerVerb) |
Fügt der Auflistung den angegebenen DesignerVerb hinzu.Adds the specified DesignerVerb to the collection. |
AddRange(DesignerVerb[]) |
Fügt den angegebenen Satz von Designerverben der Auflistung hinzu.Adds the specified set of designer verbs to the collection. |
AddRange(DesignerVerbCollection) |
Fügt die angegebene Auflistung von Designerverben der Auflistung hinzu.Adds the specified collection of designer verbs to the collection. |
Clear() |
Entfernt alle Objekte aus der CollectionBase-Instanz.Removes all objects from the CollectionBase instance. Diese Methode kann nicht überschrieben werden.This method cannot be overridden. (Geerbt von CollectionBase) |
Contains(DesignerVerb) |
Ruft einen Wert ab, der angibt, ob das angegebene DesignerVerb in der Auflistung vorhanden ist.Gets a value indicating whether the specified DesignerVerb exists in the collection. |
CopyTo(DesignerVerb[], Int32) |
Kopiert die Auflistungsmember in das angegebene DesignerVerb-Array, beginnend am angegebenen Zielindex.Copies the collection members to the specified DesignerVerb array beginning at the specified destination index. |
Equals(Object) |
Bestimmt, ob das angegebene Objekt mit dem aktuellen Objekt identisch ist.Determines whether the specified object is equal to the current object. (Geerbt von Object) |
GetEnumerator() |
Gibt einen Enumerator zurück, der die CollectionBase durchläuft.Returns an enumerator that iterates through the CollectionBase instance. (Geerbt von CollectionBase) |
GetHashCode() |
Fungiert als Standardhashfunktion.Serves as the default hash function. (Geerbt von Object) |
GetType() |
Ruft den Type der aktuellen Instanz ab.Gets the Type of the current instance. (Geerbt von Object) |
IndexOf(DesignerVerb) |
Ruft den Index der angegebenen DesignerVerb ab.Gets the index of the specified DesignerVerb. |
Insert(Int32, DesignerVerb) |
Fügt das angegebene DesignerVerb am angegebenen Index ein.Inserts the specified DesignerVerb at the specified index. |
MemberwiseClone() |
Erstellt eine flache Kopie des aktuellen Object.Creates a shallow copy of the current Object. (Geerbt von Object) |
OnClear() |
Löst das |
OnClearComplete() |
Führt nach dem Löschen des Inhalts der CollectionBase-Instanz zusätzliche benutzerdefinierte Prozesse aus.Performs additional custom processes after clearing the contents of the CollectionBase instance. (Geerbt von CollectionBase) |
OnInsert(Int32, Object) |
Löst das |
OnInsertComplete(Int32, Object) |
Führt zusätzliche benutzerdefinierte Prozesse nach dem Einfügen eines neuen Elements in die CollectionBase-Instanz aus.Performs additional custom processes after inserting a new element into the CollectionBase instance. (Geerbt von CollectionBase) |
OnRemove(Int32, Object) |
Löst das |
OnRemoveComplete(Int32, Object) |
Führt zusätzliche benutzerdefinierte Prozesse nach dem Entfernen eines Elements aus der CollectionBase-Instanz aus.Performs additional custom processes after removing an element from the CollectionBase instance. (Geerbt von CollectionBase) |
OnSet(Int32, Object, Object) |
Löst das |
OnSetComplete(Int32, Object, Object) |
Führt zusätzliche benutzerdefinierte Prozesse nach dem Festlegen eines Werts in der CollectionBase-Instanz aus.Performs additional custom processes after setting a value in the CollectionBase instance. (Geerbt von CollectionBase) |
OnValidate(Object) |
Löst das |
Remove(DesignerVerb) |
Entfernt den angegebenen DesignerVerb aus der Auflistung.Removes the specified DesignerVerb from the collection. |
RemoveAt(Int32) |
Entfernt das Element am angegebenen Index aus der CollectionBase-Instanz.Removes the element at the specified index of the CollectionBase instance. Diese Methode kann nicht überschrieben werden.This method is not overridable. (Geerbt von CollectionBase) |
ToString() |
Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.Returns a string that represents the current object. (Geerbt von Object) |
Explizite Schnittstellenimplementierungen
ICollection.CopyTo(Array, Int32) |
Kopiert die gesamte CollectionBase-Instanz in ein kompatibles eindimensionales Array, beginnend am angegebenen Index des Zielarrays.Copies the entire CollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array. (Geerbt von CollectionBase) |
ICollection.IsSynchronized |
Ruft einen Wert ab, der angibt, ob der Zugriff auf die CollectionBase synchronisiert (threadsicher) ist.Gets a value indicating whether access to the CollectionBase is synchronized (thread safe). (Geerbt von CollectionBase) |
ICollection.SyncRoot |
Ruft ein Objekt ab, mit dem der Zugriff auf CollectionBase synchronisiert werden kann.Gets an object that can be used to synchronize access to the CollectionBase. (Geerbt von CollectionBase) |
IList.Add(Object) |
Fügt am Ende der CollectionBase ein Objekt hinzu.Adds an object to the end of the CollectionBase. (Geerbt von CollectionBase) |
IList.Contains(Object) |
Ermittelt, ob CollectionBase ein bestimmtes Element enthält.Determines whether the CollectionBase contains a specific element. (Geerbt von CollectionBase) |
IList.IndexOf(Object) |
Sucht nach dem angegebenen Object und gibt den nullbasierten Index des ersten Vorkommens innerhalb der gesamten CollectionBase zurück.Searches for the specified Object and returns the zero-based index of the first occurrence within the entire CollectionBase. (Geerbt von CollectionBase) |
IList.Insert(Int32, Object) |
Fügt am angegebenen Index ein Element in die CollectionBase ein.Inserts an element into the CollectionBase at the specified index. (Geerbt von CollectionBase) |
IList.IsFixedSize |
Ruft einen Wert ab, der angibt, ob das CollectionBase eine feste Größe aufweist.Gets a value indicating whether the CollectionBase has a fixed size. (Geerbt von CollectionBase) |
IList.IsReadOnly |
Ruft einen Wert ab, der angibt, ob das CollectionBase schreibgeschützt ist.Gets a value indicating whether the CollectionBase is read-only. (Geerbt von CollectionBase) |
IList.Item[Int32] |
Ruft das Element am angegebenen Index ab oder legt dieses fest.Gets or sets the element at the specified index. (Geerbt von CollectionBase) |
IList.Remove(Object) |
Entfernt das erste Vorkommen eines angegebenen Objekts aus der CollectionBase.Removes the first occurrence of a specific object from the CollectionBase. (Geerbt von CollectionBase) |
Erweiterungsmethoden
Cast<TResult>(IEnumerable) |
Wandelt die Elemente eines IEnumerable in den angegebenen Typ umCasts the elements of an IEnumerable to the specified type. |
OfType<TResult>(IEnumerable) |
Filtert die Elemente eines IEnumerable anhand eines angegebenen TypsFilters the elements of an IEnumerable based on a specified type. |
AsParallel(IEnumerable) |
Ermöglicht die Parallelisierung einer Abfrage.Enables parallelization of a query. |
AsQueryable(IEnumerable) |
Konvertiert einen IEnumerable in einen IQueryable.Converts an IEnumerable to an IQueryable. |