How to make ObjectListView work in obfuscated code?

本小妞迷上赌 提交于 2019-12-11 07:43:49

问题


ObjectListView stops working when i obfuscate the code. The issue seems to be centred around using AspectName to set the column in MainForm.designer.cs
E.g:

this.olvColumn1.AspectName = "Name";

The Obfuscator could be renaming all my methods. Any advice on how to fix this issue?


回答1:


AspectName is obviously using the name of the property, which is defeated by obfuscating.

You'll have to install an AspectGetter delegate instead:

this.olvColumn1.AspectGetter = delegate(object x) {
    return ((YourModelClass)x).Name;
}


来源:https://stackoverflow.com/questions/25778942/how-to-make-objectlistview-work-in-obfuscated-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!