ICollection Arabirim
Tanım
Genel olmayan tüm koleksiyonlar için boyut, Numaralandırıcılar ve eşitleme yöntemlerini tanımlar.Defines size, enumerators, and synchronization methods for all nongeneric collections.
public interface class ICollection : System::Collections::IEnumerable
public interface ICollection : System.Collections.IEnumerable
[System.Runtime.InteropServices.ComVisible(true)]
public interface ICollection : System.Collections.IEnumerable
type ICollection = interface
interface IEnumerable
[<System.Runtime.InteropServices.ComVisible(true)>]
type ICollection = interface
interface IEnumerable
Public Interface ICollection
Implements IEnumerable
- Türetilmiş
- Öznitelikler
- Uygulamalar
Açıklamalar
ICollectionArabirim, ad alanındaki sınıfların temel arabirimidir System.Collections .The ICollection interface is the base interface for classes in the System.Collections namespace. Genel eşdeğeri System.Collections.Generic.ICollection<T> arabirimdir.Its generic equivalent is the System.Collections.Generic.ICollection<T> interface.
ICollectionArabirim, IEnumerable ve genişleterek IDictionary IList daha özelleştirilmiş arabirimlerdir ICollection .The ICollection interface extends IEnumerable; IDictionary and IList are more specialized interfaces that extend ICollection. IDictionaryUygulama, sınıfı gibi anahtar/değer çiftleri koleksiyonudur Hashtable .An IDictionary implementation is a collection of key/value pairs, like the Hashtable class. Uygulama, bir IList değerler koleksiyonudur ve üyeleri, sınıfı gibi dizin tarafından erişilebilir ArrayList .An IList implementation is a collection of values and its members can be accessed by index, like the ArrayList class.
Sınıf ve sınıf gibi öğelerine erişimi sınırlayan bazı koleksiyonlar, Queue Stack arabirimi doğrudan uygular ICollection .Some collections that limit access to their elements, such as the Queue class and the Stack class, directly implement the ICollection interface.
IDictionaryArabirimin veya IList arabirimin gerekli koleksiyonun gereksinimlerini karşılamazsa, ICollection daha fazla esneklik sağlamak için arabiriminden yeni koleksiyon sınıfını türetirsiniz.If neither the IDictionary interface nor the IList interface meet the requirements of the required collection, derive the new collection class from the ICollection interface instead for more flexibility.
Bu arabirimin genel sürümü için bkz System.Collections.Generic.ICollection<T> ..For the generic version of this interface, see System.Collections.Generic.ICollection<T>.
Özellikler
Count |
ICollection içindeki öğe sayısını alır.Gets the number of elements contained in the ICollection. |
IsSynchronized |
Erişiminin ICollection eşitlenip eşitlenmediğini (iş parçacığı güvenli) gösteren bir değer alır.Gets a value indicating whether access to the ICollection is synchronized (thread safe). |
SyncRoot |
Erişimini eşitlemede kullanılabilecek bir nesne alır ICollection .Gets an object that can be used to synchronize access to the ICollection. |
Yöntemler
CopyTo(Array, Int32) |
Öğesinin öğelerini ICollection Array belirli bir dizinden başlayarak öğesine kopyalar Array .Copies the elements of the ICollection to an Array, starting at a particular Array index. |
GetEnumerator() |
Bir toplulukta tekrarlanan bir numaralandırıcı döndürür.Returns an enumerator that iterates through a collection. (Devralındığı yer: IEnumerable) |
Uzantı Metotları
Cast<TResult>(IEnumerable) |
Öğesinin öğelerini IEnumerable belirtilen türe yayınlar.Casts the elements of an IEnumerable to the specified type. |
OfType<TResult>(IEnumerable) |
Öğesinin öğelerini IEnumerable belirtilen bir türe göre filtreler.Filters the elements of an IEnumerable based on a specified type. |
AsParallel(IEnumerable) |
Bir sorgunun paralelleştirilmesini mümkün hale getirme.Enables parallelization of a query. |
AsQueryable(IEnumerable) |
Bir IEnumerable öğesine dönüştürür IQueryable .Converts an IEnumerable to an IQueryable. |