UriTemplate.PathSegmentVariableNames Vlastnost

Definice

Získá kolekci názvů proměnných používaných v rámci segmentů cesty v šabloně.

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)

Hodnota vlastnosti

ReadOnlyCollection<String>

Kolekce názvů proměnných, které se zobrazují v segmentu cesty šablony.

Příklady

Následující příklad ukazuje, jak získat přístup k PathSegmentVariableNames vlastnosti.

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

Poznámky

Kolekce vylučuje názvy proměnných, které se zobrazí v části dotazu šablony.

Platí pro