Table of Contents

Interface IMacroResolver

Namespace
CMS.MacroEngine
Assembly
CMS.MacroEngine.dll

Interface for resolver objects.

public interface IMacroResolver
Extension Methods

Methods

CheckDataSources(string, EvaluationContext)

Checks all the data sources for the value. Returns true if given data member was found within supported data sources.

EvaluationResult CheckDataSources(string expression, EvaluationContext context)

Parameters

expression string

Data member to look for

context EvaluationContext

Evaluation context

Returns

EvaluationResult

GetObjectValue(object, int, EvaluationContext)

Gets the object value at given index (this is called when indexer [(int)] is used in the expression).

EvaluationResult GetObjectValue(object obj, int index, EvaluationContext context)

Parameters

obj object

Source object to get the index-th value from

index int

Index of the item to get

context EvaluationContext

Evaluation context

Returns

EvaluationResult

GetObjectValue(object, string, EvaluationContext)

Gets the object value of specified name.

EvaluationResult GetObjectValue(object obj, string columnName, EvaluationContext context)

Parameters

obj object

Source object to get the index-th value from

columnName string

Name of the value to get

context EvaluationContext

Evaluation context

Returns

EvaluationResult

ResolveMacroExpression(ResolveExpressionSettings)

Resolves the data macro expression (expects expression without {% %} brackets).

EvaluationResult ResolveMacroExpression(ResolveExpressionSettings settings)

Parameters

settings ResolveExpressionSettings

Settings of the resolving process

Returns

EvaluationResult

ResolveMacros(string, MacroSettings)

Resolves all supported macro types in the given text within specified resolving context.

string ResolveMacros(string text, MacroSettings settings = null)

Parameters

text string

Input text with macros to be resolved

settings MacroSettings

Macro context to be used for resolving (if null, context of the resolver is used)

Returns

string