摘要: EventCollection如果在单个控件中有多个事件,那么使用System.ComponentModel.EventHandlerList对事件进行保存将会在内存占用上有不错的提高。EventHandlerList对一个类内发布多个事件提供了一个列表容器。下面是多个事件和使用EventHandlerList的对比示意:(汗这图看不懂什么意思)第一步是实例化一个EventHandlerList的实例:第二步是声明一个容器用于保存事件的key : private static readonly object ClickEvent = new object();最后一步是像往常一样声明一个事件 阅读全文
posted @ 2011-04-08 07:08 张土土 阅读(1165) 评论(0) 推荐(0) 编辑
摘要: LoadPostData是接口IPostBackDataHandler的方法方法一般长这样public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection) { string strOldValue = Text; string strNewValue = postCollection[this.UniqueID]; if (strOldValue == null || (strOldValue != null && !st 阅读全文
posted @ 2011-04-08 06:42 张土土 阅读(227) 评论(0) 推荐(0) 编辑