CodeTypeReferenceCollection Osztály

Definíció

Objektumok gyűjteményét CodeTypeReference jelöli.

public ref class CodeTypeReferenceCollection : System::Collections::CollectionBase
public class CodeTypeReferenceCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeTypeReferenceCollection : System.Collections.CollectionBase
type CodeTypeReferenceCollection = class
    inherit CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeTypeReferenceCollection = class
    inherit CollectionBase
Public Class CodeTypeReferenceCollection
Inherits CollectionBase
Öröklődés
CodeTypeReferenceCollection
Attribútumok

Példák

// Creates an empty CodeTypeReferenceCollection.
CodeTypeReferenceCollection collection = new CodeTypeReferenceCollection();

// Adds a CodeTypeReference to the collection.
collection.Add( new CodeTypeReference(typeof(bool)) );

// Adds an array of CodeTypeReference objects to the collection.
CodeTypeReference[] references = { new CodeTypeReference(typeof(bool)), new CodeTypeReference(typeof(bool)) };
collection.AddRange( references );

// Adds a collection of CodeTypeReference objects to the collection.
CodeTypeReferenceCollection referencesCollection = new CodeTypeReferenceCollection();
referencesCollection.Add( new CodeTypeReference(typeof(bool)) );
referencesCollection.Add( new CodeTypeReference(typeof(bool)) );
collection.AddRange( referencesCollection );

// Tests for the presence of a CodeTypeReference in the
// collection, and retrieves its index if it is found.
CodeTypeReference testReference = new CodeTypeReference(typeof(bool));
int itemIndex = -1;
if( collection.Contains( testReference ) )
    itemIndex = collection.IndexOf( testReference );

// Copies the contents of the collection, beginning at index 0,
// to the specified CodeTypeReference array.
// 'references' is a CodeTypeReference array.
collection.CopyTo( references, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;

// Inserts a CodeTypeReference at index 0 of the collection.
collection.Insert( 0, new CodeTypeReference(typeof(bool)) );

// Removes the specified CodeTypeReference from the collection.
CodeTypeReference reference = new CodeTypeReference(typeof(bool));
collection.Remove( reference );

// Removes the CodeTypeReference at index 0.
collection.RemoveAt(0);
' Creates an empty CodeTypeReferenceCollection.
Dim collection As New CodeTypeReferenceCollection()

' Adds a CodeTypeReference to the collection.
collection.Add(New CodeTypeReference(GetType(Boolean)))

' Adds an array of CodeTypeReference objects to the collection.
Dim references As CodeTypeReference() = {New CodeTypeReference(GetType(Boolean)), New CodeTypeReference(GetType(Boolean))}
collection.AddRange(references)

' Adds a collection of CodeTypeReference objects to the collection.
Dim referencesCollection As New CodeTypeReferenceCollection()
referencesCollection.Add(New CodeTypeReference(GetType(Boolean)))
referencesCollection.Add(New CodeTypeReference(GetType(Boolean)))
collection.AddRange(referencesCollection)

' Tests for the presence of a CodeTypeReference in the 
' collection, and retrieves its index if it is found.
Dim testReference As New CodeTypeReference(GetType(Boolean))
Dim itemIndex As Integer = -1
If collection.Contains(testReference) Then
    itemIndex = collection.IndexOf(testReference)
End If

' Copies the contents of the collection, beginning at index 0, 
' to the specified CodeTypeReference array.
' 'references' is a CodeTypeReference array.
collection.CopyTo(references, 0)

' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count

' Inserts a CodeTypeReference at index 0 of the collection.
collection.Insert(0, New CodeTypeReference(GetType(Boolean)))

' Removes the specified CodeTypeReference from the collection.
Dim reference As New CodeTypeReference(GetType(Boolean))
collection.Remove(reference)

' Removes the CodeTypeReference at index 0.
collection.RemoveAt(0)

Megjegyzések

Az CodeTypeReferenceCollection osztály egy egyszerű gyűjteményobjektumot biztosít, amely objektumok készletének CodeTypeReference tárolására használható.

Konstruktorok

Name Description
CodeTypeReferenceCollection()

Inicializálja a CodeTypeReferenceCollection osztály új példányát.

CodeTypeReferenceCollection(CodeTypeReference[])

Inicializálja a CodeTypeReferenceCollection megadott objektumtömböt CodeTypeReference tartalmazó osztály új példányát.

CodeTypeReferenceCollection(CodeTypeReferenceCollection)

Inicializálja a CodeTypeReferenceCollection 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 a CodeTypeReference gyűjtemény megadott indexét.

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(CodeTypeReference)

Hozzáadja a megadottt CodeTypeReference a gyűjteményhez.

Add(String)

A megadott adattípusnévvel ad hozzá egy CodeTypeReference gyűjteményt.

Add(Type)

A megadott adattípussal ad hozzá egy CodeTypeReference gyűjteményt.

AddRange(CodeTypeReference[])

Másolja a megadott CodeTypeReference tömb elemeit a gyűjtemény végére.

AddRange(CodeTypeReferenceCollection)

Hozzáadja a megadott CodeTypeReferenceCollection tartalmat a gyűjtemény végéhez.

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(CodeTypeReference)

Beolvas egy értéket, amely jelzi, hogy a gyűjtemény tartalmazza-e a megadott CodeTypeReferenceértéket.

CopyTo(CodeTypeReference[], Int32)

Másolja a gyűjtemény elemeit a megadott egydimenziósra Array a megadott indexben.

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(CodeTypeReference)

Lekéri az indexet a megadott CodeTypeReferencegyűjteményben, ha létezik a gyűjteményben.

Insert(Int32, CodeTypeReference)

Beszúr egy CodeTypeReference elemet a gyűjteménybe a megadott indexen.

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(CodeTypeReference)

Eltávolítja a megadottt CodeTypeReference 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.

A következőre érvényes:

Lásd még