Exemplo n.º 1
0
        public void Setup()
        {
            MethodVoid methodVoid = PrintHello;
            MethodInt  methodInt  = Inc;

            myDelegateVoid = new(methodVoid.Method);
            myDelegateInt  = new(methodInt.Method);
        }
Exemplo n.º 2
0
        public void TestMyDelegate()
        {
            MethodVoid methodVoid = PrintHello;

            myDelegateVoid += methodVoid.Method;
            methodVoid     -= PrintHello;
            methodVoid     += PrintHi;
            myDelegateVoid += methodVoid.Method;
            myDelegateVoid += methodVoid.Method;
            methodVoid     -= PrintHi;
            methodVoid     += ThrowException;
            myDelegateVoid += methodVoid.Method;
            myDelegateVoid += methodVoid.Method;
            myDelegateVoid.Invoke(this, null);
        }
Exemplo n.º 3
0
 public ActionVoid(MethodVoid method)
 {
     _method = method;
 }