Пример #1
0
		public static int Main(string[] args)
		{
			FooList l = new FooList();
			Foo f1 = new Foo("First");
			Foo f2 = new Foo("Second");

			l.Add(f1);
			l.Add(f2);

			foreach (Foo f in l) {
			}

			if (FooList.foo_current_called != true)
				return 1;
			if (FooList.ienumerator_current_called != false)
				return 2;
			Console.WriteLine ("Test passes");
			return 0;
		}
Пример #2
0
        public static int Main(string[] args)
        {
            FooList l  = new FooList();
            Foo     f1 = new Foo("First");
            Foo     f2 = new Foo("Second");

            l.Add(f1);
            l.Add(f2);

            foreach (Foo f in l)
            {
            }

            if (FooList.foo_current_called != true)
            {
                return(1);
            }
            if (FooList.ienumerator_current_called != false)
            {
                return(2);
            }
            Console.WriteLine("Test passes");
            return(0);
        }
Пример #3
0
 public FooEnumerator(FooList mappings)
 {
     this.temp           = (IEnumerable)(mappings);
     this.baseEnumerator = temp.GetEnumerator();
 }
Пример #4
0
			public FooEnumerator(FooList mappings) 
			{
				this.temp = (IEnumerable) (mappings);
				this.baseEnumerator = temp.GetEnumerator();
			}