摘要:
常规用法:Type t = sender.GetType();if (t == typeof(Button)) { var realObj = (Button)sender; // Do Something}else if (t == typeof(CheckBox)) { var realObj = (CheckBox)sender; // Do something else}else { // Default action}非常规方法一:TypeSwitch.Do( sender, TypeSwitch.Case(() => textBox1.Te... 阅读全文