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

gtest-iter-07.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 80ac3b15e9138ff4b59a8f8bc89e6b1326e6c251 (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
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;

public class Test
{
	public static int Main ()
	{
		MySystem mySystem = new MySystem ();
		return 0;
	}

	public static void TestFunction (IEnumerable<string> items)
	{
		List<string> newList;
		Console.WriteLine ("1");
		newList = new List<string> (items);
		Console.WriteLine ("2");
		newList = new List<string> (items);
	}
}

public class MySystem
{
	private List<string> _items = new List<string> ();

	public MySystem ()
	{
		_items.Add ("a");
	}

	public IEnumerable<string> Items
	{
		get
		{
			foreach (string i in _items) {
				Console.WriteLine (i);
				yield return i;
			}
		}
	}
}