DesignerVerbCollection Třída
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Představuje kolekci DesignerVerb objektů.
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
- Dědičnost
- Odvozené
- Atributy
Příklady
Následující příklad kódu ukazuje, jak používat DesignerVerbCollection třídu. Příklad vytvoří novou instanci třídy a pomocí několika metod přidá příkazy do kolekce, vrátí jejich index a přidá nebo odebere atributy v určitém bodu indexu.
// 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)
Poznámky
Tato třída poskytuje kolekci, která může obsahovat DesignerVerb objekty.
Konstruktory
| Name | Description |
|---|---|
| DesignerVerbCollection() |
Inicializuje novou instanci DesignerVerbCollection třídy. |
| DesignerVerbCollection(DesignerVerb[]) |
Inicializuje novou instanci DesignerVerbCollection třídy pomocí zadané pole DesignerVerb objektů. |
Vlastnosti
| Name | Description |
|---|---|
| Capacity |
Získá nebo nastaví počet prvků, které CollectionBase může obsahovat. (Zděděno od CollectionBase) |
| Count |
Získá počet prvků obsažených CollectionBase v instanci. Tuto vlastnost nelze přepsat. (Zděděno od CollectionBase) |
| InnerList |
ArrayList Získá obsahující seznam prvků v CollectionBase instanci. (Zděděno od CollectionBase) |
| Item[Int32] |
Získá nebo nastaví v zadaném indexu DesignerVerb . |
| List |
IList Získá obsahující seznam prvků v CollectionBase instanci. (Zděděno od CollectionBase) |
Metody
| Name | Description |
|---|---|
| Add(DesignerVerb) |
Přidá zadaný DesignerVerb objekt do kolekce. |
| AddRange(DesignerVerb[]) |
Přidá zadanou sadu příkazů návrháře do kolekce. |
| AddRange(DesignerVerbCollection) |
Přidá zadanou kolekci příkazů návrháře do kolekce. |
| Clear() |
Odebere všechny objekty z CollectionBase instance. Tuto metodu nelze přepsat. (Zděděno od CollectionBase) |
| Contains(DesignerVerb) |
Získá hodnotu určující, zda zadaný DesignerVerb existuje v kolekci. |
| CopyTo(DesignerVerb[], Int32) |
Zkopíruje členy kolekce do zadaného DesignerVerb pole počínaje zadaným cílovým indexem. |
| Equals(Object) |
Určuje, zda je zadaný objekt roven aktuálnímu objektu. (Zděděno od Object) |
| GetEnumerator() |
Vrátí enumerátor, který iteruje prostřednictvím CollectionBase instance. (Zděděno od CollectionBase) |
| GetHashCode() |
Slouží jako výchozí funkce hash. (Zděděno od Object) |
| GetType() |
Získá Type aktuální instance. (Zděděno od Object) |
| IndexOf(DesignerVerb) |
Získá index zadaného DesignerVerb. |
| Insert(Int32, DesignerVerb) |
Vloží zadaný DesignerVerb index. |
| MemberwiseClone() |
Vytvoří mělkou kopii aktuálního Object. (Zděděno od Object) |
| OnClear() |
|
| OnClear() |
Provádí další vlastní procesy při vymazání obsahu CollectionBase instance. (Zděděno od CollectionBase) |
| OnClearComplete() |
Provádí další vlastní procesy po vymazání obsahu CollectionBase instance. (Zděděno od CollectionBase) |
| OnInsert(Int32, Object) |
|
| OnInsert(Int32, Object) |
Provádí další vlastní procesy před vložením nového prvku do CollectionBase instance. (Zděděno od CollectionBase) |
| OnInsertComplete(Int32, Object) |
Provede další vlastní procesy po vložení nového prvku do CollectionBase instance. (Zděděno od CollectionBase) |
| OnRemove(Int32, Object) |
|
| OnRemove(Int32, Object) |
Provádí další vlastní procesy při odebírání elementu CollectionBase z instance. (Zděděno od CollectionBase) |
| OnRemoveComplete(Int32, Object) |
Provádí další vlastní procesy po odebrání elementu CollectionBase z instance. (Zděděno od CollectionBase) |
| OnSet(Int32, Object, Object) |
|
| OnSet(Int32, Object, Object) |
Před nastavením hodnoty v CollectionBase instanci provede další vlastní procesy. (Zděděno od CollectionBase) |
| OnSetComplete(Int32, Object, Object) |
Provede další vlastní procesy po nastavení hodnoty v CollectionBase instanci. (Zděděno od CollectionBase) |
| OnValidate(Object) |
|
| Remove(DesignerVerb) |
Odebere zadanou DesignerVerb položku z kolekce. |
| RemoveAt(Int32) |
Odebere prvek v zadaném indexu CollectionBase instance. Tato metoda není přepsatelná. (Zděděno od CollectionBase) |
| ToString() |
Vrátí řetězec, který představuje aktuální objekt. (Zděděno od Object) |
Explicitní implementace rozhraní
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Zkopíruje celý CollectionBase soubor do kompatibilního jednorozměrného Array, počínaje zadaným indexem cílového pole. (Zděděno od CollectionBase) |
| ICollection.IsSynchronized |
Získá hodnotu označující, zda je přístup k CollectionBase této synchronizaci (bezpečné vlákno). (Zděděno od CollectionBase) |
| ICollection.SyncRoot |
Získá objekt, který lze použít k synchronizaci přístupu k CollectionBase. (Zděděno od CollectionBase) |
| IList.Add(Object) |
Přidá objekt na konec objektu CollectionBase. (Zděděno od CollectionBase) |
| IList.Contains(Object) |
Určuje, zda obsahuje CollectionBase určitý prvek. (Zděděno od CollectionBase) |
| IList.IndexOf(Object) |
Vyhledá zadaný Object index a vrátí index založený na nule prvního výskytu v celém CollectionBaserozsahu . (Zděděno od CollectionBase) |
| IList.Insert(Int32, Object) |
Vloží prvek do zadaného indexu CollectionBase . (Zděděno od CollectionBase) |
| IList.IsFixedSize |
Získá hodnotu určující, zda CollectionBase má pevnou velikost. (Zděděno od CollectionBase) |
| IList.IsReadOnly |
Získá hodnotu určující, zda je jen pro CollectionBase čtení. (Zděděno od CollectionBase) |
| IList.Item[Int32] |
Získá nebo nastaví prvek v zadaném indexu. (Zděděno od CollectionBase) |
| IList.Remove(Object) |
Odebere první výskyt konkrétního objektu z objektu CollectionBase. (Zděděno od CollectionBase) |
Metody rozšíření
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Umožňuje paralelizaci dotazu. |
| AsQueryable(IEnumerable) |
Převede IEnumerable na IQueryable. |
| Cast<TResult>(IEnumerable) |
Přetypuje prvky IEnumerable na zadaný typ. |
| OfType<TResult>(IEnumerable) |
Filtruje prvky IEnumerable na základě zadaného typu. |