ICalculationContextFactory Interface
Factory for creating and compiling an object which inherits the CalculationContext<TValue>.
public interface ICalculationContextFactoryMethods
Section titled “Methods”ICalculationContextFactory.Create<TValue>(ICustomFunctionContext<TValue>, string, string, Type, Assembly, MetadataReference, IReadOnlyDictionary<string,ICustomFunction>) Method
Section titled “ICalculationContextFactory.Create<TValue>(ICustomFunctionContext<TValue>, string, string, Type, Assembly, MetadataReference, IReadOnlyDictionary<string,ICustomFunction>) Method”Creates a new object that inherits the CalculationContext<TValue>. The object contains instances for each ICustomFunction used in the given parsedFormula. For each instance, it contains a method wrapper that converts the method call to the associated ICustomFunction.Evaluate method using the name of the ICustomFunction. It also implements that the first time the customFunction is called, the ICustomFunction.PerformBeforeEvaluate method is called.
object Create<TValue>(HAKOM.TSM.Net.Api.Calculation.Formulas.CustomFunctions.ICustomFunctionContext<TValue> customFunctionContext, ref string parsedFormula, string originalFormula, out System.Type? globalType, out System.Reflection.Assembly? globalAssembly, out Microsoft.CodeAnalysis.MetadataReference? reference, out System.Collections.Generic.IReadOnlyDictionary<string,HAKOM.TSM.Net.Api.Calculation.Formulas.CustomFunctions.ICustomFunction>? customFunctions) where TValue : System.IEquatable<TValue>, System.IComparable<TValue>;Type parameters
Section titled “Type parameters”TValue
The type of the value of the data.
Parameters
Section titled “Parameters”customFunctionContext HAKOM.TSM.Net.Api.Calculation.Formulas.CustomFunctions.ICustomFunctionContext<TValue>
The ICustomFunctionContext<TValue> for the instances of ICustomFunction.
parsedFormula System.String
The formula which is already parsed with the IFormulaParser.
originalFormula System.String
A System.String containing the original formula which was parsed.
globalType System.Type
Returns the type of the Return-object.
globalAssembly System.Reflection.Assembly
Returns the compiled assembly of the Return-object.
reference Microsoft.CodeAnalysis.MetadataReference
Returns the globalAssembly as a Microsoft.CodeAnalysis.MetadataReference.
customFunctions System.Collections.Generic.IReadOnlyDictionary<System.String,ICustomFunction>
Returns the ICustomFunction instances used in the parsedFormula, keyed by name.
Returns
Section titled “Returns”System.Object
Returns a new object that inherits the CalculationContext<TValue>.
ICalculationContextFactory.TryCreate<TValue>(ICustomFunctionContext<TValue>, string, string, Type, Assembly, MetadataReference, IReadOnlyDictionary<string,ICustomFunction>) Method
Section titled “ICalculationContextFactory.TryCreate<TValue>(ICustomFunctionContext<TValue>, string, string, Type, Assembly, MetadataReference, IReadOnlyDictionary<string,ICustomFunction>) Method”Creates a new object that inherits the CalculationContext<TValue>. The object contains instances for each ICustomFunction used in the given parsedFormula. For each instance, it contains a method wrapper that converts the method call to the associated ICustomFunction.Evaluate method using the name of the ICustomFunction. It also implements that the first time the customFunction is called, the ICustomFunction.PerformBeforeEvaluatemethod is called.
HAKOM.ErrorHandling.Core.Net.Api.Result<object> TryCreate<TValue>(HAKOM.TSM.Net.Api.Calculation.Formulas.CustomFunctions.ICustomFunctionContext<TValue> customFunctionContext, ref string parsedFormula, string originalFormula, out System.Type? globalType, out System.Reflection.Assembly? globalAssembly, out Microsoft.CodeAnalysis.MetadataReference? reference, out System.Collections.Generic.IReadOnlyDictionary<string,HAKOM.TSM.Net.Api.Calculation.Formulas.CustomFunctions.ICustomFunction>? customFunctions) where TValue : System.IEquatable<TValue>, System.IComparable<TValue>;Type parameters
Section titled “Type parameters”TValue
The type of the value of the data.
Parameters
Section titled “Parameters”customFunctionContext HAKOM.TSM.Net.Api.Calculation.Formulas.CustomFunctions.ICustomFunctionContext<TValue>
The ICustomFunctionContext<TValue> for the instances of ICustomFunction.
parsedFormula System.String
The formula which is already parsed with the IFormulaParser.
originalFormula System.String
A System.String containing the original formula which was parsed.
globalType System.Type
Returns the type of the Return-object.
globalAssembly System.Reflection.Assembly
Returns the compiled assembly of the Return-object.
reference Microsoft.CodeAnalysis.MetadataReference
Returns the globalAssembly as a Microsoft.CodeAnalysis.MetadataReference.
customFunctions System.Collections.Generic.IReadOnlyDictionary<System.String,ICustomFunction>
Returns the ICustomFunction instances used in the parsedFormula, keyed by name.
Returns
Section titled “Returns”HAKOM.ErrorHandling.Core.Net.Api.Result<System.Object>
Returns a Result<TValue> of a new object that inherits the CalculationContext<TValue>.