随笔分类 - GetEnumerator 方法(转C#源码)
摘要:下面的代码示例演示如何实现自定义集合的 IEnumerable 接口。在此示例中,没有显式调用但实现了 GetEnumerator,以便支持使用 foreach(在 Visual Basic 中为 for each)。此代码示例摘自 IEnumerable 接口的一个更大的示例。view plaincopy to clipboardprint?public class People : IEnum...
        阅读全文
                
摘要:下面的代码示例演示如何使用 GetEnumerator 方法来创建 System.Collections.IEnumerator 接口,该接口可被循环访问以显示 DataGridColumnCollection 集合的内容。view plaincopy to clipboardprint? DataGridCo...
        阅读全文
                
摘要:示例说明如何使用 GetEnumerator 方法创建一个实现了 System.Collections.IEnumerator 的对象。然后循环访问该对象以显示选定行中的项。view plaincopy to clipboardprint? TableCellCollection Example ...
        阅读全文
                
摘要:下面的代码示例使用 GetEnumerator 方法显示输入字符串中的每个 System.Char。view plaincopy to clipboardprint?// Example for the String.GetEnumerator( ) method. using System; using System.Collections; class GetEnumerato...
        阅读全文
                
摘要:下面的示例演示如何使用 GetEnumerator 方法检索一个枚举数,该枚举数包含集合中的值。然后,循环访问该枚举数,并将第一个单元格的值显示在页上。view plaincopy to clipboardprint? GridViewRowCollection GetEnumerator Example ...
        阅读全文
                
摘要:下面的代码示例阐释了如何使用 GetEnumerator 方法。view plaincopy to clipboardprint?// Get 'Validators' of the page to myCollection. ValidatorCollection myCollection = Page.Validators; // Get the Enumerator. IEn...
        阅读全文
                
摘要:下面的示例展示如何使用 GetEnumerator 方法创建一个实现了 System.Collections.IEnumerator 的对象,该对象被循环访问以显示表中的项。view plaincopy to clipboardprint? TableCellCollection Example ...
        阅读全文
                
摘要:下面的代码示例演示如何使用 GetEnumerator 方法创建 System.Collections.IEnumerator 对象。然后循环访问 System.Collections.IEnumerator 对象以显示 HtmlTableRowCollection 集合的内容。view plaincopy to clipboardprint? ...
        阅读全文
                
 
                    
                
 浙公网安备 33010602011771号
浙公网安备 33010602011771号