Skip to content
Documentation

ICustomFunction Interface

Base interface for custom functions. This interface provides all properties and methods which are independent of the parameters and return type of the implemented custom function.

public interface ICustomFunction

Derived
↳ ICustomFunction<TParameter,TResult>
↳ ICustomFunction<TParameter1,TParameter2,TParameter3,TParameter4,TParameter5,TParameter6,TParameter7,TParameter8,TParameter9,TResult>
↳ ICustomFunction<TParameter1,TParameter2,TParameter3,TParameter4,TParameter5,TParameter6,TParameter7,TParameter8,TResult>
↳ ICustomFunction<TParameter1,TParameter2,TParameter3,TParameter4,TParameter5,TParameter6,TParameter7,TResult>
↳ ICustomFunction<TParameter1,TParameter2,TParameter3,TParameter4,TParameter5,TParameter6,TResult>
↳ ICustomFunction<TParameter1,TParameter2,TParameter3,TParameter4,TParameter5,TResult>
↳ ICustomFunction<TParameter1,TParameter2,TParameter3,TParameter4,TResult>
↳ ICustomFunction<TParameter1,TParameter2,TParameter3,TResult>
↳ ICustomFunction<TParameter1,TParameter2,TResult>
↳ ICustomFunction<TResult>

Please use one of the sub-interfaces for implementing a custom function.

ICustomFunction.Initialize<TValue>(ICustomFunctionContext<TValue>) Method

Section titled “ICustomFunction.Initialize<TValue>(ICustomFunctionContext<TValue>) Method”

Is called once for every calculation of an IFormula, regardless if the ICustomFunction is used in the IFormula or not. Therefore, the method should require as little runtime and memory as possible.

System.Threading.Tasks.Task Initialize<TValue>(HAKOM.TSM.Net.Api.Calculation.Formulas.CustomFunctions.ICustomFunctionContext<TValue> context)
where TValue : System.IEquatable<TValue>, System.IComparable<TValue>;

TValue

The type of the values, which will be calculated.

context HAKOM.TSM.Net.Api.Calculation.Formulas.CustomFunctions.ICustomFunctionContext<TValue>

The ICustomFunctionContext<TValue> which provides properties like referenced ITimeSeries for the calculation.

System.Threading.Tasks.Task
An awaitable System.Threading.Tasks.Task.

ICustomFunction.TryGetReference<TValue>(ITimeSeriesData<TValue>, ICustomFunctionContext<TValue>, ITimeSeriesReferenceWithData<TValue>) Method

Section titled “ICustomFunction.TryGetReference<TValue>(ITimeSeriesData<TValue>, ICustomFunctionContext<TValue>, ITimeSeriesReferenceWithData<TValue>) Method”

Tries to get the ITimeSeriesReference and ITimeSeriesDataCollection<TValue> containing the data in the reading period of a time series reference using an ITimeSeriesData<TValue>. If the given data does not result form a time series reference this method returns false.

bool TryGetReference<TValue>(HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesData<TValue> data, HAKOM.TSM.Net.Api.Calculation.Formulas.CustomFunctions.ICustomFunctionContext<TValue> context, out HAKOM.TSM.Net.Api.Calculation.ITimeSeriesReferenceWithData<TValue> reference)
where TValue : System.Numerics.IAdditionOperators<TValue, TValue, TValue>, System.Numerics.ISubtractionOperators<TValue, TValue, TValue>, System.Numerics.IMultiplyOperators<TValue, TValue, TValue>, System.Numerics.IDivisionOperators<TValue, TValue, TValue>, System.IEquatable<TValue>, System.IComparable<TValue>;

TValue

The type of the values, which will be calculated.

data HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesData<TValue>

The ITimeSeriesData<TValue>, which will be used to get the reference.

context HAKOM.TSM.Net.Api.Calculation.Formulas.CustomFunctions.ICustomFunctionContext<TValue>

The ICustomFunctionContext<TValue>, which provides properties like the referenced ITimeSeries for the calculation.

reference HAKOM.TSM.Net.Api.Calculation.ITimeSeriesReferenceWithData<TValue>

A tuple containing the referenced ITimeSeries and the ITimeSeriesDataCollection<TValue> holding its data.

System.Boolean
True if a ITimeSeries and ITimeSeriesDataCollection<TValue> could be found to the given ITimeSeriesData<TValue>.

© 2026 Volue.Version v0.6.38017 November 2026