How to make ObjectListView work in obfuscated code

2019-08-11 19:57发布

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条回答
狗以群分
2楼-- · 2019-08-11 20:42

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;
}
查看更多
登录 后发表回答