Skip to content

Instantly share code, notes, and snippets.

@zeryx
Created April 25, 2019 17:28
Show Gist options
  • Save zeryx/8e99b463f269e3810be6f362b0556a0b to your computer and use it in GitHub Desktop.
Save zeryx/8e99b463f269e3810be6f362b0556a0b to your computer and use it in GitHub Desktop.
public class InternalHandler<I1, I2, O>
{
public delegate O ApplyMethod1(I1 input);
public delegate O ApplyMethod2(I1 input, I2 context);
public delegate I2 LoadMethod();
private I2 _context = default;
private LoadMethod _loadMethod = () => { return default;};
private ApplyMethod1 _applyMethod1;
private ApplyMethod2 _applyMethod2;
public AlgorithmHandler(ApplyMethod1 func)
{
_applyMethod1 = func;
}
public AlgorithmHandler(ApplyMethod2 func)
{
_applyMethod2 = func;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment