DotNetWikiBot Framework Documentation
Parses the provided template body and returns the key/value pairs of it's parameters titles and values. Everything inside the double braces must be passed to this function, so first goes the template's title, then '|' character, and then go the parameters. Please, see the usage example.

Namespace: DotNetWikiBot
Assembly: DotNetWikiBot (in DotNetWikiBot.dll) Version:


public static Dictionary<string, string> ParseTemplate(
	string template


Type: System..::..String
Complete template's body including it's title, but not including double braces.

Return Value

Type: Dictionary<(Of <(<'String, String>)>)>
Returns the Dictionary <string, string> object, where keys are parameters titles and values are parameters values. If parameter is untitled, it's number is returned as the (string) dictionary key. If parameter value is set several times in the template (normally that shouldn't occur), only the last value is returned. Template's title is not returned as a parameter.


 Copy imageCopy
Dictionary <string, string> parameters1 =
string[] templates = page.GetTemplates(true, false);
Dictionary <string, string> parameters2 = site.ParseTemplate(templates[0]);
parameters1["param2"] = "newValue";

See Also