ModelGenericExtensionsFillInTemplate Method

Fills in the template with the given parameters.

Definition

Namespace: MobileTrack.Common.Extensions
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+ce90b2cf6b782b8d7b7fd47b3c546987c652c00f
public static string FillInTemplate(
	this TemplateDto template,
	CultureInfo locale,
	Dictionary<string, Object> parameters
)

Parameters

template  TemplateDto
Template to fill in
locale  CultureInfo
Localization
parameters  DictionaryString, Object
Parameters to fill in where needed.

Return Value

String
Filled in template in the form of a String.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TemplateDto. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

InvalidOperationException Thrown if template does not contain the locale translation. It can also be thrown if a parameter part of the text is not in format {{foo}} or {{foo.bar}} (meaning: {{foo.bar.bar}} is illegal). it can also be thrown if a simple parameter (e.g. {{foo}}) is not a generic type DateTime, Double, GeoLocation or String
ArgumentNullExceptionThrown if locale or parameters are
NotImplementedExceptionIf a property is to be used that we do not support yet for the template, or a property that does not exist.

See Also