11 2012 档案

摘要:委托的基本概念就不说了,我先简单说一下什么是多播委托。包含多个方法的委托就是多播委托。简单地举了例子:delegate void MyDelegate(); static void Main(string[] args) { MyDelegate my1 = Write; my1 += Read; Console.ReadLine(); } static void Write() { Console.WriteLine("Write t... 阅读全文
posted @ 2012-11-30 18:04 のんきネコ 阅读(294) 评论(0) 推荐(0) 编辑
摘要:上次公司内部考试时考到了,但是没用过,考到了一大片。今天看书的时候又看到这个方法,于是稍微分析了一下。 public class Test { public static void Main(string[] args) { int bookIndex; string[] book1 = { "book1", "book7", "book3" }; bookIndex = Array.BinarySearch(book1,"book3"); Con... 阅读全文
posted @ 2012-11-23 16:37 のんきネコ 阅读(1935) 评论(1) 推荐(0) 编辑
摘要:声明接口public interface Iinterface { void GetUserName(); } 同上以上示例可以看出,接口中只能包含方法、属性、索引器和事件的声明。不允许声明成员上的修饰符。 因为接口成员是暴露的,所以添加其他修饰符毫无意思,甚至连public都不用加。接口的派生public interface Iinterface{ string GetUserName();}class Test1 : Iinterface{ public string GetUserName() { return "name"; }} 如果一个派... 阅读全文
posted @ 2012-11-23 13:18 のんきネコ 阅读(185) 评论(0) 推荐(0) 编辑
摘要:虚方法: 如果要在派生类中继承方法或属性,那么就必须在基类中将该属性声明为virtual。 方法或属性在默认情况下是不虚拟的,所以如果不在基类中显示声明,在派生类中用override重写该方法时就会报错。 当然,如果在派生类中用new来隐藏基类方法也没有问题。 我们看下面一个例子: public class A { public void MethodF() { Console.WriteLine("A.F"); } public virtual void MethodG() { ... 阅读全文
posted @ 2012-11-22 18:03 のんきネコ 阅读(845) 评论(0) 推荐(0) 编辑
摘要:call方法实现JS中类的继承 阅读全文
posted @ 2012-11-09 16:59 のんきネコ 阅读(129) 评论(0) 推荐(0) 编辑
摘要:jqPlot图表中文API使用文档及源码和在线示例http://www.itivy.com/ivy/archive/2012/1/24/jquery-jqplot.htmlGoogle Chart 图表使用详解http://www.itivy.com/ivy/archive/2011/3/23/634365008147345032.html 阅读全文
posted @ 2012-11-08 15:58 のんきネコ 阅读(161) 评论(0) 推荐(0) 编辑