c# - How to assign delegates as methods of some implemented interface -
I have an interface that specifies two zero methods with no parameters, how do I "plug" two < Code> System.Action (T) Can I apply the interface to methods in some squares? In my example below, this will be in Then, in your example: zero pushfu (action bar 1, action bar 2) method:
public interface IFoo {void Bar1 (); Zero Bar2 (); } Public square Bla {stack & lt; IFoo & gt; _fooStack = new stack & lt; IFoo & gt; (); Public Zero PushFoo (IFoo foo) {_fooStack.Push (foo); } Public Zero Pushfu (Action Bar 1, Action Bar 2) {IFoo foo = null; // bar1 and bar2 to assign foo // foo = ...; _fooStack.Push (foo); }}
Public Zero Pushfu (Action Bar 1, Action Bar 2) {IFoo foo = new ActionableFoo (Bar 1 , Bar 2); _fooStack.Push (foo); }
Comments
Post a Comment