Class TemplateExtensions
Contains extension method for handling url templates.
Inheritance
object
TemplateExtensions
Namespace: StylelabsStylelabs.MSdkWebClientHttp
Assembly: Stylelabs.M.Sdk.WebClient.dll
Syntax
Methods
Bind(Link, IDictionary<string, string>)
Parses the link's template and applies the specified values to it.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| Link | link | The link to parse. |
| IDictionary<, >stringstring | values | The values of the templatized parameters. |
Returns
| Type | Description |
|---|---|
| string | The link's template with it's parameters replaced by the specified values. |
Bind(Link, object)
Parses the link's template and applies the specified values to it.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| Link | link | The link to parse. |
| object | values | The values of the templatized parameters. |
Returns
| Type | Description |
|---|---|
| string | The link's template with it's parameters replaced by the specified values. |
GetVariableValue(Link, Link, string)
Extracts the value of the specified variable from the link based on a given template.
Declaration
Parameters
Returns
| Type | Description |
|---|---|
| string | The value of the variable or null if the variable could not be found. |
GetVariableValue(Uri, Link, string)
Extracts the value of the specified variable from the uri based on a given template.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | uri | The uri to extract the variable from. |
| Link | template | The template that defines the variables. |
| string | variable | The name of the variable to extract. |
Returns
| Type | Description |
|---|---|
| string | The value of the variable or null if the variable could not be found. |
If you have suggestions for improving this article, let us know!