CodeNamespaceCollection Sınıf

Tanım

Nesne koleksiyonunu CodeNamespace temsil eder.

public ref class CodeNamespaceCollection : System::Collections::CollectionBase
public class CodeNamespaceCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeNamespaceCollection : System.Collections.CollectionBase
type CodeNamespaceCollection = class
    inherit CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeNamespaceCollection = class
    inherit CollectionBase
Public Class CodeNamespaceCollection
Inherits CollectionBase
Devralma
CodeNamespaceCollection
Öznitelikler

Örnekler

Aşağıdaki örnekte sınıfının nasıl kullanılacağı gösterilmektedir CodeNamespaceCollection . Ö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 CodeNamespaceCollection.            
CodeNamespaceCollection^ collection = gcnew CodeNamespaceCollection;

// Adds a CodeNamespace to the collection.
collection->Add( gcnew CodeNamespace( "TestNamespace" ) );

// Adds an array of CodeNamespace objects to the collection.
array<CodeNamespace^>^namespaces = {gcnew CodeNamespace( "TestNamespace1" ),gcnew CodeNamespace( "TestNamespace2" )};
collection->AddRange( namespaces );

// Adds a collection of CodeNamespace objects to the collection.
CodeNamespaceCollection^ namespacesCollection = gcnew CodeNamespaceCollection;
namespacesCollection->Add( gcnew CodeNamespace( "TestNamespace1" ) );
namespacesCollection->Add( gcnew CodeNamespace( "TestNamespace2" ) );
collection->AddRange( namespacesCollection );

// Tests for the presence of a CodeNamespace in the collection,
// and retrieves its index if it is found.
CodeNamespace^ testNamespace = gcnew CodeNamespace( "TestNamespace" );
int itemIndex = -1;
if ( collection->Contains( testNamespace ) )
   itemIndex = collection->IndexOf( testNamespace );

// Copies the contents of the collection beginning at index 0,
// to the specified CodeNamespace array.
// 'namespaces' is a CodeNamespace array.
collection->CopyTo( namespaces, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;

// Inserts a CodeNamespace at index 0 of the collection.
collection->Insert( 0, gcnew CodeNamespace( "TestNamespace" ) );

// Removes the specified CodeNamespace from the collection.
CodeNamespace^ namespace_ = gcnew CodeNamespace( "TestNamespace" );
collection->Remove( namespace_ );

// Removes the CodeNamespace at index 0.
collection->RemoveAt( 0 );
// Creates an empty CodeNamespaceCollection.
CodeNamespaceCollection collection = new CodeNamespaceCollection();

// Adds a CodeNamespace to the collection.
collection.Add( new CodeNamespace("TestNamespace") );

// Adds an array of CodeNamespace objects to the collection.
CodeNamespace[] namespaces = { new CodeNamespace("TestNamespace1"), new CodeNamespace("TestNamespace2") };
collection.AddRange( namespaces );

// Adds a collection of CodeNamespace objects to the collection.
CodeNamespaceCollection namespacesCollection = new CodeNamespaceCollection();
namespacesCollection.Add( new CodeNamespace("TestNamespace1") );
namespacesCollection.Add( new CodeNamespace("TestNamespace2") );
collection.AddRange( namespacesCollection );

// Tests for the presence of a CodeNamespace in the collection,
// and retrieves its index if it is found.
CodeNamespace testNamespace = new CodeNamespace("TestNamespace");
int itemIndex = -1;
if( collection.Contains( testNamespace ) )
    itemIndex = collection.IndexOf( testNamespace );

// Copies the contents of the collection beginning at index 0,
// to the specified CodeNamespace array.
// 'namespaces' is a CodeNamespace array.
collection.CopyTo( namespaces, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;

// Inserts a CodeNamespace at index 0 of the collection.
collection.Insert( 0, new CodeNamespace("TestNamespace") );

// Removes the specified CodeNamespace from the collection.
CodeNamespace namespace_ = new CodeNamespace("TestNamespace");
collection.Remove( namespace_ );

// Removes the CodeNamespace at index 0.
collection.RemoveAt(0);
' Creates an empty CodeNamespaceCollection.            
Dim collection As New CodeNamespaceCollection()

' Adds a CodeNamespace to the collection.
collection.Add(New CodeNamespace("TestNamespace"))

' Adds an array of CodeNamespace objects to the collection.
Dim namespaces As CodeNamespace() = {New CodeNamespace("TestNamespace1"), New CodeNamespace("TestNamespace2")}
collection.AddRange(namespaces)

' Adds a collection of CodeNamespace objects to the collection.
Dim namespacesCollection As New CodeNamespaceCollection()
namespacesCollection.Add(New CodeNamespace("TestNamespace1"))
namespacesCollection.Add(New CodeNamespace("TestNamespace2"))
collection.AddRange(namespacesCollection)

' Tests for the presence of a CodeNamespace in the collection,
' and retrieves its index if it is found.
Dim testNamespace As New CodeNamespace("TestNamespace")
Dim itemIndex As Integer = -1
If collection.Contains(testNamespace) Then
    itemIndex = collection.IndexOf(testNamespace)
End If

' Copies the contents of the collection beginning at index 0,
' to the specified CodeNamespace array.
' 'namespaces' is a CodeNamespace array.
collection.CopyTo(namespaces, 0)

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

' Inserts a CodeNamespace at index 0 of the collection.
collection.Insert(0, New CodeNamespace("TestNamespace"))

' Removes the specified CodeNamespace from the collection.
Dim namespace_ As New CodeNamespace("TestNamespace")
collection.Remove(namespace_)

' Removes the CodeNamespace at index 0.
collection.RemoveAt(0)

Açıklamalar

sınıfı, CodeNamespaceCollection bir nesne kümesini CodeNamespace depolamak için kullanılabilecek basit bir koleksiyon nesnesi sağlar.

Oluşturucular

CodeNamespaceCollection()

CodeNamespaceCollection sınıfının yeni bir örneğini başlatır.

CodeNamespaceCollection(CodeNamespace[])

Belirtilen nesne dizisini CodeNamespaceCollection içeren sınıfının yeni bir örneğini CodeNamespace başlatır.

CodeNamespaceCollection(CodeNamespaceCollection)

Belirtilen kaynak koleksiyonun CodeNamespaceCollection öğelerini içeren sınıfının yeni bir örneğini başlatır.

Özellikler

Capacity

öğesinin içerebileceği öğe CollectionBase sayısını alır veya ayarlar.

(Devralındığı yer: CollectionBase)
Count

Örnekte bulunan CollectionBase öğelerin sayısını alır. Bu özellik geçersiz kılınamaz.

(Devralındığı yer: CollectionBase)
InnerList

Örnekteki öğelerin CollectionBase listesini içeren bir ArrayList alır.

(Devralındığı yer: CollectionBase)
Item[Int32]

Nesneyi koleksiyonda CodeNamespaceCollection belirtilen dizinde alır veya ayarlar.

List

Örnekteki öğelerin CollectionBase listesini içeren bir IList alır.

(Devralındığı yer: CollectionBase)

Yöntemler

Add(CodeNamespace)

Belirtilen CodeNamespace nesneyi koleksiyona ekler.

AddRange(CodeNamespace[])

Belirtilen CodeNamespace dizinin öğelerini koleksiyonun sonuna kopyalar.

AddRange(CodeNamespaceCollection)

Belirtilen CodeNamespaceCollection 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(CodeNamespace)

Koleksiyonun belirtilen CodeNamespace nesneyi içerip içermediğini gösteren bir değer alır.

CopyTo(CodeNamespace[], 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()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
IndexOf(CodeNamespace)

koleksiyonda varsa içinde belirtilen CodeNamespace nesnenin CodeNamespaceCollectiondizinini alır.

Insert(Int32, CodeNamespace)

Belirtilen nesneyi belirtilen CodeNamespace dizindeki koleksiyona ekler.

MemberwiseClone()

Geçerli Objectöğesinin sığ 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)

Örnekten CollectionBase bir öğeyi 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(CodeNamespace)

Belirtilen CodeNamespace 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 dizeyi döndürür.

(Devralındığı yer: Object)

Belirtik Arabirim Kullanımları

ICollection.CopyTo(Array, Int32)

Hedef dizinin belirtilen dizininden başlayarak tamamını CollectionBase uyumlu bir tek boyutlu Arrayöğesine kopyalar.

(Devralındığı yer: CollectionBase)
ICollection.IsSynchronized

erişimin CollectionBase eşitlenip eşitlenmediğini belirten bir değer alır (iş parçacığı güvenli).

(Devralındığı yer: CollectionBase)
ICollection.SyncRoot

erişimi CollectionBaseeş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 tüm CollectionBaseiçindeki ilk 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 öğesinin salt okunur olup olmadığını belirten bir değer alır.

(Devralındığı yer: CollectionBase)
IList.Item[Int32]

Belirtilen dizindeki öğeyi 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ı

Cast<TResult>(IEnumerable)

öğesinin IEnumerable öğelerini belirtilen türe atar.

OfType<TResult>(IEnumerable)

Bir öğesinin IEnumerable öğelerini belirtilen türe göre filtreler.

AsParallel(IEnumerable)

Sorgunun paralelleştirilmesini sağlar.

AsQueryable(IEnumerable)

bir IEnumerable öğesini öğesine IQueryabledönüştürür.

Şunlara uygulanır

Ayrıca bkz.