CodeParameterDeclarationExpressionCollection Класс

Определение

Представляет коллекцию CodeParameterDeclarationExpression объектов.

public ref class CodeParameterDeclarationExpressionCollection : System::Collections::CollectionBase
public class CodeParameterDeclarationExpressionCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeParameterDeclarationExpressionCollection : System.Collections.CollectionBase
type CodeParameterDeclarationExpressionCollection = class
    inherit CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeParameterDeclarationExpressionCollection = class
    inherit CollectionBase
Public Class CodeParameterDeclarationExpressionCollection
Inherits CollectionBase
Наследование
CodeParameterDeclarationExpressionCollection
Атрибуты

Примеры

В следующем примере показано, как использовать CodeParameterDeclarationExpressionCollection методы класса. В примере создается новый экземпляр класса и используются методы для добавления инструкций в коллекцию, возврата их индекса и добавления или удаления атрибутов в определенной точке индекса.

// 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 объектов.

Конструкторы

Имя Описание
CodeParameterDeclarationExpressionCollection()

Инициализирует новый экземпляр класса CodeParameterDeclarationExpressionCollection.

CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpression[])

Инициализирует новый экземпляр CodeParameterDeclarationExpressionCollection класса, содержащего указанный массив CodeParameterDeclarationExpression объектов.

CodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpressionCollection)

Инициализирует новый экземпляр CodeParameterDeclarationExpressionCollection класса, содержащего элементы указанной исходной коллекции.

Свойства

Имя Описание
Capacity

Возвращает или задает количество элементов, которые CollectionBase могут содержаться.

(Унаследовано от CollectionBase)
Count

Возвращает количество элементов, содержащихся в экземпляре CollectionBase . Это свойство нельзя переопределить.

(Унаследовано от CollectionBase)
InnerList

ArrayList Возвращает список элементов в экземпляреCollectionBase.

(Унаследовано от CollectionBase)
Item[Int32]

Возвращает или задает CodeParameterDeclarationExpression указанный индекс в коллекции.

List

IList Возвращает список элементов в экземпляреCollectionBase.

(Унаследовано от CollectionBase)

Методы

Имя Описание
Add(CodeParameterDeclarationExpression)

Добавляет указанный CodeParameterDeclarationExpression в коллекцию.

AddRange(CodeParameterDeclarationExpression[])

Копирует элементы указанного массива в конец коллекции.

AddRange(CodeParameterDeclarationExpressionCollection)

Добавляет содержимое другого CodeParameterDeclarationExpressionCollection в конец коллекции.

Clear()

Удаляет все объекты из экземпляра CollectionBase . Этот метод не может быть переопределен.

(Унаследовано от CollectionBase)
Contains(CodeParameterDeclarationExpression)

Возвращает значение, указывающее, содержит ли коллекция указанный CodeParameterDeclarationExpressionобъект.

CopyTo(CodeParameterDeclarationExpression[], Int32)

Копирует объекты коллекции в одномерный Array экземпляр, начинающийся с указанного индекса.

Equals(Object)

Определяет, равен ли указанный объект текущему объекту.

(Унаследовано от Object)
GetEnumerator()

Возвращает перечислитель, который выполняет итерацию по экземпляру CollectionBase .

(Унаследовано от CollectionBase)
GetHashCode()

Служит хэш-функцией по умолчанию.

(Унаследовано от Object)
GetType()

Возвращает Type текущего экземпляра.

(Унаследовано от Object)
IndexOf(CodeParameterDeclarationExpression)

Возвращает индекс в коллекции указанного CodeParameterDeclarationExpressionобъекта, если он существует в коллекции.

Insert(Int32, CodeParameterDeclarationExpression)

Вставляет указанный CodeParameterDeclarationExpression объект в коллекцию по указанному индексу.

MemberwiseClone()

Создает неглубокую копию текущей Object.

(Унаследовано от Object)
OnClear()

Выполняет дополнительные пользовательские процессы при очистке содержимого экземпляра CollectionBase .

(Унаследовано от CollectionBase)
OnClearComplete()

Выполняет дополнительные пользовательские процессы после очистки содержимого экземпляра CollectionBase .

(Унаследовано от CollectionBase)
OnInsert(Int32, Object)

Выполняет дополнительные пользовательские процессы перед вставкой нового элемента в CollectionBase экземпляр.

(Унаследовано от CollectionBase)
OnInsertComplete(Int32, Object)

Выполняет дополнительные пользовательские процессы после вставки нового элемента в CollectionBase экземпляр.

(Унаследовано от CollectionBase)
OnRemove(Int32, Object)

Выполняет дополнительные пользовательские процессы при удалении элемента из экземпляра CollectionBase .

(Унаследовано от CollectionBase)
OnRemoveComplete(Int32, Object)

Выполняет дополнительные пользовательские процессы после удаления элемента из экземпляра CollectionBase .

(Унаследовано от CollectionBase)
OnSet(Int32, Object, Object)

Выполняет дополнительные пользовательские процессы перед заданием значения в экземпляре CollectionBase .

(Унаследовано от CollectionBase)
OnSetComplete(Int32, Object, Object)

Выполняет дополнительные пользовательские процессы после задания значения в экземпляре CollectionBase .

(Унаследовано от CollectionBase)
OnValidate(Object)

Выполняет дополнительные пользовательские процессы при проверке значения.

(Унаследовано от CollectionBase)
Remove(CodeParameterDeclarationExpression)

Удаляет указанный CodeParameterDeclarationExpression из коллекции.

RemoveAt(Int32)

Удаляет элемент по указанному индексу экземпляра CollectionBase . Этот метод не переопределяется.

(Унаследовано от CollectionBase)
ToString()

Возвращает строку, представляющую текущий объект.

(Унаследовано от Object)

Явные реализации интерфейса

Имя Описание
ICollection.CopyTo(Array, Int32)

Копирует весь CollectionBase в совместимую одномерную Array, начиная с указанного индекса целевого массива.

(Унаследовано от CollectionBase)
ICollection.IsSynchronized

Возвращает значение, указывающее, синхронизирован ли доступ к CollectionBase (потокобезопасный).

(Унаследовано от CollectionBase)
ICollection.SyncRoot

Получает объект, который можно использовать для синхронизации доступа к объекту CollectionBase.

(Унаследовано от CollectionBase)
IList.Add(Object)

Добавляет объект в конец CollectionBase.

(Унаследовано от CollectionBase)
IList.Contains(Object)

Определяет, содержит ли CollectionBase определенный элемент.

(Унаследовано от CollectionBase)
IList.IndexOf(Object)

Выполняет поиск указанного Object и возвращает отсчитываемый от нуля индекс первого вхождения в течение всего CollectionBase.

(Унаследовано от CollectionBase)
IList.Insert(Int32, Object)

Вставляет элемент в CollectionBase указанный индекс.

(Унаследовано от CollectionBase)
IList.IsFixedSize

Возвращает значение, указывающее, имеет ли CollectionBase размер фиксированного размера.

(Унаследовано от CollectionBase)
IList.IsReadOnly

Возвращает значение, указывающее, доступен ли доступ CollectionBase только для чтения.

(Унаследовано от CollectionBase)
IList.Item[Int32]

Возвращает или задает элемент по указанному индексу.

(Унаследовано от CollectionBase)
IList.Remove(Object)

Удаляет первое вхождение определенного объекта из CollectionBase.

(Унаследовано от CollectionBase)

Методы расширения

Имя Описание
AsParallel(IEnumerable)

Включает параллелизацию запроса.

AsQueryable(IEnumerable)

Преобразует IEnumerable в IQueryable.

Cast<TResult>(IEnumerable)

Приведение элементов IEnumerable к указанному типу.

OfType<TResult>(IEnumerable)

Фильтрует элементы IEnumerable на основе указанного типа.

Применяется к

См. также раздел