随笔分类 - 泛型
摘要: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 ...
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文