Tag: 动态关键字

C#使用Dynamic关键字通过字符串访问属性而不进行reflection

我想写类似以下内容: // I will pass in a number of “properties” specified as strings that I want modified string[] properties = new [] { “AllowEdit”, “AllowDelete” }; // Casting the component I’m using to a dynamic object of some sort ? dynamic d = myGridComponent; // Iterate over the strings and set the properties foreach(var s […]