Class MacroMethods
- Namespace
- CMS.MacroEngine
- Assembly
- CMS.MacroEngine.dll
Macro methods.
public class MacroMethods : CoreMethods
- Inheritance
-
objectMacroMethods
- Inherited Members
- Extension Methods
Constructors
MacroMethods()
public MacroMethods()
Fields
mAnyTypeMethods
List of methods which are available for any type
protected static List<MacroMethod> mAnyTypeMethods
Field Value
- List<MacroMethod>
mMethods
Table of available methods.
protected static SafeDictionary<string, MacroMethod> mMethods
Field Value
- SafeDictionary<string, MacroMethod>
mMethodsByType
Index of methods available for specified type.
protected static SafeDictionary<Type, List<MacroMethod>> mMethodsByType
Field Value
- SafeDictionary<Type, List<MacroMethod>>
Properties
Methods
Gets the hashtable with all methods.
public static SafeDictionary<string, MacroMethod> Methods { get; }
Property Value
- SafeDictionary<string, MacroMethod>
Methods
AreMethodsRegistered()
Returns true if methods are registered in the hashtable of all methods.
public static bool AreMethodsRegistered()
Returns
- bool
ExecuteMethod(string, MacroResolver, params object[])
Executes the given method with parameters.
public static object ExecuteMethod(string name, MacroResolver resolver, params object[] parameters)
Parameters
namestringMethod name
resolverMacroResolverResolver object
parametersobject[]Method parameters
Returns
- object
ExecuteMethod(string, params object[])
Executes the given method with parameters.
public static object ExecuteMethod(string name, params object[] parameters)
Parameters
namestringMethod name
parametersobject[]Method parameters
Returns
- object
GetMethod(string)
Gets the specific method delegate.
public static MacroMethod GetMethod(string name)
Parameters
namestringMethod name
Returns
GetMethodsForObject(object)
Returns the list of macro methods suitable for specified object.
public static List<MacroMethod> GetMethodsForObject(object obj)
Parameters
objobjectObject for which the list should be returned
Returns
- List<MacroMethod>
GetMethodsForObject(object, bool)
Returns the list of macro methods suitable for specified object.
public static List<MacroMethod> GetMethodsForObject(object obj, bool includeAnyTypeMethods)
Parameters
objobjectObject for which the list should be returned
includeAnyTypeMethodsboolIf true, methods for any type are included as well
Returns
- List<MacroMethod>
GetMethodsForObject(object, bool, bool)
Returns the list of macro methods suitable for specified object.
public static List<MacroMethod> GetMethodsForObject(object obj, bool includeAnyTypeMethods, bool exactType)
Parameters
objobjectObject for which the list should be returned
includeAnyTypeMethodsboolIf true, methods for any type are included as well
exactTypeboolIf true only methods with exactly the same type are returned (= no inherited members)
Returns
- List<MacroMethod>
RegisterMethod(MacroMethod)
Registers the given method within the method table.
public static void RegisterMethod(MacroMethod method)
Parameters
methodMacroMethodMacro method to register
RegisterMethodInternal(string, Func<EvaluationContext, object[], object>, Type, string, int, object[,], string[], List<Type>)
Registers the given method within the method table.
protected static void RegisterMethodInternal(string name, Func<EvaluationContext, object[], object> method, Type type, string comment, int minimumParameters, object[,] parameterDefinition, string[] specialParameters, List<Type> allowedTypes)
Parameters
namestringMethod name
methodFunc<EvaluationContext, object[], object>Method delegate
typeTypeReturn type of the method
commentstringComment for the method
minimumParametersintMinimal number of parameters needed to call the method
parameterDefinitionobject[,]Parameter definition in format {{name, type, comment}, {name, type, comment}}
specialParametersstring[]A list of special parameters needed to be supplied by resolver
allowedTypesList<Type>List of types for which the method is applicable (set to null for all types to be allowed)
RegisterMethodInternal(string, Func<MacroResolver, object[], object>, Type, string, int, object[,], string[], List<Type>)
Registers the given method within the method table.
protected static void RegisterMethodInternal(string name, Func<MacroResolver, object[], object> method, Type type, string comment, int minimumParameters, object[,] parameterDefinition, string[] specialParameters, List<Type> allowedTypes)
Parameters
namestringMethod name
methodFunc<MacroResolver, object[], object>Method delegate
typeTypeReturn type of the method
commentstringComment for the method
minimumParametersintMinimal number of parameters needed to call the method
parameterDefinitionobject[,]Parameter definition in format {{name, type, comment}, {name, type, comment}}
specialParametersstring[]A list of special parameters needed to be supplied by resolver
allowedTypesList<Type>List of types for which the method is applicable (set to null for all types to be allowed)
RegisterMethodInternal(string, Func<object[], object>, Type, string, int, object[,], string[], List<Type>)
Registers the given method within the method table.
protected static void RegisterMethodInternal(string name, Func<object[], object> method, Type type, string comment, int minimumParameters, object[,] parameterDefinition, string[] specialParameters, List<Type> allowedTypes)
Parameters
namestringMethod name
methodFunc<object[], object>Method delegate
typeTypeReturn type of the method
commentstringComment for the method
minimumParametersintMinimal number of parameters needed to call the method
parameterDefinitionobject[,]Parameter definition in format {{name, type, comment}, {name, type, comment}}
specialParametersstring[]A list of special parameters needed to be supplied by resolver
allowedTypesList<Type>List of types for which the method is applicable (set to null for all types to be allowed)