Skip to content
Documentation

ICalculationContextFactory Interface

Factory for creating and compiling an object which inherits the CalculationContext<TValue>.

public interface ICalculationContextFactory

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>;

TValue

The type of the value of the data.

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.

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>;

TValue

The type of the value of the data.

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.

HAKOM.ErrorHandling.Core.Net.Api.Result<System.Object>
Returns a Result<TValue> of a new object that inherits the CalculationContext<TValue>.

© 2026 Volue.Version v0.6.38017 November 2026