CodeParameterDeclarationExpressionCollection CodeParameterDeclarationExpressionCollection CodeParameterDeclarationExpressionCollection CodeParameterDeclarationExpressionCollection Class

定義

表示 CodeParameterDeclarationExpression 物件的集合。Represents a collection of CodeParameterDeclarationExpression objects.

public ref class CodeParameterDeclarationExpressionCollection : System::Collections::CollectionBase
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Serializable]
public class CodeParameterDeclarationExpressionCollection : System.Collections.CollectionBase
type CodeParameterDeclarationExpressionCollection = class
    inherit CollectionBase
Public Class CodeParameterDeclarationExpressionCollection
Inherits CollectionBase
繼承
CodeParameterDeclarationExpressionCollectionCodeParameterDeclarationExpressionCollectionCodeParameterDeclarationExpressionCollectionCodeParameterDeclarationExpressionCollection
屬性

範例

下列範例示範如何使用CodeParameterDeclarationExpressionCollection類別方法。The following example demonstrates how to use the CodeParameterDeclarationExpressionCollection class methods. 此範例會建立類別的新實例, 並使用方法將語句加入至集合、傳回其索引, 以及在特定索引點新增或移除屬性。The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.

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

// Adds a CodeParameterDeclarationExpression to the collection.
collection->Add( gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ) );

// Adds an array of CodeParameterDeclarationExpression objects 
// to the collection.
array<CodeParameterDeclarationExpression^>^parameters = {gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ),gcnew CodeParameterDeclarationExpression( bool::typeid,"testBoolArgument" )};
collection->AddRange( parameters );

// Adds a collection of CodeParameterDeclarationExpression objects 
// to the collection.
CodeParameterDeclarationExpressionCollection^ parametersCollection = gcnew CodeParameterDeclarationExpressionCollection;
parametersCollection->Add( gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ) );
parametersCollection->Add( gcnew CodeParameterDeclarationExpression( bool::typeid,"testBoolArgument" ) );
collection->AddRange( parametersCollection );

// Tests for the presence of a CodeParameterDeclarationExpression 
// in the collection, and retrieves its index if it is found.
CodeParameterDeclarationExpression^ testParameter = gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" );
int itemIndex = -1;
if ( collection->Contains( testParameter ) )
   itemIndex = collection->IndexOf( testParameter );

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

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

// Inserts a CodeParameterDeclarationExpression at index 0 
// of the collection.
collection->Insert( 0, gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ) );

// Removes the specified CodeParameterDeclarationExpression 
// from the collection.
CodeParameterDeclarationExpression^ parameter = gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" );
collection->Remove( parameter );

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

// Adds a CodeParameterDeclarationExpression to the collection.
collection.Add( new CodeParameterDeclarationExpression(typeof(int), "testIntArgument") );

// Adds an array of CodeParameterDeclarationExpression objects 
// to the collection.
CodeParameterDeclarationExpression[] parameters = { new CodeParameterDeclarationExpression(typeof(int), "testIntArgument"), new CodeParameterDeclarationExpression(typeof(bool), "testBoolArgument") };
collection.AddRange( parameters );

// Adds a collection of CodeParameterDeclarationExpression objects 
// to the collection.
CodeParameterDeclarationExpressionCollection parametersCollection = new CodeParameterDeclarationExpressionCollection();
parametersCollection.Add( new CodeParameterDeclarationExpression(typeof(int), "testIntArgument") );
parametersCollection.Add( new CodeParameterDeclarationExpression(typeof(bool), "testBoolArgument") );
collection.AddRange( parametersCollection );

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

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

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

// Inserts a CodeParameterDeclarationExpression at index 0 
// of the collection.
collection.Insert( 0, new CodeParameterDeclarationExpression(typeof(int), "testIntArgument") );

// Removes the specified CodeParameterDeclarationExpression 
// from the collection.
CodeParameterDeclarationExpression parameter = new CodeParameterDeclarationExpression(typeof(int), "testIntArgument");
collection.Remove( parameter );

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

' Adds a CodeParameterDeclarationExpression to the collection.
collection.Add(New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"))

' Adds an array of CodeParameterDeclarationExpression objects 
' to the collection.
Dim parameters As CodeParameterDeclarationExpression() = {New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"), New CodeParameterDeclarationExpression(GetType(Boolean), "testBoolArgument")}
collection.AddRange(parameters)

' Adds a collection of CodeParameterDeclarationExpression 
' objects to the collection.
Dim parametersCollection As New CodeParameterDeclarationExpressionCollection()
parametersCollection.Add(New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"))
parametersCollection.Add(New CodeParameterDeclarationExpression(GetType(Boolean), "testBoolArgument"))
collection.AddRange(parametersCollection)

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

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

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

' Inserts a CodeParameterDeclarationExpression at index 0 
' of the collection.
collection.Insert(0, New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument"))

' Removes the specified CodeParameterDeclarationExpression 
' from the collection.
Dim parameter As New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument")
collection.Remove(parameter)

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

備註

CodeParameterDeclarationExpressionCollection 類別提供可用來儲存一組 CodeParameterDeclarationExpression 物件的簡單集合物件。The CodeParameterDeclarationExpressionCollection class provides a simple collection object that can be used to store a set of CodeParameterDeclarationExpression objects.

建構函式

CodeParameterDeclarationExpressionCollection() CodeParameterDeclarationExpressionCollection() CodeParameterDeclarationExpressionCollection() CodeParameterDeclarationExpressionCollection()

初始化 CodeParameterDeclarationExpressionCollection 類別的新執行個體。Initializes a new instance of the CodeParameterDeclarationExpressionCollection class.

CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpressionCollection) CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpressionCollection) CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpressionCollection) CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpressionCollection)

初始化 CodeParameterDeclarationExpressionCollection 類別 (含有指定來源集合的元素) 的新執行個體。Initializes a new instance of the CodeParameterDeclarationExpressionCollection class containing the elements of the specified source collection.

CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpression[]) CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpression[]) CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpression[]) CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpression[])

初始化 CodeParameterDeclarationExpressionCollection 類別 (含有 CodeParameterDeclarationExpression 物件的指定陣列) 的新執行個體。Initializes a new instance of the CodeParameterDeclarationExpressionCollection class containing the specified array of CodeParameterDeclarationExpression objects.

屬性

Capacity Capacity Capacity Capacity

取得或設定 CollectionBase 可包含的項目數目。Gets or sets the number of elements that the CollectionBase can contain.

(Inherited from CollectionBase)
Count Count Count Count

取得包含在 CollectionBase 執行個體中的項目數目。Gets the number of elements contained in the CollectionBase instance. 這個屬性無法覆寫。This property cannot be overridden.

(Inherited from CollectionBase)
ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

取得值,這個值表示對 CollectionBase 的存取是否同步 (安全執行緒)。Gets a value indicating whether access to the CollectionBase is synchronized (thread safe).

(Inherited from CollectionBase)
ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

取得可用以同步存取 CollectionBase 的物件。Gets an object that can be used to synchronize access to the CollectionBase.

(Inherited from CollectionBase)
IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

取得值,指出 CollectionBase 是否有固定的大小。Gets a value indicating whether the CollectionBase has a fixed size.

(Inherited from CollectionBase)
IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly

取得值,指出 CollectionBase 是否唯讀。Gets a value indicating whether the CollectionBase is read-only.

(Inherited from CollectionBase)
IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

在指定的索引位置上取得或設定項目。Gets or sets the element at the specified index.

(Inherited from CollectionBase)
InnerList InnerList InnerList InnerList

取得包含 ArrayList 執行個體中之元素清單的 CollectionBaseGets an ArrayList containing the list of elements in the CollectionBase instance.

(Inherited from CollectionBase)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

取得或設定在集合的指定索引上的 CodeParameterDeclarationExpressionGets or sets the CodeParameterDeclarationExpression at the specified index in the collection.

List List List List

取得包含 IList 執行個體中之元素清單的 CollectionBaseGets an IList containing the list of elements in the CollectionBase instance.

(Inherited from CollectionBase)

方法

Add(CodeParameterDeclarationExpression) Add(CodeParameterDeclarationExpression) Add(CodeParameterDeclarationExpression) Add(CodeParameterDeclarationExpression)

將指定的 CodeParameterDeclarationExpression 加入至集合。Adds the specified CodeParameterDeclarationExpression to the collection.

AddRange(CodeParameterDeclarationExpressionCollection) AddRange(CodeParameterDeclarationExpressionCollection) AddRange(CodeParameterDeclarationExpressionCollection) AddRange(CodeParameterDeclarationExpressionCollection)

將另一個 CodeParameterDeclarationExpressionCollection 的內容加入至集合末端。Adds the contents of another CodeParameterDeclarationExpressionCollection to the end of the collection.

AddRange(CodeParameterDeclarationExpression[]) AddRange(CodeParameterDeclarationExpression[]) AddRange(CodeParameterDeclarationExpression[]) AddRange(CodeParameterDeclarationExpression[])

將指定的陣列元素複製到集合末端。Copies the elements of the specified array to the end of the collection.

Clear() Clear() Clear() Clear()

CollectionBase 執行個體移除所有的物件。Removes all objects from the CollectionBase instance. 無法覆寫這個方法。This method cannot be overridden.

(Inherited from CollectionBase)
Contains(CodeParameterDeclarationExpression) Contains(CodeParameterDeclarationExpression) Contains(CodeParameterDeclarationExpression) Contains(CodeParameterDeclarationExpression)

取得值,表示集合是否包含指定的 CodeParameterDeclarationExpressionGets a value indicating whether the collection contains the specified CodeParameterDeclarationExpression.

CopyTo(CodeParameterDeclarationExpression[], Int32) CopyTo(CodeParameterDeclarationExpression[], Int32) CopyTo(CodeParameterDeclarationExpression[], Int32) CopyTo(CodeParameterDeclarationExpression[], Int32)

將集合物件複製到指定索引開頭的一維 Array 執行個體。Copies the collection objects to a one-dimensional Array instance beginning at the specified index.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回可逐一查看 CollectionBase 執行個體的列舉值。Returns an enumerator that iterates through the CollectionBase instance.

(Inherited from CollectionBase)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(CodeParameterDeclarationExpression) IndexOf(CodeParameterDeclarationExpression) IndexOf(CodeParameterDeclarationExpression) IndexOf(CodeParameterDeclarationExpression)

請取得在指定的 CodeParameterDeclarationExpression 集合中的索引 (如果它存在於集合中)。Gets the index in the collection of the specified CodeParameterDeclarationExpression, if it exists in the collection.

Insert(Int32, CodeParameterDeclarationExpression) Insert(Int32, CodeParameterDeclarationExpression) Insert(Int32, CodeParameterDeclarationExpression) Insert(Int32, CodeParameterDeclarationExpression)

將指定的 CodeParameterDeclarationExpression 插入至集合中的指定索引處。Inserts the specified CodeParameterDeclarationExpression into the collection at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
OnClear() OnClear() OnClear() OnClear()

在清除 CollectionBase 執行個體的內容之後,執行額外的自訂處理序。Performs additional custom processes when clearing the contents of the CollectionBase instance.

(Inherited from CollectionBase)
OnClearComplete() OnClearComplete() OnClearComplete() OnClearComplete()

在清除 CollectionBase 執行個體的內容後,執行額外的自訂處理序。Performs additional custom processes after clearing the contents of the CollectionBase instance.

(Inherited from CollectionBase)
OnInsert(Int32, Object) OnInsert(Int32, Object) OnInsert(Int32, Object) OnInsert(Int32, Object)

在將新的元素插入至 CollectionBase 執行個體前,執行額外的自訂處理序。Performs additional custom processes before inserting a new element into the CollectionBase instance.

(Inherited from CollectionBase)
OnInsertComplete(Int32, Object) OnInsertComplete(Int32, Object) OnInsertComplete(Int32, Object) OnInsertComplete(Int32, Object)

在將新的元素插入至 CollectionBase 執行個體後,執行額外的自訂處理序。Performs additional custom processes after inserting a new element into the CollectionBase instance.

(Inherited from CollectionBase)
OnRemove(Int32, Object) OnRemove(Int32, Object) OnRemove(Int32, Object) OnRemove(Int32, Object)

當從 CollectionBase 執行個體移除元素時,執行額外的自訂處理序。Performs additional custom processes when removing an element from the CollectionBase instance.

(Inherited from CollectionBase)
OnRemoveComplete(Int32, Object) OnRemoveComplete(Int32, Object) OnRemoveComplete(Int32, Object) OnRemoveComplete(Int32, Object)

在從 CollectionBase 執行個體移除元素後,執行額外的自訂處理序。Performs additional custom processes after removing an element from the CollectionBase instance.

(Inherited from CollectionBase)
OnSet(Int32, Object, Object) OnSet(Int32, Object, Object) OnSet(Int32, Object, Object) OnSet(Int32, Object, Object)

CollectionBase 執行個體中設定數值前,執行額外的自訂處理序。Performs additional custom processes before setting a value in the CollectionBase instance.

(Inherited from CollectionBase)
OnSetComplete(Int32, Object, Object) OnSetComplete(Int32, Object, Object) OnSetComplete(Int32, Object, Object) OnSetComplete(Int32, Object, Object)

CollectionBase 執行個體中設定數值後,執行額外的自訂處理序。Performs additional custom processes after setting a value in the CollectionBase instance.

(Inherited from CollectionBase)
OnValidate(Object) OnValidate(Object) OnValidate(Object) OnValidate(Object)

當驗證數值時,執行額外的自訂處理序。Performs additional custom processes when validating a value.

(Inherited from CollectionBase)
Remove(CodeParameterDeclarationExpression) Remove(CodeParameterDeclarationExpression) Remove(CodeParameterDeclarationExpression) Remove(CodeParameterDeclarationExpression)

從集合移除指定的 CodeParameterDeclarationExpressionRemoves the specified CodeParameterDeclarationExpression from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

移除 CollectionBase 執行個體之指定索引的元素。Removes the element at the specified index of the CollectionBase instance. 這個方法不可覆寫。This method is not overridable.

(Inherited from CollectionBase)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

明確介面實作

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

從目標陣列的指定索引開始,將整個 CollectionBase 複製到相容的一維 ArrayCopies the entire CollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.

(Inherited from CollectionBase)
IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

將物件加入至 CollectionBase 的末端。Adds an object to the end of the CollectionBase.

(Inherited from CollectionBase)
IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

判斷 CollectionBase 是否含有特定元素。Determines whether the CollectionBase contains a specific element.

(Inherited from CollectionBase)
IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

搜尋指定的 Object,並傳回在整個 CollectionBase 中第一個符合項目之以零為起始的索引。Searches for the specified Object and returns the zero-based index of the first occurrence within the entire CollectionBase.

(Inherited from CollectionBase)
IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

將項目插入至 CollectionBase 中指定的索引位置。Inserts an element into the CollectionBase at the specified index.

(Inherited from CollectionBase)
IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) IList.Remove(Object)

CollectionBase 移除特定物件之第一個符合的元素。Removes the first occurrence of a specific object from the CollectionBase.

(Inherited from CollectionBase)

擴充方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

適用於

另請參閱