CodeTypeDeclarationCollection Sınıf
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Bir nesne koleksiyonunu CodeTypeDeclaration temsil eder.
public ref class CodeTypeDeclarationCollection : System::Collections::CollectionBase
public class CodeTypeDeclarationCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeTypeDeclarationCollection : System.Collections.CollectionBase
type CodeTypeDeclarationCollection = class
inherit CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeTypeDeclarationCollection = class
inherit CollectionBase
Public Class CodeTypeDeclarationCollection
Inherits CollectionBase
- Devralma
- Öznitelikler
Örnekler
Aşağıdaki örnekte sınıfının nasıl kullanılacağı gösterilmektedir CodeTypeDeclarationCollection . Örnek, sınıfın yeni bir örneğini oluşturur ve koleksiyona deyim eklemek, dizinlerini döndürmek ve belirli bir dizin noktasına öznitelik eklemek veya kaldırmak için çeşitli yöntemler kullanır.
// Creates an empty CodeTypeDeclarationCollection.
CodeTypeDeclarationCollection collection = new CodeTypeDeclarationCollection();
// Adds a CodeTypeDeclaration to the collection.
collection.Add( new CodeTypeDeclaration("TestType") );
// Adds an array of CodeTypeDeclaration objects to the collection.
CodeTypeDeclaration[] declarations = { new CodeTypeDeclaration("TestType1"), new CodeTypeDeclaration("TestType2") };
collection.AddRange( declarations );
// Adds a collection of CodeTypeDeclaration objects to the
// collection.
CodeTypeDeclarationCollection declarationsCollection = new CodeTypeDeclarationCollection();
declarationsCollection.Add( new CodeTypeDeclaration("TestType1") );
declarationsCollection.Add( new CodeTypeDeclaration("TestType2") );
collection.AddRange( declarationsCollection );
// Tests for the presence of a CodeTypeDeclaration in the
// collection, and retrieves its index if it is found.
CodeTypeDeclaration testDeclaration = new CodeTypeDeclaration("TestType");
int itemIndex = -1;
if( collection.Contains( testDeclaration ) )
itemIndex = collection.IndexOf( testDeclaration );
// Copies the contents of the collection, beginning at index 0,
// to the specified CodeTypeDeclaration array.
// 'declarations' is a CodeTypeDeclaration array.
collection.CopyTo( declarations, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
// Inserts a CodeTypeDeclaration at index 0 of the collection.
collection.Insert( 0, new CodeTypeDeclaration("TestType") );
// Removes the specified CodeTypeDeclaration from the collection.
CodeTypeDeclaration declaration = new CodeTypeDeclaration("TestType");
collection.Remove( declaration );
// Removes the CodeTypeDeclaration at index 0.
collection.RemoveAt(0);
' Creates an empty CodeTypeDeclarationCollection.
Dim collection As New CodeTypeDeclarationCollection()
' Adds a CodeTypeDeclaration to the collection.
collection.Add(New CodeTypeDeclaration("TestType"))
' Adds an array of CodeTypeDeclaration objects to the
' collection.
Dim declarations As CodeTypeDeclaration() = {New CodeTypeDeclaration("TestType1"), New CodeTypeDeclaration("TestType2")}
collection.AddRange(declarations)
' Adds a collection of CodeTypeDeclaration objects to the collection.
Dim declarationsCollection As New CodeTypeDeclarationCollection()
declarationsCollection.Add(New CodeTypeDeclaration("TestType1"))
declarationsCollection.Add(New CodeTypeDeclaration("TestType2"))
collection.AddRange(declarationsCollection)
' Tests for the presence of a CodeTypeDeclaration in the
' collection, and retrieves its index if it is found.
Dim testDeclaration As New CodeTypeDeclaration("TestType")
Dim itemIndex As Integer = -1
If collection.Contains(testDeclaration) Then
itemIndex = collection.IndexOf(testDeclaration)
End If
' Copies the contents of the collection, beginning at index 0,
' to the specified CodeTypeDeclaration array.
' 'declarations' is a CodeTypeDeclaration array.
collection.CopyTo(declarations, 0)
' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count
' Inserts a CodeTypeDeclaration at index 0 of the collection.
collection.Insert(0, New CodeTypeDeclaration("TestType"))
' Removes the specified CodeTypeDeclaration from the collection.
Dim declaration As New CodeTypeDeclaration("TestType")
collection.Remove(declaration)
' Removes the CodeTypeDeclaration at index 0.
collection.RemoveAt(0)
Açıklamalar
sınıfı, CodeTypeDeclarationCollection bir nesne kümesini CodeTypeDeclaration depolamak için kullanılabilecek basit bir koleksiyon nesnesi sağlar.
Oluşturucular
| Name | Description |
|---|---|
| CodeTypeDeclarationCollection() |
CodeTypeDeclarationCollection sınıfının yeni bir örneğini başlatır. |
| CodeTypeDeclarationCollection(CodeTypeDeclaration[]) |
Belirtilen nesne dizisini CodeTypeDeclarationCollection içeren sınıfının yeni bir örneğini CodeTypeDeclaration başlatır. |
| CodeTypeDeclarationCollection(CodeTypeDeclarationCollection) |
Belirtilen kaynak koleksiyonun CodeTypeDeclarationCollection öğelerini içeren sınıfının yeni bir örneğini başlatır. |
Özellikler
| Name | Description |
|---|---|
| Capacity |
öğesinin içerebileceği öğe CollectionBase sayısını alır veya ayarlar. (Devralındığı yer: CollectionBase) |
| Count |
Örnekte bulunan CollectionBase öğe sayısını alır. Bu özellik geçersiz kılınamaz. (Devralındığı yer: CollectionBase) |
| InnerList |
Örnekteki öğelerin ArrayList listesini içeren bir CollectionBase alır. (Devralındığı yer: CollectionBase) |
| Item[Int32] |
Nesneyi koleksiyonda CodeTypeDeclaration belirtilen dizinde alır veya ayarlar. |
| List |
Örnekteki öğelerin IList listesini içeren bir CollectionBase alır. (Devralındığı yer: CollectionBase) |
Yöntemler
| Name | Description |
|---|---|
| Add(CodeTypeDeclaration) |
Belirtilen CodeTypeDeclaration nesneyi koleksiyona ekler. |
| AddRange(CodeTypeDeclaration[]) |
Belirtilen dizinin öğelerini koleksiyonun sonuna kopyalar. |
| AddRange(CodeTypeDeclarationCollection) |
Başka bir CodeTypeDeclarationCollection nesnenin içeriğini koleksiyonun sonuna ekler. |
| Clear() |
Örnekteki CollectionBase tüm nesneleri kaldırır. Bu yöntem geçersiz kılınamaz. (Devralındığı yer: CollectionBase) |
| Contains(CodeTypeDeclaration) |
Koleksiyonun belirtilen CodeTypeDeclaration nesneyi içerip içermediğini gösteren bir değer alır. |
| CopyTo(CodeTypeDeclaration[], Int32) |
Nesnedeki CodeTypeDeclarationCollection öğeleri belirtilen dizinden başlayarak tek boyutlu Array bir örneğe kopyalar. |
| Equals(Object) |
Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler. (Devralındığı yer: Object) |
| GetEnumerator() |
Örnekte yineleyen CollectionBase bir numaralandırıcı döndürür. (Devralındığı yer: CollectionBase) |
| GetHashCode() |
Varsayılan karma işlevi işlevi görür. (Devralındığı yer: Object) |
| GetType() |
Geçerli örneğin Type alır. (Devralındığı yer: Object) |
| IndexOf(CodeTypeDeclaration) |
Koleksiyonda CodeTypeDeclarationvarsa içinde belirtilen CodeTypeDeclarationCollection nesnenin dizinini alır. |
| Insert(Int32, CodeTypeDeclaration) |
Belirtilen nesneyi belirtilen CodeTypeDeclaration dizindeki koleksiyona ekler. |
| MemberwiseClone() |
Geçerli Objectbasit bir kopyasını oluşturur. (Devralındığı yer: Object) |
| OnClear() |
Örneğin içeriğini CollectionBase temizlerken ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnClearComplete() |
Örneğin içeriğini CollectionBase temizledikten sonra ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnInsert(Int32, Object) |
Örneğe yeni bir öğe CollectionBase eklemeden önce ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnInsertComplete(Int32, Object) |
Örneğe yeni bir öğe CollectionBase ekledikten sonra ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnRemove(Int32, Object) |
Bir öğeyi örnekten CollectionBase kaldırırken ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnRemoveComplete(Int32, Object) |
Bir öğeyi örnekten CollectionBase kaldırdıktan sonra ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnSet(Int32, Object, Object) |
Örnekte bir değer CollectionBase ayarlamadan önce ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnSetComplete(Int32, Object, Object) |
Örnekte bir değer CollectionBase ayarladıktan sonra ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnValidate(Object) |
Bir değeri doğrularken ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| Remove(CodeTypeDeclaration) |
Belirtilen CodeTypeDeclaration nesneyi koleksiyondan kaldırır. |
| RemoveAt(Int32) |
Örneğin belirtilen dizinindeki CollectionBase öğesini kaldırır. Bu yöntem geçersiz kılınamaz. (Devralındığı yer: CollectionBase) |
| ToString() |
Geçerli nesneyi temsil eden bir dize döndürür. (Devralındığı yer: Object) |
Belirtik Arabirim Kullanımları
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Hedef dizinin belirtilen dizininden başlayarak tamamını CollectionBase uyumlu bir tek boyutluya Arraykopyalar. (Devralındığı yer: CollectionBase) |
| ICollection.IsSynchronized |
'a CollectionBase erişimin eşitlenip eşitlenmediğini belirten bir değer alır (iş parçacığı güvenli). (Devralındığı yer: CollectionBase) |
| ICollection.SyncRoot |
CollectionBaseerişimini eşitlemek için kullanılabilecek bir nesnesi alır. (Devralındığı yer: CollectionBase) |
| IList.Add(Object) |
sonuna bir nesne CollectionBaseekler. (Devralındığı yer: CollectionBase) |
| IList.Contains(Object) |
öğesinin CollectionBase belirli bir öğe içerip içermediğini belirler. (Devralındığı yer: CollectionBase) |
| IList.IndexOf(Object) |
Belirtilen Object öğesini arar ve içindeki CollectionBaseilk oluşumun sıfır tabanlı dizinini döndürür. (Devralındığı yer: CollectionBase) |
| IList.Insert(Int32, Object) |
Belirtilen dizinde öğesine CollectionBase bir öğe ekler. (Devralındığı yer: CollectionBase) |
| IList.IsFixedSize |
değerinin sabit bir boyuta sahip olup olmadığını CollectionBase belirten bir değer alır. (Devralındığı yer: CollectionBase) |
| IList.IsReadOnly |
öğesinin salt okunur olup olmadığını CollectionBase belirten bir değer alır. (Devralındığı yer: CollectionBase) |
| IList.Item[Int32] |
Belirtilen dizinde öğesini alır veya ayarlar. (Devralındığı yer: CollectionBase) |
| IList.Remove(Object) |
Belirli bir nesnenin ilk oluşumunu öğesinden CollectionBasekaldırır. (Devralındığı yer: CollectionBase) |
Uzantı Metotları
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Sorgunun paralelleştirilmesini etkinleştirir. |
| AsQueryable(IEnumerable) |
bir IEnumerable öğesine IQueryabledönüştürür. |
| Cast<TResult>(IEnumerable) |
öğesinin IEnumerable öğelerini belirtilen türe yazar. |
| OfType<TResult>(IEnumerable) |
Belirtilen türe göre bir IEnumerable öğesinin öğelerini filtreler. |