惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
T
The Blog of Author Tim Ferriss
C
Check Point Blog
博客园_首页
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
L
LangChain Blog
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
爱范儿
爱范儿
Vercel News
Vercel News
博客园 - Franky
V
V2EX
IT之家
IT之家
U
Unit 42
N
Netflix TechBlog - Medium
腾讯CDC
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
博客园 - 叶小钗
H
Help Net Security
V
Visual Studio Blog
GbyAI
GbyAI

博客园 - 左佩玉

通过了 70-316 考试 .NET SDK 工具 线程 进程 程序配置 程序集 全局化和本地化 实现帮助 可访问性设计 访问和调用外部组件 实现打印 自定义控件 使用 GDI+ 在ADO.net 中使用xml 绑定、查看和筛选数据 ADO.net 处理和抛出异常 使用Debug和Trace 测试和调试
继承 System.Collections.CollectionBase 创建一个强类型集合类
左佩玉 · 2005-08-21 · via 博客园 - 左佩玉

using System;

namespace Joe_s_Doughnut_Shop_CSharp
{
    
/// <summary>
    
/// Summary description for DoughnutCollection.
    
/// </summary>

    public class DoughnutCollection : System.Collections.CollectionBase
    
{
        
public DoughnutCollection()
        
{
            
//
            
// TODO: Add constructor logic here
            
//
        }
          //添加对象
        
public void Add(DoughnutMachine.Doughnut aDoughnut)
        
{
            List.Add(aDoughnut);
        }
          //索引器
        
public DoughnutMachine.Doughnut this[int index]
        
{
            
get
            
{
                
return (DoughnutMachine.Doughnut)List[index];
            }

        }
        //移除对象
        
public void Remove(DoughnutMachine.Doughnut aDoughnut)
        
{
            
if (List.Contains(aDoughnut) == true)
            
{
                List.Remove(aDoughnut);
            }

        }

    }

}