UriTemplate.PathSegmentVariableNames Свойство

Определение

Возвращает коллекцию имен переменных, используемых в сегментах пути в шаблоне.

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)

Значение свойства

Коллекция имен переменных, находящихся в сегменте пути шаблона.

Примеры

В следующем примере показано, как получить доступ к свойству 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

Комментарии

В коллекцию не входят имена переменных, находящихся в части шаблона, содержащей запрос.

Применяется к