hi there!)
friends, i have deal with IEnumerable interface. At msdn there is an example but it's quite difficult to understand, so if someone can i ask to comment this lines which are in bold -
public class Person
{
public Person(string fName, string lName)
{
this.firstName = fName;
this.lastName = lName;
}
public string firstName;
public string lastName;
}
public class People : [U]IEnumerable[/U]
{
private Person[] _people;
public People(Person[] [B]pArray[/B])
{
_people = new Person[pArray.Length];
[B] for (int i = 0; i < pArray.Length; i++)
{
_people[i] = pArray[i];
}[/B]
}
[B]IEnumerator IEnumerable.GetEnumerator()
{
return (IEnumerator) GetEnumerator();
}
public PeopleEnum GetEnumerator()
{
return new PeopleEnum(_people);
}[/B]
}
public class PeopleEnum : IEnumerator
{ }
the sourse (MSDN)
2) what is pArray?)
big thank you in advance!)