文章分类 -  C#

摘要:You can't derive from Delegate and MulticastDelegate except compiler and some tools, because they are special class. If you declar a delegate with met... 阅读全文
posted @ 2016-01-25 23:37 penney
摘要:1. 值类型 和引用类型的区别c# 所有类型分为以下四种类型。值类型引用类型泛型参数指针类型值类型包含系统内置的类型,数字类型,字符类型,布尔类型和自定义的结构体和枚举引用类型包含所有的类,数组,委托,接口 包括string1.而这最大的区别是对内存的处理值类型每次赋值就是一次内存拷贝引用类型在内存... 阅读全文
posted @ 2014-07-28 22:10 penney
摘要:A generic method declares type parameters within the signature of a method 。it introduces typeparameters (with the angle bracket syntax). 阅读全文
posted @ 2014-07-11 15:59 penney
摘要:1、使用ref型参数时,传入的参数必须先被初始化。对out而言,必须在方法中对其完成初始化。2、使用ref和out时,在方法的参数和执行方法时,都要加Ref或Out关键字。以满足匹配。3、out适合用在需要retrun多个返回值的地方,而ref则用在需要被调用的方法修改调用者的引用的时候。注:在C#... 阅读全文
posted @ 2014-06-13 14:35 penney
摘要:public class SortableObservableCollection : ObservableCollection { public void Sort(Func resultSelector, ListSortDirection direction) ... 阅读全文
posted @ 2014-05-27 16:03 penney