随笔分类 -  泛型

摘要:http://www.cnblogs.com/terryzh/archive/2012/11/10/2763538.htmlLinQ To Object 基本用法inq的基本语法:varresult=fromitemincontainerselectitem;linq获取数据子集:varresult=fromitemincontainerwherebooleanexpressionselectitem;Select用法:var selectedItems = from item in items where item.ParentID == parentID ... 阅读全文
posted @ 2013-07-07 20:08 cpcpc 阅读(909) 评论(0) 推荐(1) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 泛型接口{ public class GenericList<T> : System.Collections.Generic.IEnumerable<T> { //字段 protected Node head; protected Node current = null; //嵌套类 protected class Node { //字段 public Node next; private 阅读全文
posted @ 2010-05-04 14:47 cpcpc 阅读(244) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 泛型委托{ delegate void StackEventHandler<T,U>(T sender,U eventArgs); //定义委托 //delegate void BinaryOp (int x, int y); //非泛型定义委托 class Stack<T> { public class StackEventArgs : EventArgs { } public even 阅读全文
posted @ 2010-05-04 14:45 cpcpc 阅读(215) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 泛型_一__什么是泛型{ public class GenericList<T> { private class Node { //字段 private Node next; private T data; //有参构造函数 public Node(T t) { next = null; data = t; } //属性 next public Node Next { get { return nex 阅读全文
posted @ 2010-05-04 10:22 cpcpc 阅读(251) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示