NamespaceCollection.Item[Int32] Proprietà

Definizione

Ottiene o imposta l'oggetto NamespaceInfo nella raccolta, in corrispondenza dell'indice specificato.

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

Parametri

index
Int32

Indice di un oggetto NamespaceInfo nell'insieme.

Valore della proprietà

NamespaceInfo

Oggetto NamespaceInfo in corrispondenza dell'indice specificato, oppure null se non è presente alcun oggetto nell'indice.

Esempio

Nell'esempio di codice riportato di seguito viene illustrato come utilizzare la proprietà Item[]. Questo esempio di codice fa parte di un esempio più grande fornito per la PagesSection classe.

// 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

Commenti

Questa proprietà sovrascrive l'oggetto se esiste già nell'indice NamespaceInfo specificato. In caso contrario, viene creato un nuovo oggetto e aggiunto all'insieme.

Si applica a

Vedi anche