摘要: 事件和索引指示器 事件為類和類的實例提供了向外界發送通知的能力,而索引指示器則可以像數組那樣對對像 進行索引訪問. 事件 形像地說,事件(event)就是類或對像用來"發出通知"的成員.通過提供事件的句柄,客戶能 把事件和可執行代碼聯系在一起. 我們看下面這個列子 public delegate void EventHandler(object sender,EventArgs e); publ... 阅读全文
posted @ 2007-11-01 16:33 Athrun 阅读(500) 评论(0) 推荐(0) 编辑
摘要: 域和屬性 域表示與對你或類相關聯的變量,聲明格式如下: attributes field-modifiers type variable-declarators; 域的修飾符field-modifiers可以是: new public protected internal private static readonly 實際上,域相當於c++中的類的簡單成員變量,在下面的代碼中,類a包含了... 阅读全文
posted @ 2007-11-01 10:37 Athrun 阅读(298) 评论(0) 推荐(0) 编辑