In this lesson, you will learn how to set a display format and an edit mask to a business class property. For this purpose, the Task.StartDate, Task.DueDate, Task.PercentCompleted and PhoneNumber.Number properties' display format will be customized u
最近在Refix一个支持Excel文件导入导出功能时,发现有用到反射的相关技能.故而在网上查了些资料,通过代码调试加深下理解. class Program { static void Main(string[] args) { var student = new Student() { Name = "Jack", Address = "Lingbi County", City = "Zhangyuan" }; var studentName =
在平常做项目的过程中,总是会遇到需要对一个已经定义过的对象的属性值进行初始化,且对象的属性值的类型有多种(string.number.array.object.boolean),为了方便自己就简单封装了一个函数. objInit(obj) { for(let key in obj) { switch(typeof obj[key]) { case 'string': obj[key] = ''; break; case 'number': obj[key] = 0; break; case 'o
static void Main(string[] args) { int times = 1000000; string value = "Dynamic VS Reflection"; //reflection 测试开始 TestClass testTypeByReflection = new TestClass(); Stopwatch watch1 = Stopwatch.StartNew(); var property = typeof(TestClass).GetPrope