Advertisement
Fhernd

Gente.cs

Aug 9th, 2017
14,700
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System.Collections;
  2. using System;
  3.  
  4. namespace cap07.usoienumerator
  5. {
  6.     public class Gente : IEnumerable
  7.     {
  8.         private Persona[] personas;
  9.  
  10.         public Gente(Persona[] personas)
  11.         {
  12.             this.personas = new Persona[personas.Length];
  13.  
  14.             for(int i = 0; i < personas.Length; ++i)
  15.             {
  16.                 this.personas[i] = personas[i];
  17.             }
  18.         }
  19.  
  20.         IEnumerator IEnumerable.GetEnumerator()
  21.         {
  22.             return (IEnumerator) GetEnumerator();
  23.         }
  24.  
  25.         public GenteEnumerator GetEnumerator()
  26.         {
  27.             return new GenteEnumerator(personas);
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement