for example, the following proxy
delegate string say hello (string name, bool is happy) is defined;
Then there are only two input parameters, a string and a Boolean; Only methods whose output parameter is string can be used to construct SayHello.
For example, there are two methods
StringM1 (StringName, Boolis Happy)
StringM2 (StringName)
to execute new MyDelegate(m1); OK, execute new MyDelegate(m2); Will report an error.
2. The constructor of delegate passes in a pointer to the method, so it receives p.InstanceMethod instead of p.InstanceMethod (). D () is equivalent to d.Invoke ();
d.Invoke () is recommended; Writing instead of d (); Writing, because the former is more readable.
? : :____________________? ______ ? :_________
? : ________? :__________? : ______________________
: ________