문제

I have a method with this signature,

void Add(Control control, Action redraw)

I need to call it like this

myClass.Add(myControl, {Some code});

Where {Some Code} to be replaced with anonymous function.

P.S. Action redraw doesnt take or return any parameters.

도움이 되었습니까?

해결책

I have found the answer to the question using lambda expressions.

myClass.Add(myControl, () => { myControl.Visible = false; });
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top