Example of teacher Liu Tiemeng’s video lesson commission

Commissioned example-learning teacher Liu video

Insert picture description here
1: Unicast delegation (synchronous call)
Insert picture description here
operation result:
Insert picture description here
2: Multicast delegation (synchronous call)
Insert picture description here
operation result is the same as unicast delegation

3: Direct synchronous call
Insert picture description here
Operation result:
Insert picture description here
4: Indirect synchronous call (unicast):
Insert picture description here
Multicast mode:

    action1 += action2;
    action2 += action3;
    action1.Invoke();

The running result is the same as the direct synchronous call

5: Delegate implicit asynchronous call
Insert picture description here
Operation result:
Insert picture description here
6: Delegate display asynchronous call
Insert picture description here
Operation result:
Insert picture description here
7: Task asynchronous call
Insert picture description here
Operation result:
Insert picture description here

Guess you like

Origin blog.csdn.net/lm393485/article/details/109106065