Bagikan melalui


CodeAttributeArgumentCollection Kelas

Definisi

Mewakili kumpulan CodeAttributeArgument objek.

public ref class CodeAttributeArgumentCollection : System::Collections::CollectionBase
public class CodeAttributeArgumentCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeAttributeArgumentCollection : System.Collections.CollectionBase
type CodeAttributeArgumentCollection = class
    inherit CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeAttributeArgumentCollection = class
    inherit CollectionBase
Public Class CodeAttributeArgumentCollection
Inherits CollectionBase
Warisan
CodeAttributeArgumentCollection
Atribut

Contoh

Contoh berikut menunjukkan penggunaan CodeAttributeArgumentCollection metode kelas. Contoh membuat instans baru kelas dan menggunakan metode untuk menambahkan pernyataan ke koleksi, mengembalikan indeksnya, dan menambahkan atau menghapus atribut pada titik indeks tertentu.

// Creates an empty CodeAttributeArgumentCollection.
CodeAttributeArgumentCollection^ collection = gcnew CodeAttributeArgumentCollection;

// Adds a CodeAttributeArgument to the collection.
collection->Add( gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) ) );

// Adds an array of CodeAttributeArgument objects to the collection.
array<CodeAttributeArgument^>^arguments = {gcnew CodeAttributeArgument,gcnew CodeAttributeArgument};
collection->AddRange( arguments );

// Adds a collection of CodeAttributeArgument objects to 
// the collection.
CodeAttributeArgumentCollection^ argumentsCollection = gcnew CodeAttributeArgumentCollection;
argumentsCollection->Add( gcnew CodeAttributeArgument( "TestBooleanArgument",gcnew CodePrimitiveExpression( true ) ) );
argumentsCollection->Add( gcnew CodeAttributeArgument( "TestIntArgument",gcnew CodePrimitiveExpression( 1 ) ) );
collection->AddRange( argumentsCollection );

// Tests for the presence of a CodeAttributeArgument 
// within the collection, and retrieves its index if it is found.
CodeAttributeArgument^ testArgument = gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) );
int itemIndex = -1;
if ( collection->Contains( testArgument ) )
   itemIndex = collection->IndexOf( testArgument );

// Copies the contents of the collection beginning at index 0,
// to the specified CodeAttributeArgument array.
// 'arguments' is a CodeAttributeArgument array.
collection->CopyTo( arguments, 0 );

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

// Inserts a CodeAttributeArgument at index 0 of the collection.
collection->Insert( 0, gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) ) );

// Removes the specified CodeAttributeArgument from the collection.
CodeAttributeArgument^ argument = gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) );
collection->Remove( argument );

// Removes the CodeAttributeArgument at index 0.
collection->RemoveAt( 0 );
// Creates an empty CodeAttributeArgumentCollection.
CodeAttributeArgumentCollection collection = new CodeAttributeArgumentCollection();

// Adds a CodeAttributeArgument to the collection.
collection.Add( new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true)) );

// Adds an array of CodeAttributeArgument objects to the collection.
CodeAttributeArgument[] arguments = { new CodeAttributeArgument(), new CodeAttributeArgument() };
collection.AddRange( arguments );

// Adds a collection of CodeAttributeArgument objects to
// the collection.
CodeAttributeArgumentCollection argumentsCollection = new CodeAttributeArgumentCollection();
argumentsCollection.Add( new CodeAttributeArgument("TestBooleanArgument", new CodePrimitiveExpression(true)) );
argumentsCollection.Add( new CodeAttributeArgument("TestIntArgument", new CodePrimitiveExpression(1)) );
collection.AddRange( argumentsCollection );

// Tests for the presence of a CodeAttributeArgument
// within the collection, and retrieves its index if it is found.
CodeAttributeArgument testArgument = new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true));
int itemIndex = -1;
if( collection.Contains( testArgument ) )
    itemIndex = collection.IndexOf( testArgument );

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

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

// Inserts a CodeAttributeArgument at index 0 of the collection.
collection.Insert( 0, new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true)) );

// Removes the specified CodeAttributeArgument from the collection.
CodeAttributeArgument argument = new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true));
collection.Remove( argument );

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

' Adds a CodeAttributeArgument to the collection.
collection.Add(New CodeAttributeArgument("Test Boolean Argument", New CodePrimitiveExpression(True)))

' Adds an array of CodeAttributeArgument objects to the collection.
Dim arguments As CodeAttributeArgument() = {New CodeAttributeArgument(), New CodeAttributeArgument()}
collection.AddRange(arguments)

' Adds a collection of CodeAttributeArgument objects to the collection.
Dim argumentsCollection As New CodeAttributeArgumentCollection()
argumentsCollection.Add(New CodeAttributeArgument("TestBooleanArgument", New CodePrimitiveExpression(True)))
argumentsCollection.Add(New CodeAttributeArgument("TestIntArgument", New CodePrimitiveExpression(1)))
collection.AddRange(argumentsCollection)

' Tests for the presence of a CodeAttributeArgument in 
' the collection, and retrieves its index if it is found.
Dim testArgument As New CodeAttributeArgument("Test Boolean Argument", New CodePrimitiveExpression(True))
Dim itemIndex As Integer = -1
If collection.Contains(testArgument) Then
    itemIndex = collection.IndexOf(testArgument)
End If

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

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

' Inserts a CodeAttributeArgument at index 0 of the collection.
collection.Insert(0, New CodeAttributeArgument("Test Boolean Argument", New CodePrimitiveExpression(True)))

' Removes the specified CodeAttributeArgument from the collection.
Dim argument As New CodeAttributeArgument("Test Boolean Argument", New CodePrimitiveExpression(True))
collection.Remove(argument)

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

Keterangan

Kelas ini CodeAttributeArgumentCollection menyediakan objek koleksi sederhana yang dapat digunakan untuk menyimpan sekumpulan CodeAttributeArgument objek.

Konstruktor

CodeAttributeArgumentCollection()

Menginisialisasi instans baru kelas CodeAttributeArgumentCollection.

CodeAttributeArgumentCollection(CodeAttributeArgument[])

Menginisialisasi instans baru kelas yang CodeAttributeArgumentCollection berisi array CodeAttributeArgument objek yang ditentukan.

CodeAttributeArgumentCollection(CodeAttributeArgumentCollection)

Menginisialisasi instans baru kelas yang CodeAttributeArgumentCollection berisi elemen koleksi sumber yang ditentukan.

Properti

Capacity

Mendapatkan atau mengatur jumlah elemen yang dapat dimuat CollectionBase .

(Diperoleh dari CollectionBase)
Count

Mendapatkan jumlah elemen yang terkandung dalam CollectionBase instans. Properti ini tidak dapat ditimpa.

(Diperoleh dari CollectionBase)
InnerList

Mendapatkan yang ArrayList berisi daftar elemen dalam CollectionBase instans.

(Diperoleh dari CollectionBase)
Item[Int32]

Mendapatkan atau mengatur CodeAttributeArgument objek pada indeks yang ditentukan dalam koleksi.

List

Mendapatkan yang IList berisi daftar elemen dalam CollectionBase instans.

(Diperoleh dari CollectionBase)

Metode

Add(CodeAttributeArgument)

Menambahkan objek yang ditentukan CodeAttributeArgument ke koleksi.

AddRange(CodeAttributeArgument[])

Menyalin elemen array yang ditentukan CodeAttributeArgument ke akhir koleksi.

AddRange(CodeAttributeArgumentCollection)

Menyalin isi objek lain CodeAttributeArgumentCollection ke akhir koleksi.

Clear()

Menghapus semua objek dari CollectionBase instans. Metode ini tidak dapat ditimpa.

(Diperoleh dari CollectionBase)
Contains(CodeAttributeArgument)

Mendapatkan nilai yang menunjukkan apakah koleksi berisi objek yang ditentukan CodeAttributeArgument .

CopyTo(CodeAttributeArgument[], Int32)

Menyalin objek koleksi ke instans satu dimensi Array yang dimulai pada indeks yang ditentukan.

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetEnumerator()

Mengembalikan enumerator yang berulang melalui CollectionBase instans.

(Diperoleh dari CollectionBase)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan dari instans Type saat ini.

(Diperoleh dari Object)
IndexOf(CodeAttributeArgument)

Mendapatkan indeks objek yang ditentukan CodeAttributeArgument dalam koleksi, jika ada dalam koleksi.

Insert(Int32, CodeAttributeArgument)

Menyisipkan objek yang ditentukan CodeAttributeArgument ke dalam koleksi pada indeks yang ditentukan.

MemberwiseClone()

Membuat salinan dangkal dari saat ini Object.

(Diperoleh dari Object)
OnClear()

Melakukan proses kustom tambahan saat menghapus konten instans CollectionBase .

(Diperoleh dari CollectionBase)
OnClearComplete()

Melakukan proses kustom tambahan setelah menghapus konten instans CollectionBase .

(Diperoleh dari CollectionBase)
OnInsert(Int32, Object)

Melakukan proses kustom tambahan sebelum menyisipkan elemen baru ke CollectionBase dalam instans.

(Diperoleh dari CollectionBase)
OnInsertComplete(Int32, Object)

Melakukan proses kustom tambahan setelah menyisipkan elemen baru ke CollectionBase dalam instans.

(Diperoleh dari CollectionBase)
OnRemove(Int32, Object)

Melakukan proses kustom tambahan saat menghapus elemen dari CollectionBase instans.

(Diperoleh dari CollectionBase)
OnRemoveComplete(Int32, Object)

Melakukan proses kustom tambahan setelah menghapus elemen dari CollectionBase instans.

(Diperoleh dari CollectionBase)
OnSet(Int32, Object, Object)

Melakukan proses kustom tambahan sebelum mengatur nilai dalam CollectionBase instans.

(Diperoleh dari CollectionBase)
OnSetComplete(Int32, Object, Object)

Melakukan proses kustom tambahan setelah menetapkan nilai dalam CollectionBase instans.

(Diperoleh dari CollectionBase)
OnValidate(Object)

Melakukan proses kustom tambahan saat memvalidasi nilai.

(Diperoleh dari CollectionBase)
Remove(CodeAttributeArgument)

Menghapus objek yang ditentukan CodeAttributeArgument dari koleksi.

RemoveAt(Int32)

Menghapus elemen pada indeks CollectionBase instans yang ditentukan. Metode ini tidak dapat diganti.

(Diperoleh dari CollectionBase)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Implementasi Antarmuka Eksplisit

ICollection.CopyTo(Array, Int32)

Menyalin seluruh CollectionBase ke satu dimensi Arrayyang kompatibel, dimulai dari indeks array target yang ditentukan.

(Diperoleh dari CollectionBase)
ICollection.IsSynchronized

Mendapatkan nilai yang menunjukkan apakah akses ke disinkronkan CollectionBase (utas aman).

(Diperoleh dari CollectionBase)
ICollection.SyncRoot

Mendapatkan objek yang dapat digunakan untuk menyinkronkan akses ke CollectionBase.

(Diperoleh dari CollectionBase)
IList.Add(Object)

Menambahkan objek ke akhir CollectionBase.

(Diperoleh dari CollectionBase)
IList.Contains(Object)

Menentukan apakah CollectionBase berisi elemen tertentu.

(Diperoleh dari CollectionBase)
IList.IndexOf(Object)

Mencari yang ditentukan Object dan mengembalikan indeks berbasis nol dari kemunculan pertama dalam seluruh CollectionBase.

(Diperoleh dari CollectionBase)
IList.Insert(Int32, Object)

Menyisipkan elemen ke dalam pada CollectionBase indeks yang ditentukan.

(Diperoleh dari CollectionBase)
IList.IsFixedSize

Mendapatkan nilai yang menunjukkan apakah CollectionBase memiliki ukuran tetap.

(Diperoleh dari CollectionBase)
IList.IsReadOnly

Mendapatkan nilai yang menunjukkan apakah CollectionBase bersifat baca-saja.

(Diperoleh dari CollectionBase)
IList.Item[Int32]

Mendapatkan atau mengatur elemen pada indeks yang ditentukan.

(Diperoleh dari CollectionBase)
IList.Remove(Object)

Menghapus kemunculan pertama objek tertentu dari CollectionBase.

(Diperoleh dari CollectionBase)

Metode Ekstensi

Cast<TResult>(IEnumerable)

Mentransmisikan elemen dari ke IEnumerable jenis yang ditentukan.

OfType<TResult>(IEnumerable)

Memfilter elemen berdasarkan IEnumerable jenis yang ditentukan.

AsParallel(IEnumerable)

Mengaktifkan paralelisasi kueri.

AsQueryable(IEnumerable)

Mengonversi menjadi IEnumerableIQueryable.

Berlaku untuk

Lihat juga