Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-async-50.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ad9f004a91634fea284ba426313a0935681d0dc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System.Threading.Tasks;
using System;

class X
{
	static void Main ()
	{
		var x = new X ();
		x.Run ().Wait ();
	}

	Task<int> AnimateAsync (Action callback)
	{
		callback ();
		return Task.FromResult (2);
	}

	void SecondLevel (Action callback)
	{
		callback ();
	}

	async Task Run ()
	{
		var ret = await AnimateAsync (() => {
			SecondLevel (() => {
				Console.WriteLine (this);
			});
		});
	}
}