Aracılığıyla paylaş


UriTemplateTable Oluşturucular

Tanım

UriTemplateTable sınıfının yeni bir örneğini başlatır.

Aşırı Yüklemeler

UriTemplateTable()

UriTemplateTable sınıfının yeni bir örneğini başlatır.

UriTemplateTable(IEnumerable<KeyValuePair<UriTemplate,Object>>)

Belirtilen anahtar/değer çiftleri koleksiyonuyla sınıfının yeni bir örneğini UriTemplateTable başlatır.

UriTemplateTable(Uri)

Belirtilen temel adresle sınıfının yeni bir örneğini UriTemplateTable başlatır.

UriTemplateTable(Uri, IEnumerable<KeyValuePair<UriTemplate,Object>>)

Belirtilen temel adres ve anahtar/değer çiftleri koleksiyonu ile sınıfının yeni bir örneğini UriTemplateTable başlatır.

UriTemplateTable()

UriTemplateTable sınıfının yeni bir örneğini başlatır.

public:
 UriTemplateTable();
public UriTemplateTable ();
Public Sub New ()

Örnekler

Aşağıdaki örnek, sınıfın nasıl örnek oluşturacaklarını UriTemplateTable gösterir.

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

//Create a series of templates
UriTemplate weatherByCity  = new UriTemplate("weather/{state}/{city}");
UriTemplate weatherByCountry = new UriTemplate("weather/{country}/{village}");
UriTemplate weatherByState = new UriTemplate("weather/{state}");
UriTemplate traffic = new UriTemplate("traffic/*");
UriTemplate wildcard = new UriTemplate("*");

//Create a template table
UriTemplateTable table = new UriTemplateTable(prefix);
//Add each template to the table with some associated data
table.KeyValuePairs.Add(new KeyValuePair<UriTemplate, Object>(weatherByCity, "weatherByCity"));
table.KeyValuePairs.Add(new KeyValuePair<UriTemplate, Object>(weatherByCountry, "weatherByCountry"));
table.KeyValuePairs.Add(new KeyValuePair<UriTemplate, Object>(weatherByState, "weatherByState"));
table.KeyValuePairs.Add(new KeyValuePair<UriTemplate, Object>(traffic, "traffic"));

table.MakeReadOnly(true);
Dim prefix As New Uri("http://localhost/")

' Create a series of templates
Dim weatherByCity As New UriTemplate("weather/ state}/ city}")
Dim weatherByCountry As New UriTemplate("weather/ country}/ village}")
Dim weatherByState As New UriTemplate("weather/ state}")
Dim traffic As New UriTemplate("traffic/*")
Dim wildcard As New UriTemplate("*")

' Create a template table
Dim table As New UriTemplateTable(prefix)
' Add each template to the table with some associated data
table.KeyValuePairs.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByCity, "weatherByCity"))
table.KeyValuePairs.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByCountry, "weatherByCountry"))
table.KeyValuePairs.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByState, "weatherByState"))
table.KeyValuePairs.Add(New KeyValuePair(Of UriTemplate, Object)(traffic, "traffic"))

table.MakeReadOnly(True)

Şunlara uygulanır

UriTemplateTable(IEnumerable<KeyValuePair<UriTemplate,Object>>)

Belirtilen anahtar/değer çiftleri koleksiyonuyla sınıfının yeni bir örneğini UriTemplateTable başlatır.

public:
 UriTemplateTable(System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<UriTemplate ^, System::Object ^>> ^ keyValuePairs);
public UriTemplateTable (System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<UriTemplate,object>> keyValuePairs);
new UriTemplateTable : seq<System.Collections.Generic.KeyValuePair<UriTemplate, obj>> -> UriTemplateTable
Public Sub New (keyValuePairs As IEnumerable(Of KeyValuePair(Of UriTemplate, Object)))

Parametreler

keyValuePairs
IEnumerable<KeyValuePair<UriTemplate,Object>>

URI şablonlarından ve ilişkili verilerden oluşan anahtar/değer çiftleri koleksiyonu.

Örnekler

Aşağıdaki örnek, sınıfın nasıl örnek oluşturacaklarını UriTemplateTable gösterir.

//Create a series of templates
UriTemplate weatherByCity = new UriTemplate("weather/{state}/{city}");
UriTemplate weatherByCountry = new UriTemplate("weather/{country}/{village}");
UriTemplate weatherByState = new UriTemplate("weather/{state}");
UriTemplate traffic = new UriTemplate("traffic/*");
UriTemplate wildcard = new UriTemplate("*");

//Add each template to the table with some associated data
List<KeyValuePair<UriTemplate,Object>> list = new List<KeyValuePair<UriTemplate,object>>();
list.Add(new KeyValuePair<UriTemplate, Object>(weatherByCity, "weatherByCity"));
list.Add(new KeyValuePair<UriTemplate, Object>(weatherByCountry, "weatherByCountry"));
list.Add(new KeyValuePair<UriTemplate, Object>(weatherByState, "weatherByState"));
list.Add(new KeyValuePair<UriTemplate, Object>(traffic, "traffic"));

//Create a template table
UriTemplateTable table = new UriTemplateTable(list);
table.BaseAddress = new Uri("http://localhost/");
table.MakeReadOnly(true);
' Create a series of templates
Dim weatherByCity As New UriTemplate("weather/{state}/{city}")
Dim weatherByCountry As New UriTemplate("weather/{country}/{village}")
Dim weatherByState As New UriTemplate("weather/{state}")
Dim traffic As New UriTemplate("traffic/*")
Dim wildcard As New UriTemplate("*")

' Add each template to the table with some associated data
Dim list As New List(Of KeyValuePair(Of UriTemplate, Object))()
list.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByCity, "weatherByCity"))
list.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByCountry, "weatherByCountry"))
list.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByState, "weatherByState"))
list.Add(New KeyValuePair(Of UriTemplate, Object)(traffic, "traffic"))

'Create a template table
Dim table As New UriTemplateTable(list)
table.BaseAddress = New Uri("http://localhost/")
table.MakeReadOnly(True)

Şunlara uygulanır

UriTemplateTable(Uri)

Belirtilen temel adresle sınıfının yeni bir örneğini UriTemplateTable başlatır.

public:
 UriTemplateTable(Uri ^ baseAddress);
public UriTemplateTable (Uri baseAddress);
new UriTemplateTable : Uri -> UriTemplateTable
Public Sub New (baseAddress As Uri)

Parametreler

baseAddress
Uri

Uri Temel adresi içeren bir örnek.

Örnekler

Aşağıdaki örnekte bu oluşturucunun nasıl çağrılacakları gösterilmektedir.

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

//Create a series of templates
UriTemplate weatherByCity  = new UriTemplate("weather/{state}/{city}");
UriTemplate weatherByCountry = new UriTemplate("weather/{country}/{village}");
UriTemplate weatherByState = new UriTemplate("weather/{state}");
UriTemplate traffic = new UriTemplate("traffic/*");
UriTemplate wildcard = new UriTemplate("*");

//Create a template table
UriTemplateTable table = new UriTemplateTable(prefix);
//Add each template to the table with some associated data
table.KeyValuePairs.Add(new KeyValuePair<UriTemplate, Object>(weatherByCity, "weatherByCity"));
table.KeyValuePairs.Add(new KeyValuePair<UriTemplate, Object>(weatherByCountry, "weatherByCountry"));
table.KeyValuePairs.Add(new KeyValuePair<UriTemplate, Object>(weatherByState, "weatherByState"));
table.KeyValuePairs.Add(new KeyValuePair<UriTemplate, Object>(traffic, "traffic"));

table.MakeReadOnly(true);
Dim prefix As New Uri("http://localhost/")

' Create a series of templates
Dim weatherByCity As New UriTemplate("weather/ state}/ city}")
Dim weatherByCountry As New UriTemplate("weather/ country}/ village}")
Dim weatherByState As New UriTemplate("weather/ state}")
Dim traffic As New UriTemplate("traffic/*")
Dim wildcard As New UriTemplate("*")

' Create a template table
Dim table As New UriTemplateTable(prefix)
' Add each template to the table with some associated data
table.KeyValuePairs.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByCity, "weatherByCity"))
table.KeyValuePairs.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByCountry, "weatherByCountry"))
table.KeyValuePairs.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByState, "weatherByState"))
table.KeyValuePairs.Add(New KeyValuePair(Of UriTemplate, Object)(traffic, "traffic"))

table.MakeReadOnly(True)

Şunlara uygulanır

UriTemplateTable(Uri, IEnumerable<KeyValuePair<UriTemplate,Object>>)

Belirtilen temel adres ve anahtar/değer çiftleri koleksiyonu ile sınıfının yeni bir örneğini UriTemplateTable başlatır.

public:
 UriTemplateTable(Uri ^ baseAddress, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<UriTemplate ^, System::Object ^>> ^ keyValuePairs);
public UriTemplateTable (Uri baseAddress, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<UriTemplate,object>> keyValuePairs);
new UriTemplateTable : Uri * seq<System.Collections.Generic.KeyValuePair<UriTemplate, obj>> -> UriTemplateTable
Public Sub New (baseAddress As Uri, keyValuePairs As IEnumerable(Of KeyValuePair(Of UriTemplate, Object)))

Parametreler

baseAddress
Uri

Uri Temel adresi içeren bir örnek.

keyValuePairs
IEnumerable<KeyValuePair<UriTemplate,Object>>

URI şablonlarından ve ilişkili verilerden oluşan anahtar/değer çiftleri koleksiyonu.

Örnekler

Aşağıdaki örnekte bu oluşturucunun nasıl çağrılacakları gösterilmektedir.

Uri baseAddress = new Uri("http://localhost/");
//Create a series of templates
UriTemplate weatherByCity = new UriTemplate("weather/{state}/{city}");
UriTemplate weatherByCountry = new UriTemplate("weather/{country}/{village}");
UriTemplate weatherByState = new UriTemplate("weather/{state}");
UriTemplate traffic = new UriTemplate("traffic/*");
UriTemplate wildcard = new UriTemplate("*");

//Add each template to the table with some associated data
List<KeyValuePair<UriTemplate, Object>> list = new List<KeyValuePair<UriTemplate, object>>();
list.Add(new KeyValuePair<UriTemplate, Object>(weatherByCity, "weatherByCity"));
list.Add(new KeyValuePair<UriTemplate, Object>(weatherByCountry, "weatherByCountry"));
list.Add(new KeyValuePair<UriTemplate, Object>(weatherByState, "weatherByState"));
list.Add(new KeyValuePair<UriTemplate, Object>(traffic, "traffic"));

//Create a template table
UriTemplateTable table = new UriTemplateTable(baseAddress, list);
table.MakeReadOnly(true);
Dim baseAddress As New Uri("http://localhost/")
' Create a series of templates
Dim weatherByCity = New UriTemplate("weather/{state}/{city}")
Dim weatherByCountry = New UriTemplate("weather/{country}/{village}")
Dim weatherByState = New UriTemplate("weather/{state}")
Dim traffic = New UriTemplate("traffic/*")
Dim wildcard = New UriTemplate("*")

' Add each template to the table with some associated data
Dim list As New List(Of KeyValuePair(Of UriTemplate, Object))()
list.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByCity, "weatherByCity"))
list.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByCountry, "weatherByCountry"))
list.Add(New KeyValuePair(Of UriTemplate, Object)(weatherByState, "weatherByState"))
list.Add(New KeyValuePair(Of UriTemplate, Object)(traffic, "traffic"))

' Create a template table
Dim table As New UriTemplateTable(baseAddress, list)
table.MakeReadOnly(True)

Şunlara uygulanır