<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=ASP.NET_Tutorial%2FCollections%2FIEnumerator</id>
		<title>ASP.NET Tutorial/Collections/IEnumerator - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=ASP.NET_Tutorial%2FCollections%2FIEnumerator"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.NET_Tutorial/Collections/IEnumerator&amp;action=history"/>
		<updated>2026-04-30T00:11:58Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=ASP.NET_Tutorial/Collections/IEnumerator&amp;diff=2769&amp;oldid=prev</id>
		<title> в 15:30, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.NET_Tutorial/Collections/IEnumerator&amp;diff=2769&amp;oldid=prev"/>
				<updated>2010-05-26T15:30:57Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:30, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=ASP.NET_Tutorial/Collections/IEnumerator&amp;diff=2770&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.NET_Tutorial/Collections/IEnumerator&amp;diff=2770&amp;oldid=prev"/>
				<updated>2010-05-26T11:57:05Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Iteraion==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeFile=&amp;quot;Default.aspx.cs&amp;quot; Inherits=&amp;quot;IterationExamples&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;Iteration Examples&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;h1&amp;gt;Iteration Examples&amp;lt;/h1&amp;gt;&lt;br /&gt;
      This example illustrates the different ways you can iterate through a collection&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;asp:Label ID=&amp;quot;labMsg&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
File: Default.aspx.cs&lt;br /&gt;
using System;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Configuration;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.Web;&lt;br /&gt;
using System.Web.Security;&lt;br /&gt;
using System.Web.UI;&lt;br /&gt;
using System.Web.UI.WebControls;&lt;br /&gt;
using System.Web.UI.WebControls.WebParts;&lt;br /&gt;
using System.Web.UI.HtmlControls;&lt;br /&gt;
public partial class IterationExamples : System.Web.UI.Page&lt;br /&gt;
{&lt;br /&gt;
    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
       Customer c1 = new Customer(&amp;quot;1&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;AA&amp;quot;, &amp;quot;123-4567&amp;quot;);&lt;br /&gt;
       Customer c2 = new Customer(&amp;quot;2&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;BB&amp;quot;, &amp;quot;123-1267&amp;quot;);&lt;br /&gt;
       Customer c3 = new Customer(&amp;quot;3&amp;quot;, &amp;quot;C&amp;quot;, &amp;quot;CC&amp;quot;, &amp;quot;123-7823&amp;quot;);&lt;br /&gt;
       Customer c4 = new Customer(&amp;quot;4&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;DD&amp;quot;, &amp;quot;123-6383&amp;quot;);&lt;br /&gt;
       ArrayList myList = new ArrayList();&lt;br /&gt;
       myList.Add(c1);&lt;br /&gt;
       myList.Add(c2);&lt;br /&gt;
       myList.Add(c3);&lt;br /&gt;
       myList.Add(c4);&lt;br /&gt;
       labMsg.Text = &amp;quot;&amp;lt;h2&amp;gt;First Iteration Output  (ArrayList)&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
       for (int i = 0; i &amp;lt; myList.Count; i++)&lt;br /&gt;
       {&lt;br /&gt;
          Customer c = (Customer)myList[i];&lt;br /&gt;
          labMsg.Text += c.FirstName + &amp;quot;&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
       }&lt;br /&gt;
       labMsg.Text += &amp;quot;&amp;lt;h2&amp;gt;Second Iteration Output (ArrayList)&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
       foreach (Customer c in myList)&lt;br /&gt;
       {&lt;br /&gt;
          labMsg.Text += c.FirstName + &amp;quot;&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
       }&lt;br /&gt;
       labMsg.Text += &amp;quot;&amp;lt;h2&amp;gt;Third Iteration Output (ArrayList)&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
       IEnumerator ie = myList.GetEnumerator();&lt;br /&gt;
       while (ie.MoveNext())&lt;br /&gt;
       {&lt;br /&gt;
          Customer c = (Customer)ie.Current;&lt;br /&gt;
          labMsg.Text += c.FirstName + &amp;quot;&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
       }&lt;br /&gt;
      Hashtable myTable = new Hashtable();&lt;br /&gt;
      myTable.Add(c1.Id, c1);&lt;br /&gt;
      myTable.Add(c2.Id, c2);&lt;br /&gt;
      myTable.Add(c3.Id, c3);&lt;br /&gt;
      myTable.Add(c4.Id, c4);&lt;br /&gt;
&lt;br /&gt;
      labMsg.Text += &amp;quot;&amp;lt;h2&amp;gt;Fourth Iteration Output (Hashtable)&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
      foreach (DictionaryEntry de in myTable)&lt;br /&gt;
      {&lt;br /&gt;
         Customer c = (Customer)de.Value;&lt;br /&gt;
         labMsg.Text += c.FirstName + &amp;quot;&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
      }&lt;br /&gt;
      labMsg.Text += &amp;quot;&amp;lt;h2&amp;gt;Fifth Iteration Output (Hashtable)&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
      foreach (Customer c in myTable.Values)&lt;br /&gt;
      {&lt;br /&gt;
         labMsg.Text += c.FirstName + &amp;quot;&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public abstract class AbstractEntity&lt;br /&gt;
{&lt;br /&gt;
   private string _id;&lt;br /&gt;
  public AbstractEntity(string id)&lt;br /&gt;
  {&lt;br /&gt;
      _id = id;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
   public string Id&lt;br /&gt;
   {&lt;br /&gt;
      get { return _id; }&lt;br /&gt;
      set { _id = value; }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   public abstract bool IsValid&lt;br /&gt;
   {&lt;br /&gt;
      get;&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
public class Customer: AbstractEntity &lt;br /&gt;
{&lt;br /&gt;
   private string _firstName;&lt;br /&gt;
   private string _lastName;&lt;br /&gt;
   private string _phone;&lt;br /&gt;
   public Customer(string id, string firstName, string lastName, string phone): base(id)&lt;br /&gt;
   {&lt;br /&gt;
      _firstName = firstName;&lt;br /&gt;
      _lastName = lastName;&lt;br /&gt;
      _phone = phone;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   public string FirstName&lt;br /&gt;
   {&lt;br /&gt;
      get { return _firstName; }&lt;br /&gt;
      set { _firstName = value; }&lt;br /&gt;
   }&lt;br /&gt;
   public string LastName&lt;br /&gt;
   {&lt;br /&gt;
      get { return _lastName; }&lt;br /&gt;
      set { _lastName = value; }&lt;br /&gt;
   }&lt;br /&gt;
   public string Phone&lt;br /&gt;
   {&lt;br /&gt;
      get { return _phone; }&lt;br /&gt;
      set { _phone = value; }&lt;br /&gt;
   }&lt;br /&gt;
   public string Name&lt;br /&gt;
   {&lt;br /&gt;
      get { return LastName + &amp;quot;, &amp;quot; + FirstName; }&lt;br /&gt;
   }&lt;br /&gt;
   public override bool IsValid&lt;br /&gt;
   {&lt;br /&gt;
      get&lt;br /&gt;
      {&lt;br /&gt;
         if (Id.Length &amp;gt; 0 &amp;amp;&amp;amp; LastName.Length &amp;gt; 0)&lt;br /&gt;
            return true;&lt;br /&gt;
         else&lt;br /&gt;
            return false;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   public override string ToString()&lt;br /&gt;
   {&lt;br /&gt;
      return Id + &amp;quot;,&amp;quot; + Name + &amp;quot;,&amp;quot; + Phone; &lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Iteration Examples Generics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeFile=&amp;quot;Default.aspx.cs&amp;quot; Inherits=&amp;quot;IterationExamplesGenerics&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;head id=&amp;quot;Head1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;Iteration Examples Generics&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;div id=&amp;quot;container&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;h1&amp;gt;Generics Iteration Examples&amp;lt;/h1&amp;gt;&lt;br /&gt;
      This example illustrates the different ways you can iterate through a generic collection&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;asp:Label ID=&amp;quot;labMsg&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
File: Default.aspx.cs&lt;br /&gt;
using System;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Configuration;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Web;&lt;br /&gt;
using System.Web.Security;&lt;br /&gt;
using System.Web.UI;&lt;br /&gt;
using System.Web.UI.WebControls;&lt;br /&gt;
using System.Web.UI.WebControls.WebParts;&lt;br /&gt;
using System.Web.UI.HtmlControls;&lt;br /&gt;
public partial class IterationExamplesGenerics : System.Web.UI.Page&lt;br /&gt;
{&lt;br /&gt;
    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
       Customer c1 = new Customer(&amp;quot;1&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;AA&amp;quot;, &amp;quot;123-4567&amp;quot;);&lt;br /&gt;
       Customer c2 = new Customer(&amp;quot;2&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;BB&amp;quot;, &amp;quot;123-1267&amp;quot;);&lt;br /&gt;
       Customer c3 = new Customer(&amp;quot;3&amp;quot;, &amp;quot;C&amp;quot;, &amp;quot;CC&amp;quot;, &amp;quot;123-7823&amp;quot;);&lt;br /&gt;
       Customer c4 = new Customer(&amp;quot;4&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;DD&amp;quot;, &amp;quot;123-6383&amp;quot;);&lt;br /&gt;
       List&amp;lt;Customer&amp;gt; myList = new List&amp;lt;Customer&amp;gt;();&lt;br /&gt;
       myList.Add(c1);&lt;br /&gt;
       myList.Add(c2);&lt;br /&gt;
       myList.Add(c3);&lt;br /&gt;
       myList.Add(c4);&lt;br /&gt;
       labMsg.Text = &amp;quot;&amp;lt;h2&amp;gt;First Iteration Output (List)&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
       for (int i = 0; i &amp;lt; myList.Count; i++)&lt;br /&gt;
       {&lt;br /&gt;
          Customer c = myList[i];&lt;br /&gt;
          labMsg.Text += c.FirstName + &amp;quot;&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
       }&lt;br /&gt;
       labMsg.Text += &amp;quot;&amp;lt;h2&amp;gt;Second Iteration Output (List)&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
       foreach (Customer c in myList)&lt;br /&gt;
       {&lt;br /&gt;
          labMsg.Text += c.FirstName + &amp;quot;&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
       }&lt;br /&gt;
       labMsg.Text += &amp;quot;&amp;lt;h2&amp;gt;Third Iteration Output (List)&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
       IEnumerator&amp;lt;Customer&amp;gt; ie = myList.GetEnumerator();&lt;br /&gt;
       while (ie.MoveNext())&lt;br /&gt;
       {&lt;br /&gt;
          Customer c = ie.Current;&lt;br /&gt;
          labMsg.Text += c.FirstName + &amp;quot;&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
       }&lt;br /&gt;
       Dictionary&amp;lt;string,Customer&amp;gt; dict = new Dictionary&amp;lt;string,Customer&amp;gt;();&lt;br /&gt;
       dict.Add(c1.Id, c1);&lt;br /&gt;
       dict.Add(c2.Id, c2);&lt;br /&gt;
       dict.Add(c3.Id, c3);&lt;br /&gt;
       dict.Add(c4.Id, c4);&lt;br /&gt;
       labMsg.Text += &amp;quot;&amp;lt;h2&amp;gt;Fourth Iteration Output (Dictionary)&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
       foreach (KeyValuePair&amp;lt;string, Customer&amp;gt; pair in dict)&lt;br /&gt;
       {&lt;br /&gt;
          Customer c = pair.Value;&lt;br /&gt;
          labMsg.Text += c.FirstName + &amp;quot;&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
       }&lt;br /&gt;
       labMsg.Text += &amp;quot;&amp;lt;h2&amp;gt;Fifth Iteration Output (Dictionary)&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
       foreach (Customer c in dict.Values)&lt;br /&gt;
       {&lt;br /&gt;
          labMsg.Text += c.FirstName + &amp;quot;&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public abstract class AbstractEntity&lt;br /&gt;
{&lt;br /&gt;
   private string _id;&lt;br /&gt;
  public AbstractEntity(string id)&lt;br /&gt;
  {&lt;br /&gt;
      _id = id;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
   public string Id&lt;br /&gt;
   {&lt;br /&gt;
      get { return _id; }&lt;br /&gt;
      set { _id = value; }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   public abstract bool IsValid&lt;br /&gt;
   {&lt;br /&gt;
      get;&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
public class Customer: AbstractEntity &lt;br /&gt;
{&lt;br /&gt;
   private string _firstName;&lt;br /&gt;
   private string _lastName;&lt;br /&gt;
   private string _phone;&lt;br /&gt;
   public Customer(string id, string firstName, string lastName, string phone): base(id)&lt;br /&gt;
   {&lt;br /&gt;
      _firstName = firstName;&lt;br /&gt;
      _lastName = lastName;&lt;br /&gt;
      _phone = phone;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   public string FirstName&lt;br /&gt;
   {&lt;br /&gt;
      get { return _firstName; }&lt;br /&gt;
      set { _firstName = value; }&lt;br /&gt;
   }&lt;br /&gt;
   public string LastName&lt;br /&gt;
   {&lt;br /&gt;
      get { return _lastName; }&lt;br /&gt;
      set { _lastName = value; }&lt;br /&gt;
   }&lt;br /&gt;
   public string Phone&lt;br /&gt;
   {&lt;br /&gt;
      get { return _phone; }&lt;br /&gt;
      set { _phone = value; }&lt;br /&gt;
   }&lt;br /&gt;
   public string Name&lt;br /&gt;
   {&lt;br /&gt;
      get { return LastName + &amp;quot;, &amp;quot; + FirstName; }&lt;br /&gt;
   }&lt;br /&gt;
   public override bool IsValid&lt;br /&gt;
   {&lt;br /&gt;
      get&lt;br /&gt;
      {&lt;br /&gt;
         if (Id.Length &amp;gt; 0 &amp;amp;&amp;amp; LastName.Length &amp;gt; 0)&lt;br /&gt;
            return true;&lt;br /&gt;
         else&lt;br /&gt;
            return false;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   public override string ToString()&lt;br /&gt;
   {&lt;br /&gt;
      return Id + &amp;quot;,&amp;quot; + Name + &amp;quot;,&amp;quot; + Phone; &lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>