Click or drag to resize

imbStringTemplateExtensionsapplyToContent Method (String, Boolean, PropertyCollection)

imbSCI | imbACE | imbNLP | imbWEM | imbWBI
Replaces all template placeholder fields if mached with data PropertyCollection key values.

Namespace:  imbSCI.Core.reporting.extensions
Assembly:  imbSCI.Core (in imbSCI.Core.dll) Version: 0.3.58.
Syntax
C#
public static string applyToContent(
	this string template,
	bool removeUnMatched,
	params PropertyCollection[] dataset
)
Request Example View Source

Parameters

template
Type: SystemString
Any string that has {{{}}} template tags within
removeUnMatched
Type: SystemBoolean
If TRUE it will remove all remaining/unmached tags in the last iteration / PropertyCollection supplied.
dataset
Type: System.DataPropertyCollection
Multiple PropertyCollection or IEnumerable collections with PropertyCollection instances

Return Value

Type: String
String with matched template tags replaced with content from data collection.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. 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).
Remarks
It uses internally reportTemplatePlaceholderCollection for template mechanism. You may provide any and multiple IEnumerable PropertyCollection collections as part of dataset params array.
Examples
1String templateString = "His is {{{title}}} {{{first_name}}} {{{last_name}}} working with {{{company_name}}}."
2String output = templateString.applyToContent(true, contactBean, accountBean);
Where contactBean and accountBean contain data from a corporate CRM.
Examples
1String output = templateString.applyToContent(true, contactBean, allCrmBeans, accountBean);
Where allCrmBeans is IEnumerable with multiple PropertyCollection instances.
See Also