摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{/*接口只声明、无实现、不能实例化;接口可包含方法、属性、事件、索引器, 但无字段;接口成员都是隐式的 public, 不要使用访问修饰符;类、结构和接口都可以继承多个接口;继承接口的类必须实现接口成员, 除非是抽象类;类实现的接口成员须是公共的、非静态的.*/ // 定义接口 interface Myinterface { //在接口里面声... 阅读全文
posted @ 2012-10-07 21:59 梦断难寻 阅读(418) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ //先在外面定义一个类. class MyClass { //委托是事件的前提,所以先定义一个委托 public delegate void Mydelagate(int i); // 接着定义事件. public event Mydelagate MyEvent; // event关键字是定义事... 阅读全文
posted @ 2012-10-07 20:33 梦断难寻 阅读(491) 评论(0) 推荐(0) 编辑