Aracılığıyla paylaş


NamespaceCollection.Item[Int32] Özellik

Tanım

Nesneyi koleksiyonda NamespaceInfo belirtilen dizinde alır veya ayarlar.

public:
 property System::Web::Configuration::NamespaceInfo ^ default[int] { System::Web::Configuration::NamespaceInfo ^ get(int index); void set(int index, System::Web::Configuration::NamespaceInfo ^ value); };
public System.Web.Configuration.NamespaceInfo this[int index] { get; set; }
member this.Item(int) : System.Web.Configuration.NamespaceInfo with get, set
Default Public Property Item(index As Integer) As NamespaceInfo

Parametreler

index
Int32

Koleksiyondaki bir NamespaceInfo nesnenin dizini.

Özellik Değeri

NamespaceInfo

NamespaceInfo veya bu dizinde null nesne yoksa.

Örnekler

Aşağıdaki kod örneği özelliğinin Item[] nasıl kullanılacağını gösterir. Bu kod örneği, sınıfı için PagesSection sağlanan daha büyük bir örneğin parçasıdır.

// Get all current Namespaces in the collection.
for (int i = 0; i < pagesSection.Namespaces.Count; i++)
{
  Console.WriteLine(
      "Namespaces {0}: '{1}'", i,
      pagesSection.Namespaces[i].Namespace);
}
' Get all current Namespaces in the collection.
Dim i As Int16
For i = 0 To pagesSection.Namespaces.Count - 1
  Console.WriteLine( _
   "Namespaces {0}: '{1}'", i, _
   pagesSection.Namespaces(i).Namespace)
Next

Açıklamalar

Bu özellik belirtilen dizinde zaten varsa nesnenin NamespaceInfo üzerine yazar; aksi takdirde, yeni bir nesne oluşturulur ve koleksiyona eklenir.

Şunlara uygulanır

Ayrıca bkz.