You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! First of all, thank you for the ExpressionEvaluator, it save a lot of time
I have one problem with adding new function with some variables and use it. I see the ExpressionParser has
public void RegisterFunction(string functionName, Delegate function)
{
functions[functionName] = function;
}
Okey, I want to write function standard deviation , double StDev(double[] array). I`m creating new Delegate,
public class MethodsContainer
{
public double StDev(double[] array)
{
double result = 0;// do some with array;
return result;
}
}
public class DelegateCreator
{
public Delegate CreateNew()
{
MethodsContainer container = new MethodsContainer();
MethodInfo method = container.GetType().GetMethod("StDev");
var newDelegate = Delegate.CreateDelegate(typeof(Func<double[], double>), container, method);
return newDelegate;
}
}
then register it through RegisterFunction. What i need to do next time? Please, provide example if it`s possible
Have a good day!
The text was updated successfully, but these errors were encountered:
Hello! First of all, thank you for the ExpressionEvaluator, it save a lot of time
I have one problem with adding new function with some variables and use it. I see the ExpressionParser has
public void RegisterFunction(string functionName, Delegate function)
{
functions[functionName] = function;
}
Okey, I want to write function standard deviation , double StDev(double[] array). I`m creating new Delegate,
public class MethodsContainer
{
public double StDev(double[] array)
{
double result = 0;// do some with array;
return result;
}
}
then register it through RegisterFunction. What i need to do next time? Please, provide example if it`s possible
Have a good day!
The text was updated successfully, but these errors were encountered: