CodeExpressionCollection 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 CodeExpression temsil eder.
public ref class CodeExpressionCollection : System::Collections::CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeExpressionCollection : System.Collections.CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeExpressionCollection = class
inherit CollectionBase
Public Class CodeExpressionCollection
Inherits CollectionBase
- Devralma
- Öznitelikler
Örnekler
Aşağıdaki örnekte sınıf yöntemlerinin CodeExpressionCollection kullanımı gösterilmektedir. Örnek, sınıfını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 yöntemlerini kullanır.
// Creates an empty CodeExpressionCollection.
CodeExpressionCollection collection = new CodeExpressionCollection();
// Adds a CodeExpression to the collection.
collection.Add( new CodePrimitiveExpression(true) );
// Adds an array of CodeExpression objects to the collection.
CodeExpression[] expressions = { new CodePrimitiveExpression(true), new CodePrimitiveExpression(true) };
collection.AddRange( expressions );
// Adds a collection of CodeExpression objects to the collection.
CodeExpressionCollection expressionsCollection = new CodeExpressionCollection();
expressionsCollection.Add( new CodePrimitiveExpression(true) );
expressionsCollection.Add( new CodePrimitiveExpression(true) );
collection.AddRange( expressionsCollection );
// Tests for the presence of a CodeExpression in the
// collection, and retrieves its index if it is found.
CodeExpression testComment = new CodePrimitiveExpression(true);
int itemIndex = -1;
if( collection.Contains( testComment ) )
itemIndex = collection.IndexOf( testComment );
// Copies the contents of the collection beginning at index 0 to the specified CodeExpression array.
// 'expressions' is a CodeExpression array.
collection.CopyTo( expressions, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
// Inserts a CodeExpression at index 0 of the collection.
collection.Insert( 0, new CodePrimitiveExpression(true) );
// Removes the specified CodeExpression from the collection.
CodeExpression expression = new CodePrimitiveExpression(true);
collection.Remove( expression );
// Removes the CodeExpression at index 0.
collection.RemoveAt(0);
' Creates an empty CodeExpressionCollection.
Dim collection As New CodeExpressionCollection()
' Adds a CodeExpression to the collection.
collection.Add(New CodePrimitiveExpression(True))
' Adds an array of CodeExpression objects to the collection.
Dim expressions As CodeExpression() = {New CodePrimitiveExpression(True), New CodePrimitiveExpression(True)}
collection.AddRange(expressions)
' Adds a collection of CodeExpression objects to the collection.
Dim expressionsCollection As New CodeExpressionCollection()
expressionsCollection.Add(New CodePrimitiveExpression(True))
expressionsCollection.Add(New CodePrimitiveExpression(True))
collection.AddRange(expressionsCollection)
' Tests for the presence of a CodeExpression in the
' collection, and retrieves its index if it is found.
Dim testComment = New CodePrimitiveExpression(True)
Dim itemIndex As Integer = -1
If collection.Contains(testComment) Then
itemIndex = collection.IndexOf(testComment)
End If
' Copies the contents of the collection beginning at index 0 to the specified CodeExpression array.
' 'expressions' is a CodeExpression array.
collection.CopyTo(expressions, 0)
' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count
' Inserts a CodeExpression at index 0 of the collection.
collection.Insert(0, New CodePrimitiveExpression(True))
' Removes the specified CodeExpression from the collection.
Dim expression = New CodePrimitiveExpression(True)
collection.Remove(expression)
' Removes the CodeExpression at index 0.
collection.RemoveAt(0)
Açıklamalar
Kod Belgesi Nesne Modeli (CodeDOM) ifade nesneleri kümesini temsil eden basit bir koleksiyon nesnesi sağlar.
sınıfı, CodeExpressionCollection bir nesne kümesini CodeExpression depolamak için kullanılabilecek basit bir koleksiyon nesnesi sağlar.
Oluşturucular
| Name | Description |
|---|---|
| CodeExpressionCollection() |
CodeExpressionCollection sınıfının yeni bir örneğini başlatır. |
| CodeExpressionCollection(CodeExpression[]) |
Belirtilen nesne dizisini CodeExpressionCollection içeren sınıfın yeni bir örneğini CodeExpression başlatır. |
| CodeExpressionCollection(CodeExpressionCollection) |
Belirtilen kaynak koleksiyonun CodeExpressionCollection öğ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 CodeExpression 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(CodeExpression) |
Belirtilen CodeExpression nesneyi koleksiyona ekler. |
| AddRange(CodeExpression[]) |
Belirtilen dizinin öğelerini koleksiyonun sonuna kopyalar. |
| AddRange(CodeExpressionCollection) |
Başka bir CodeExpressionCollection nesnenin içeriğini koleksiyonun sonuna kopyalar. |
| Clear() |
Örnekteki CollectionBase tüm nesneleri kaldırır. Bu yöntem geçersiz kılınamaz. (Devralındığı yer: CollectionBase) |
| Contains(CodeExpression) |
Koleksiyonun belirtilen CodeExpression nesneyi içerip içermediğini gösteren bir değer alır. |
| CopyTo(CodeExpression[], Int32) |
Koleksiyon nesnelerini 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(CodeExpression) |
Koleksiyonda varsa, koleksiyonda belirtilen CodeExpression nesnenin dizinini alır. |
| Insert(Int32, CodeExpression) |
Belirtilen nesneyi belirtilen CodeExpression 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(CodeExpression) |
Belirtilen CodeExpression 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 |
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 |
CollectionBase salt okunur olup olmadığını gösteren 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. |