• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






heyu52

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2009年11月26日

获取窗体上的所有控件
摘要: private List<Control> _allControls = new List<Control>(); private void InitializeControlList() { Queue<Control.ControlCollection> q = new Queue<Control.ControlCollection>(); q.... 阅读全文
posted @ 2009-11-26 20:21 heyu52 阅读(742) 评论(0) 推荐(0)
 
定义一个我们自己的特殊属性
摘要: [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]//这里可以设定它只能... 阅读全文
posted @ 2009-11-26 20:14 heyu52 阅读(199) 评论(0) 推荐(0)
 
适时释放一下内存
摘要: [DllImport("kernel32.dll")] public static extern bool SetProcessWorkingSetSize(IntPtr process, int minSize, int maxSize); public static void GarbageCollect() { GC.Collect(); GC.WaitForPendingFinalizer... 阅读全文
posted @ 2009-11-26 20:12 heyu52 阅读(204) 评论(0) 推荐(0)
 
DeepClone 或许对你很有用
摘要: public static object Clone(object obj) { return Clone(obj, true); } public static object Clone(object obj, bool serialize) { MemoryStream ms = new MemoryStream(); if (serialize) { BinaryFormatter bf =... 阅读全文
posted @ 2009-11-26 20:10 heyu52 阅读(204) 评论(0) 推荐(0)