1. TemplateExtensions

Class TemplateExtensions

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

Contains extension method for handling url templates.

Inheritance
System.Object
TemplateExtensions
Namespace: Stylelabs.M.Sdk.WebClient.Http
Assembly: Stylelabs.M.Sdk.WebClient.dll
Syntax
public static class TemplateExtensions : object

Methods

Parses the link's template and applies the specified values to it.

Declaration
public static string Bind(this Link link, IDictionary<string, string> values)
Parameters
TypeNameDescription
Linklink

The link to parse.

IDictionary<System.String, System.String>values

The values of the templatized parameters.

Returns
TypeDescription
System.String

The link's template with it's parameters replaced by the specified values.

Parses the link's template and applies the specified values to it.

Declaration
public static string Bind(this Link link, object values = null)
Parameters
TypeNameDescription
Linklink

The link to parse.

System.Objectvalues

The values of the templatized parameters.

Returns
TypeDescription
System.String

The link's template with it's parameters replaced by the specified values.

Extracts the value of the specified variable from the link based on a given template.

Declaration
public static string GetVariableValue(this Link link, Link template, string variable)
Parameters
TypeNameDescription
Linklink

The link to extract the variable from.

Linktemplate

The template that defines the variables.

System.Stringvariable

The name of the variable to extract.

Returns
TypeDescription
System.String

The value of the variable or null if the variable could not be found.

Extracts the value of the specified variable from the uri based on a given template.

Declaration
public static string GetVariableValue(this Uri uri, Link template, string variable)
Parameters
TypeNameDescription
Uriuri

The uri to extract the variable from.

Linktemplate

The template that defines the variables.

System.Stringvariable

The name of the variable to extract.

Returns
TypeDescription
System.String

The value of the variable or null if the variable could not be found.

この記事を改善するための提案がある場合は、 お知らせください!