get property after obfuscation

B

bob

Hi,
I've got some forms with loads of controls for entering numbers. Each
text box should behave in a similare way but i hated writing all the
text processing code for every text box. So I made a function that
took the object whose property was being set, the name of the property
and the textbox that has the text to read

public static void SetIntProperty(object owner, string propertyName,
TextBox textBox)

this saves me lots of repeated code, but after obfuscation it clearly
won't work. Presumable neither will my serialized data files load.

Reflection and serialization seem not so useful if you have to
obfuscate.

Are there any alternatives to obfuscation? Compile to machine code
perhaps?

Any help greatly appriciated,


Bob
 
J

John Wood

Obfuscation shouldn't touch public members.. so I can't see how it would be
a problem?
 
J

John Wood

Actually I think I missed your point.

So you have a lot of text processing code that you didn't want to write over
and over again... how about:
a) Write a custom control, derived from TextBox, that encapsulates your
processing. Then instantiate that for each textbox to save you from
duplicating your work. Or.
b) Change the Modified property of the textboxes to make them public,
therefore stopping the obfuscator from touching them.
 
B

bob

Hi Jon,

thanks alot for your help.

The obfuscator i'm using (dotfuscator from the tools menu in visual
studio) is obfuscating everything, regardless of whether private or
public. But I think that's good as I want to keep as much as possible
secret.

I like the idea of subclassing textbox, but I'll still need to pass in
the name of the property it corresponds to, and then obfuscation will
get me again.

Or have I missed something?

Thanks,

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top