UriTemplate.PathSegmentVariableNames Właściwość

Definicja

Pobiera kolekcję nazw zmiennych używanych w segmentach ścieżek w szablonie.

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)

Wartość właściwości

Kolekcja nazw zmiennych, które są wyświetlane w segmencie ścieżki szablonu.

Przykłady

W poniższym przykładzie pokazano, jak uzyskać dostęp PathSegmentVariableNames do właściwości.

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

Uwagi

Kolekcja wyklucza nazwy zmiennych, które są wyświetlane w części zapytania szablonu.

Dotyczy