CodeNamespaceImportCollection Класс
Определение
Представляет коллекцию объектов CodeNamespaceImport.Represents a collection of CodeNamespaceImport objects.
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
[<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 класса.The following example demonstrates some of the members of the CodeNamespaceImportCollection class. В примере инициализируется новый экземпляр класса, в него добавляются CodeNamespaceImport объекты и получается общее число объектов в коллекции.The example initializes a new instance of the class, adds CodeNamespaceImport objects to it, and gets the total number of objects in the collection.
// 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.The CodeNamespaceImportCollection class provides a simple collection object that can be used to store a set of CodeNamespaceImport objects.
Конструкторы
CodeNamespaceImportCollection() |
Инициализирует новый экземпляр класса CodeNamespaceImportCollection.Initializes a new instance of the CodeNamespaceImportCollection class. |
Свойства
Count |
Получает число пространств имен в коллекции.Gets the number of namespaces in the collection. |
Item[Int32] |
Получает или задает объект CodeNamespaceImport по указанному индексу в коллекции.Gets or sets the CodeNamespaceImport object at the specified index in the collection. |
Методы
Add(CodeNamespaceImport) |
Добавляет объект CodeNamespaceImport в коллекцию.Adds a CodeNamespaceImport object to the collection. |
AddRange(CodeNamespaceImport[]) |
Добавляет набор объектов CodeNamespaceImport в коллекцию.Adds a set of CodeNamespaceImport objects to the collection. |
Clear() |
Очищает коллекцию элементов.Clears the collection of members. |
Equals(Object) |
Определяет, равен ли указанный объект текущему объекту.Determines whether the specified object is equal to the current object. (Унаследовано от Object) |
GetEnumerator() |
Получает перечислитель, который перечисляет члены коллекции.Gets an enumerator that enumerates the collection members. |
GetHashCode() |
Служит хэш-функцией по умолчанию.Serves as the default hash function. (Унаследовано от Object) |
GetType() |
Возвращает объект Type для текущего экземпляра.Gets the Type of the current instance. (Унаследовано от Object) |
MemberwiseClone() |
Создает неполную копию текущего объекта Object.Creates a shallow copy of the current Object. (Унаследовано от Object) |
ToString() |
Возвращает строку, представляющую текущий объект.Returns a string that represents the current object. (Унаследовано от Object) |
Явные реализации интерфейса
ICollection.CopyTo(Array, Int32) |
Копирует элементы коллекции ICollection в массив Array, начиная с указанного индекса массива Array.Copies the elements of the ICollection to an Array, starting at a particular Array index. |
ICollection.Count |
Получает число элементов, содержащихся в интерфейсе ICollection.Gets the number of elements contained in the ICollection. |
ICollection.IsSynchronized |
Возвращает значение, показывающее, является ли доступ к коллекции ICollection синхронизированным (потокобезопасным).Gets a value indicating whether access to the ICollection is synchronized (thread safe). |
ICollection.SyncRoot |
Получает объект, с помощью которого можно синхронизировать доступ к коллекции ICollection.Gets an object that can be used to synchronize access to the ICollection. |
IEnumerable.GetEnumerator() |
Возвращает перечислитель, который может выполнять итерацию по коллекции.Returns an enumerator that can iterate through a collection. |
IList.Add(Object) | |
IList.Clear() |
Удаляет все элементы из коллекции IList.Removes all items from the IList. |
IList.Contains(Object) |
Определяет, содержит ли коллекция IList указанное значение.Determines whether the IList contains a specific value. |
IList.IndexOf(Object) |
Определяет индекс заданного элемента в списке IList.Determines the index of a specific item in the IList. |
IList.Insert(Int32, Object) |
Вставляет элемент IList на указанную позицию.Inserts an item in the IList at the specified position. |
IList.IsFixedSize |
Возвращает значение, указывающее, имеет ли IList фиксированный размер.Gets a value indicating whether the IList has a fixed size. |
IList.IsReadOnly |
Получает значение, указывающее, является ли объект IList доступным только для чтения.Gets a value indicating whether the IList is read-only. |
IList.Item[Int32] |
Возвращает или задает элемент по указанному индексу.Gets or sets the element at the specified index. |
IList.Remove(Object) |
Удаляет первое вхождение указанного объекта из коллекции IList.Removes the first occurrence of a specific object from the IList. |
IList.RemoveAt(Int32) |
Удаляет элемент списка IList с указанным индексом.Removes the element at the specified index of the IList. |
Методы расширения
Cast<TResult>(IEnumerable) |
Приводит элементы объекта IEnumerable к заданному типу.Casts the elements of an IEnumerable to the specified type. |
OfType<TResult>(IEnumerable) |
Выполняет фильтрацию элементов объекта IEnumerable по заданному типу.Filters the elements of an IEnumerable based on a specified type. |
AsParallel(IEnumerable) |
Позволяет осуществлять параллельный запрос.Enables parallelization of a query. |
AsQueryable(IEnumerable) |
Преобразовывает коллекцию IEnumerable в объект IQueryable.Converts an IEnumerable to an IQueryable. |