CodeNamespaceImportCollection Класс

Определение

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

public ref class CodeNamespaceImportCollection : System::Collections::IList
public class CodeNamespaceImportCollection : System.Collections.IList
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeNamespaceImportCollection : System.Collections.IList
type CodeNamespaceImportCollection = class
    interface ICollection
    interface IEnumerable
    interface IList
type CodeNamespaceImportCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeNamespaceImportCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class CodeNamespaceImportCollection
Implements IList
Наследование
CodeNamespaceImportCollection
Атрибуты
Реализации

Примеры

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

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

// Adds a CodeNamespaceImport to the collection.
collection->Add( gcnew CodeNamespaceImport( "System" ) );

// Adds an array of CodeNamespaceImport objects to the collection.
array<CodeNamespaceImport^>^ Imports = {
   gcnew CodeNamespaceImport( "System" ),
   gcnew CodeNamespaceImport( "System.Drawing" )};
collection->AddRange( Imports );

// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;
// Creates an empty CodeNamespaceImportCollection.
CodeNamespaceImportCollection collection =
    new CodeNamespaceImportCollection();            			

// Adds a CodeNamespaceImport to the collection.
collection.Add( new CodeNamespaceImport("System") );

// Adds an array of CodeNamespaceImport objects to the collection.
CodeNamespaceImport[] Imports = {
        new CodeNamespaceImport("System"),
        new CodeNamespaceImport("System.Drawing") };
collection.AddRange( Imports );

// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
' Creates an empty CodeNamespaceImportCollection.
Dim collection As New CodeNamespaceImportCollection()

' Adds a CodeNamespaceImport to the collection.
collection.Add(New CodeNamespaceImport("System"))

' Adds an array of CodeNamespaceImport objects to the collection.
Dim [Imports] As CodeNamespaceImport() = _
    {New CodeNamespaceImport("System"), _
    New CodeNamespaceImport("System.Drawing")}
collection.AddRange([Imports])

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

Комментарии

Класс CodeNamespaceImportCollection предоставляет простой объект коллекции, который можно использовать для хранения набора объектов CodeNamespaceImport.

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

CodeNamespaceImportCollection()

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

Свойства

Count

Получает число пространств имен в коллекции.

Item[Int32]

Получает или задает объект CodeNamespaceImport по указанному индексу в коллекции.

Методы

Add(CodeNamespaceImport)

Добавляет объект CodeNamespaceImport в коллекцию.

AddRange(CodeNamespaceImport[])

Добавляет набор объектов CodeNamespaceImport в коллекцию.

Clear()

Очищает коллекцию элементов.

Equals(Object)

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

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

Получает перечислитель, который перечисляет члены коллекции.

GetHashCode()

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

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

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

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

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

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

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

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

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

ICollection.CopyTo(Array, Int32)

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

ICollection.Count

Получает число элементов, содержащихся в интерфейсе ICollection.

ICollection.IsSynchronized

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

ICollection.SyncRoot

Получает объект, с помощью которого можно синхронизировать доступ к коллекции ICollection.

IEnumerable.GetEnumerator()

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

IList.Add(Object)

Добавляет объект в IList.

IList.Clear()

Удаляет все элементы из коллекции IList.

IList.Contains(Object)

Определяет, содержит ли коллекция IList указанное значение.

IList.IndexOf(Object)

Определяет индекс заданного элемента в списке IList.

IList.Insert(Int32, Object)

Вставляет элемент IList на указанную позицию.

IList.IsFixedSize

Получает значение, указывающее, имеет ли список IList фиксированный размер.

IList.IsReadOnly

Получает значение, указывающее, является ли объект IList доступным только для чтения.

IList.Item[Int32]

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

IList.Remove(Object)

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

IList.RemoveAt(Int32)

Удаляет элемент списка IList с указанным индексом.

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

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

Выполняет фильтрацию элементов объекта IEnumerable по заданному типу.

AsParallel(IEnumerable)

Позволяет осуществлять параллельный запрос.

AsQueryable(IEnumerable)

Преобразовывает коллекцию IEnumerable в объект IQueryable.

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

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