CodeAttributeDeclarationCollection Osztály
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Objektumok gyűjteményét CodeAttributeDeclaration jelöli.
public ref class CodeAttributeDeclarationCollection : System::Collections::CollectionBase
public class CodeAttributeDeclarationCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeAttributeDeclarationCollection : System.Collections.CollectionBase
type CodeAttributeDeclarationCollection = class
inherit CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeAttributeDeclarationCollection = class
inherit CollectionBase
Public Class CodeAttributeDeclarationCollection
Inherits CollectionBase
- Öröklődés
- Attribútumok
Példák
Az alábbi példa az osztálymódszerek használatát CodeAttributeDeclarationCollection mutatja be.
// Creates an empty CodeAttributeDeclarationCollection.
CodeAttributeDeclarationCollection collection = new CodeAttributeDeclarationCollection();
// Adds a CodeAttributeDeclaration to the collection.
collection.Add( new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );
// Adds an array of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclaration[] declarations = { new CodeAttributeDeclaration(), new CodeAttributeDeclaration() };
collection.AddRange( declarations );
// Adds a collection of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclarationCollection declarationsCollection = new CodeAttributeDeclarationCollection();
declarationsCollection.Add( new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );
declarationsCollection.Add( new CodeAttributeDeclaration("BrowsableAttribute", new CodeAttributeArgument(new CodePrimitiveExpression(true))) );
collection.AddRange( declarationsCollection );
// Tests for the presence of a CodeAttributeDeclaration in
// the collection, and retrieves its index if it is found.
CodeAttributeDeclaration testdeclaration = new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description")) );
int itemIndex = -1;
if( collection.Contains( testdeclaration ) )
itemIndex = collection.IndexOf( testdeclaration );
// Copies the contents of the collection, beginning at index 0,
// to the specified CodeAttributeDeclaration array.
// 'declarations' is a CodeAttributeDeclaration array.
collection.CopyTo( declarations, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
// Inserts a CodeAttributeDeclaration at index 0 of the collection.
collection.Insert( 0, new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );
// Removes the specified CodeAttributeDeclaration from
// the collection.
CodeAttributeDeclaration declaration = new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description")) );
collection.Remove( declaration );
// Removes the CodeAttributeDeclaration at index 0.
collection.RemoveAt(0);
' Creates an empty CodeAttributeDeclarationCollection.
Dim collection As New CodeAttributeDeclarationCollection()
' Adds a CodeAttributeDeclaration to the collection.
collection.Add(New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))
' Adds an array of CodeAttributeDeclaration objects to the collection.
Dim declarations As CodeAttributeDeclaration() = {New CodeAttributeDeclaration(), New CodeAttributeDeclaration()}
collection.AddRange(declarations)
' Adds a collection of CodeAttributeDeclaration objects to
' the collection.
Dim declarationsCollection As New CodeAttributeDeclarationCollection()
declarationsCollection.Add(New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))
declarationsCollection.Add(New CodeAttributeDeclaration("BrowsableAttribute", New CodeAttributeArgument(New CodePrimitiveExpression(True))))
collection.AddRange(declarationsCollection)
' Tests for the presence of a CodeAttributeDeclaration in the
' collection, and retrieves its index if it is found.
Dim testdeclaration As New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description")))
Dim itemIndex As Integer = -1
If collection.Contains(testdeclaration) Then
itemIndex = collection.IndexOf(testdeclaration)
End If
' Copies the contents of the collection beginning at index 0 to the specified CodeAttributeDeclaration array.
' 'declarations' is a CodeAttributeDeclaration array.
collection.CopyTo(declarations, 0)
' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count
' Inserts a CodeAttributeDeclaration at index 0 of the collection.
collection.Insert(0, New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))
' Removes the specified CodeAttributeDeclaration from the collection.
Dim declaration As New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description")))
collection.Remove(declaration)
' Removes the CodeAttributeDeclaration at index 0.
collection.RemoveAt(0)
Megjegyzések
Az CodeAttributeDeclarationCollection osztály egy egyszerű gyűjteményobjektumot biztosít, amely objektumok készletének CodeAttributeDeclaration tárolására használható.
Konstruktorok
| Name | Description |
|---|---|
| CodeAttributeDeclarationCollection() |
Inicializálja a CodeAttributeDeclarationCollection osztály új példányát. |
| CodeAttributeDeclarationCollection(CodeAttributeDeclaration[]) |
Inicializálja a CodeAttributeDeclarationCollection megadott objektumtömböt CodeAttributeDeclaration tartalmazó osztály új példányát. |
| CodeAttributeDeclarationCollection(CodeAttributeDeclarationCollection) |
Inicializálja a CodeAttributeDeclarationCollection megadott forrásgyűjtemény elemeit tartalmazó osztály új példányát. |
Tulajdonságok
| Name | Description |
|---|---|
| Capacity |
Lekéri vagy beállítja a tartalmazható elemek CollectionBase számát. (Öröklődés forrása CollectionBase) |
| Count |
Lekéri a példányban CollectionBase található elemek számát. Ez a tulajdonság nem bírálható felül. (Öröklődés forrása CollectionBase) |
| InnerList |
ArrayList Lekéri a példány elemeinek CollectionBase listáját. (Öröklődés forrása CollectionBase) |
| Item[Int32] |
Lekéri vagy beállítja az CodeAttributeDeclaration objektumot a megadott indexen. |
| List |
IList Lekéri a példány elemeinek CollectionBase listáját. (Öröklődés forrása CollectionBase) |
Metódusok
| Name | Description |
|---|---|
| Add(CodeAttributeDeclaration) |
CodeAttributeDeclaration A megadott értékkel rendelkező objektumot ad hozzá a gyűjteményhez. |
| AddRange(CodeAttributeDeclaration[]) |
Másolja a megadott CodeAttributeDeclaration tömb elemeit a gyűjtemény végére. |
| AddRange(CodeAttributeDeclarationCollection) |
Másolja egy másik CodeAttributeDeclarationCollection objektum tartalmát a gyűjtemény végére. |
| Clear() |
Eltávolítja az összes objektumot a CollectionBase példányból. Ez a metódus nem bírálható felül. (Öröklődés forrása CollectionBase) |
| Contains(CodeAttributeDeclaration) |
Lekéri vagy beállít egy értéket, amely jelzi, hogy a gyűjtemény tartalmazza-e a megadott CodeAttributeDeclaration objektumot. |
| CopyTo(CodeAttributeDeclaration[], Int32) |
A gyűjteményobjektumokat a megadott indextől kezdődő egydimenziós Array példányba másolja. |
| Equals(Object) |
Meghatározza, hogy a megadott objektum egyenlő-e az aktuális objektummal. (Öröklődés forrása Object) |
| GetEnumerator() |
Egy enumerátort ad vissza, amely a példányon keresztül CollectionBase iterál. (Öröklődés forrása CollectionBase) |
| GetHashCode() |
Ez az alapértelmezett kivonatoló függvény. (Öröklődés forrása Object) |
| GetType() |
Lekéri az Type aktuális példányt. (Öröklődés forrása Object) |
| IndexOf(CodeAttributeDeclaration) |
Lekéri a gyűjteményben megadott CodeAttributeDeclaration objektum indexét, ha az a gyűjteményben található. |
| Insert(Int32, CodeAttributeDeclaration) |
Beszúrja a megadott CodeAttributeDeclaration objektumot a megadott index gyűjteményébe. |
| MemberwiseClone() |
Az aktuális Objectpéldány sekély másolatát hozza létre. (Öröklődés forrása Object) |
| OnClear() |
További egyéni folyamatokat hajt végre a példány tartalmának CollectionBase törlésekor. (Öröklődés forrása CollectionBase) |
| OnClearComplete() |
További egyéni folyamatokat hajt végre a példány tartalmának CollectionBase törlése után. (Öröklődés forrása CollectionBase) |
| OnInsert(Int32, Object) |
További egyéni folyamatokat hajt végre, mielőtt új elemet szúr be a CollectionBase példányba. (Öröklődés forrása CollectionBase) |
| OnInsertComplete(Int32, Object) |
További egyéni folyamatokat hajt végre, miután beszúrt egy új elemet a CollectionBase példányba. (Öröklődés forrása CollectionBase) |
| OnRemove(Int32, Object) |
További egyéni folyamatokat hajt végre, amikor eltávolít egy elemet a CollectionBase példányból. (Öröklődés forrása CollectionBase) |
| OnRemoveComplete(Int32, Object) |
További egyéni folyamatokat hajt végre, miután eltávolított egy elemet a CollectionBase példányból. (Öröklődés forrása CollectionBase) |
| OnSet(Int32, Object, Object) |
További egyéni folyamatokat hajt végre, mielőtt beállít egy értéket a CollectionBase példányban. (Öröklődés forrása CollectionBase) |
| OnSetComplete(Int32, Object, Object) |
További egyéni folyamatokat hajt végre, miután beállított egy értéket a CollectionBase példányban. (Öröklődés forrása CollectionBase) |
| OnValidate(Object) |
További egyéni folyamatokat hajt végre egy érték ellenőrzésekor. (Öröklődés forrása CollectionBase) |
| Remove(CodeAttributeDeclaration) |
Eltávolítja a megadott CodeAttributeDeclaration objektumot a gyűjteményből. |
| RemoveAt(Int32) |
Eltávolítja az elemet a példány megadott indexéből CollectionBase . Ez a módszer nem bírálható felül. (Öröklődés forrása CollectionBase) |
| ToString() |
Az aktuális objektumot jelképező sztringet ad vissza. (Öröklődés forrása Object) |
Explicit interfész-implementációk
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
A teljes CollectionBase példányt egy kompatibilis egydimenziósra Arraymásolja a céltömb megadott indexétől kezdve. (Öröklődés forrása CollectionBase) |
| ICollection.IsSynchronized |
Beolvas egy értéket, amely jelzi, hogy a CollectionBase hozzáférés szinkronizálva van-e (a szál biztonságos). (Öröklődés forrása CollectionBase) |
| ICollection.SyncRoot |
Lekéri az objektumot, amely a hozzáférés szinkronizálására használható.CollectionBase (Öröklődés forrása CollectionBase) |
| IList.Add(Object) |
Objektumot ad hozzá a CollectionBasevégéhez. (Öröklődés forrása CollectionBase) |
| IList.Contains(Object) |
Meghatározza, hogy az CollectionBase adott elem tartalmaz-e. (Öröklődés forrása CollectionBase) |
| IList.IndexOf(Object) |
Megkeresi a megadott Object értéket, és a teljes első CollectionBaseelőfordulás nulla alapú indexét adja vissza. (Öröklődés forrása CollectionBase) |
| IList.Insert(Int32, Object) |
Elemet szúr be a CollectionBase megadott indexbe. (Öröklődés forrása CollectionBase) |
| IList.IsFixedSize |
Egy értéket kap, amely jelzi, hogy a CollectionBase méret rögzített-e. (Öröklődés forrása CollectionBase) |
| IList.IsReadOnly |
Beolvas egy értéket, amely jelzi, hogy az CollectionBase írásvédett-e. (Öröklődés forrása CollectionBase) |
| IList.Item[Int32] |
Lekéri vagy beállítja az elemet a megadott indexen. (Öröklődés forrása CollectionBase) |
| IList.Remove(Object) |
Eltávolítja egy adott objektum első előfordulását a CollectionBase. (Öröklődés forrása CollectionBase) |
Bővítő metódusok
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Lehetővé teszi a lekérdezés párhuzamosítását. |
| AsQueryable(IEnumerable) |
Átalakítja az egyiket IEnumerableIQueryable. |
| Cast<TResult>(IEnumerable) |
Egy elem elemeit IEnumerable a megadott típusra veti. |
| OfType<TResult>(IEnumerable) |
Egy adott típus alapján szűri IEnumerable egy adott elem elemeit. |