摘要:
引用:http://www.7dspace.com/doc/24/0603/20063604160336160.htmhttp://www.yesky.com/20030311/1656401_1.shtmlMSDN垃圾回收专题:http://msdn2.microsoft.com/zh-cn/library/0xy59wtx.aspx一般在.NET程序中创建的托管对象,都是可以依靠GC来自动回收... 阅读全文
摘要:
除非纯粹的类型检查,否则使用as转换比is快 // is 转换object obj = GetReferent();if (obj is SomeType){ SomeType st = (SomeType)obj; ..}// as 转换SomeType st = obj as SomeType;if (st != null){ ..} 阅读全文
摘要:
C#用委托来实现事件通知机制。对象开放事件,供调用者绑定事件处理函数。委托声明delegate void 函数名(参数表...); 事件声明event 委托类型 事件名; 阅读全文
摘要:
示例代码: using System;class A{ public static int X; static A() { X = B.Y + 1; }}class B{ public static int Y = A.X + 1; static B() {} static void Main() { Console.WriteLine("X = {0}... 阅读全文