Say I have an interface that specifies two void methods with no parameters. How can I “plug” two System.Action(T) methods in some class that implements the interface? In my example below, this would be in the void PushFoo(Action bar1, Action bar2) method:
public interface IFoo
{
void Bar1();
void Bar2();
}
public class Bla
{
Stack<IFoo> _fooStack = new Stack<IFoo>();
public void PushFoo(IFoo foo)
{
_fooStack.Push(foo);
}
public void PushFoo(Action bar1, Action bar2)
{
IFoo foo = null;
// assign bar1 and bar2 to foo
//foo = ... ;
_fooStack.Push(foo);
}
}
Then , in your example: