DesignerVerbCollection Classe

Definizione

Rappresenta una raccolta di DesignerVerb oggetti .

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
Ereditarietà
DesignerVerbCollection
Derivato
Attributi

Esempio

Nell'esempio di codice seguente viene illustrato come usare la DesignerVerbCollection classe . Nell'esempio viene creata una nuova istanza della classe e vengono utilizzati diversi metodi per aggiungere istruzioni alla raccolta, restituire il relativo indice e aggiungere o rimuovere attributi in un punto di indice specifico.

// 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)

Commenti

Questa classe fornisce una raccolta che può contenere DesignerVerb oggetti .

Costruttori

Nome Descrizione
DesignerVerbCollection()

Inizializza una nuova istanza della classe DesignerVerbCollection.

DesignerVerbCollection(DesignerVerb[])

Inizializza una nuova istanza della DesignerVerbCollection classe utilizzando la matrice di DesignerVerb oggetti specificata.

Proprietà

Nome Descrizione
Capacity

Ottiene o imposta il numero di elementi che l'oggetto CollectionBase può contenere.

(Ereditato da CollectionBase)
Count

Ottiene il numero di elementi contenuti nell'istanza CollectionBase di . Impossibile eseguire l'override di questa proprietà.

(Ereditato da CollectionBase)
InnerList

Ottiene un oggetto ArrayList contenente l'elenco di elementi nell'istanza CollectionBase di .

(Ereditato da CollectionBase)
Item[Int32]

Ottiene o imposta l'oggetto DesignerVerb in corrispondenza dell'indice specificato.

List

Ottiene un oggetto IList contenente l'elenco di elementi nell'istanza CollectionBase di .

(Ereditato da CollectionBase)

Metodi

Nome Descrizione
Add(DesignerVerb)

Aggiunge l'oggetto specificato DesignerVerb all'insieme.

AddRange(DesignerVerb[])

Aggiunge il set specificato di verbi della finestra di progettazione all'insieme.

AddRange(DesignerVerbCollection)

Aggiunge l'insieme specificato di verbi della finestra di progettazione all'insieme.

Clear()

Rimuove tutti gli oggetti dall'istanza CollectionBase di . Non è possibile eseguire l'override di questo metodo.

(Ereditato da CollectionBase)
Contains(DesignerVerb)

Ottiene un valore che indica se l'oggetto specificato DesignerVerb esiste nell'insieme.

CopyTo(DesignerVerb[], Int32)

Copia i membri dell'insieme nella matrice specificata DesignerVerb a partire dall'indice di destinazione specificato.

Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetEnumerator()

Restituisce un enumeratore che scorre l'istanza CollectionBase di .

(Ereditato da CollectionBase)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
IndexOf(DesignerVerb)

Ottiene l'indice dell'oggetto specificato DesignerVerb.

Insert(Int32, DesignerVerb)

Inserisce l'oggetto specificato DesignerVerb in corrispondenza dell'indice specificato.

MemberwiseClone()

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
OnClear()

Genera l'evento Clear.

OnClearComplete()

Esegue processi personalizzati aggiuntivi dopo la cancellazione del contenuto dell'istanza CollectionBase .

(Ereditato da CollectionBase)
OnInsert(Int32, Object)

Genera l'evento Insert.

OnInsertComplete(Int32, Object)

Esegue processi personalizzati aggiuntivi dopo l'inserimento di un nuovo elemento nell'istanza CollectionBase di .

(Ereditato da CollectionBase)
OnRemove(Int32, Object)

Genera l'evento Remove.

OnRemoveComplete(Int32, Object)

Esegue processi personalizzati aggiuntivi dopo la rimozione di un elemento dall'istanza CollectionBase di .

(Ereditato da CollectionBase)
OnSet(Int32, Object, Object)

Genera l'evento Set.

OnSetComplete(Int32, Object, Object)

Esegue processi personalizzati aggiuntivi dopo aver impostato un valore nell'istanza CollectionBase di .

(Ereditato da CollectionBase)
OnValidate(Object)

Genera l'evento Validate.

Remove(DesignerVerb)

Rimuove l'oggetto specificato DesignerVerb dalla raccolta.

RemoveAt(Int32)

Rimuove l'elemento in corrispondenza dell'indice specificato dell'istanza CollectionBase . Questo metodo non è sostituibile.

(Ereditato da CollectionBase)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Implementazioni dell'interfaccia esplicita

Nome Descrizione
ICollection.CopyTo(Array, Int32)

Copia l'intero CollectionBase oggetto in un oggetto unidimensionale Arraycompatibile, a partire dall'indice specificato della matrice di destinazione.

(Ereditato da CollectionBase)
ICollection.IsSynchronized

Ottiene un valore che indica se l'accesso CollectionBase a è sincronizzato (thread-safe).

(Ereditato da CollectionBase)
ICollection.SyncRoot

Ottiene un oggetto che può essere utilizzato per sincronizzare l'accesso al CollectionBase.

(Ereditato da CollectionBase)
IList.Add(Object)

Aggiunge un oggetto alla fine dell'oggetto CollectionBase.

(Ereditato da CollectionBase)
IList.Contains(Object)

Determina se contiene CollectionBase un elemento specifico.

(Ereditato da CollectionBase)
IList.IndexOf(Object)

Cerca l'oggetto specificato Object e restituisce l'indice in base zero della prima occorrenza all'interno dell'intero CollectionBaseoggetto .

(Ereditato da CollectionBase)
IList.Insert(Int32, Object)

Inserisce un elemento nell'oggetto CollectionBase in corrispondenza dell'indice specificato.

(Ereditato da CollectionBase)
IList.IsFixedSize

Ottiene un valore che indica se ha CollectionBase una dimensione fissa.

(Ereditato da CollectionBase)
IList.IsReadOnly

Ottiene un valore che indica se il CollectionBase è di sola lettura.

(Ereditato da CollectionBase)
IList.Item[Int32]

Ottiene o imposta l'elemento in corrispondenza dell'indice specificato.

(Ereditato da CollectionBase)
IList.Remove(Object)

Rimuove la prima occorrenza di un oggetto specifico da CollectionBase.

(Ereditato da CollectionBase)

Metodi di estensione

Nome Descrizione
AsParallel(IEnumerable)

Abilita la parallelizzazione di una query.

AsQueryable(IEnumerable)

Converte un IEnumerable in un IQueryable.

Cast<TResult>(IEnumerable)

Esegue il cast degli elementi di un IEnumerable al tipo specificato.

OfType<TResult>(IEnumerable)

Filtra gli elementi di un IEnumerable in base a un tipo specificato.

Si applica a