Langue

TagPrefixCollection.Item[Int32] Propriété

Définition

Obtient ou définit l’objet TagPrefixInfo à l’emplacement d’index spécifié.

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

Paramètres

index
Int32

Index d’un TagPrefixInfo objet dans la collection.

Valeur de propriété

Objet TagPrefixInfo à l’index spécifié, ou null s’il n’existe aucun objet à cet index.

Exemples

L’exemple de code suivant montre comment utiliser la Item[] propriété. Cet exemple de code fait partie d’un exemple plus grand fourni pour la PagesSection classe.

// Get all current Controls in the collection.
for (int i = 0; i < pagesSection.Controls.Count; i++)
{
  Console.WriteLine("Control {0}:", i);
  Console.WriteLine("  TagPrefix = '{0}' ",
      pagesSection.Controls[i].TagPrefix);
  Console.WriteLine("  TagName = '{0}' ",
      pagesSection.Controls[i].TagName);
  Console.WriteLine("  Source = '{0}' ",
      pagesSection.Controls[i].Source);
  Console.WriteLine("  Namespace = '{0}' ",
      pagesSection.Controls[i].Namespace);
  Console.WriteLine("  Assembly = '{0}' ",
      pagesSection.Controls[i].Assembly);
}
' Get all current Controls in the collection.
Dim j As Int32
For j = 0 To pagesSection.Controls.Count - 1
  Console.WriteLine("Control {0}:", j)
  Console.WriteLine("  TagPrefix = '{0}' ", _
   pagesSection.Controls(j).TagPrefix)
  Console.WriteLine("  TagName = '{0}' ", _
   pagesSection.Controls(j).TagName)
  Console.WriteLine("  Source = '{0}' ", _
   pagesSection.Controls(j).Source)
  Console.WriteLine("  Namespace = '{0}' ", _
   pagesSection.Controls(j).Namespace)
  Console.WriteLine("  Assembly = '{0}' ", _
   pagesSection.Controls(j).Assembly)
Next

Remarques

Cette propriété remplace l’objet TagPrefixInfo s’il existe déjà à l’index spécifié ; sinon, un nouvel objet est créé et ajouté à la collection.

S’applique à

Voir aussi