2011年8月9日

摘要: new:新建一个同名的XX,父级的XX还存在override:直接修改父级的XX。 class Program { static void Main(string[] args) { B b = new C(); Console.WriteLine(b.type);//B,因为此时b为B的类型,所以调用的为B中的type,显示为B b.ShowType();//C,因为在C中此方法已被override,B和C中的ShowType()是同一个方法。 b.showStr();//A,此方法为A中的,而方法体中的str默认为A类中的str,B和C中的str都属于一个新的str,不影响A中的str b 阅读全文
posted @ 2011-08-09 15:30 anitzlz 阅读(207) 评论(0) 推荐(1) 编辑

2010年8月19日

摘要: public class NumberConverter : System.Windows.Data.IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { var num = value.... 阅读全文
posted @ 2010-08-19 15:54 anitzlz 阅读(137) 评论(0) 推荐(0) 编辑