Beispiel #1
0
 public void useDelegate(voidFunction v)
 {
     for (int i = 0; i < 3; i++)
     {
         v();
     }
 }
Beispiel #2
0
        private void button_study_Delegate_Click(object sender, EventArgs e)
        {
#if DEBUG // Debug 모드일때만 실행
#else
            if (false)
            {
                voidFunction v = temp;
                v();
                useDelegate(v);
            }
#endif

            voidFunction v2 = delegate() { MessageBox.Show("익명 델리게이트 사용"); };
            useDelegate(v2);

            voidFunction lamda = () =>
            {
                MessageBox.Show("람다 사용");
            };

            lamda();
        }
Beispiel #3
0
 public void ExecuteAfter(voidFunction func)
 {
     lateFunc = lateFunc == null ? func : lateFunc + func;
 }
Beispiel #4
0
 static voidFunction sayHi(voidFunction voidFunction)
 {
     return(voidFunction);
 }