UriTemplate.PathSegmentVariableNames Propriété

Définition

Obtient une collection de noms de variables utilisés dans les segments de chemin d’accès du modèle.

public:
 property System::Collections::ObjectModel::ReadOnlyCollection<System::String ^> ^ PathSegmentVariableNames { System::Collections::ObjectModel::ReadOnlyCollection<System::String ^> ^ get(); };
public System.Collections.ObjectModel.ReadOnlyCollection<string> PathSegmentVariableNames { get; }
member this.PathSegmentVariableNames : System.Collections.ObjectModel.ReadOnlyCollection<string>
Public ReadOnly Property PathSegmentVariableNames As ReadOnlyCollection(Of String)

Valeur de propriété

ReadOnlyCollection<String>

Collection de noms de variables qui apparaissent dans le segment de chemin d'accès du modèle.

Exemples

L'exemple suivant montre comment accéder à la propriété PathSegmentVariableNames.

UriTemplate template = new UriTemplate("weather/{state}/{city}?forecast={day}");

Uri prefix = new Uri("http://localhost");

Console.WriteLine("PathSegmentVariableNames:");
foreach (string name in template.PathSegmentVariableNames)
{
    Console.WriteLine("     {0}", name);
}
Dim template As UriTemplate = New UriTemplate("weather/{state}/{city}?forecast={day}")

Dim prefix As Uri = New Uri("http://localhost")

Console.WriteLine("PathSegmentVariableNames:")
For Each name As String In template.PathSegmentVariableNames
    Console.WriteLine("     {0}", name)
Next

Remarques

La collection exclut les noms de variables qui apparaissent dans la partie requête du modèle.

S’applique à