问题
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