tags:

views:

41

answers:

1

I am using reflector to disassemble on of my companys projects so that one of our departments can speak to our headquarters in germany intellegently. I have successfully completeted my task other than the following issue.

whenever a resource image or anything referring to the manager

ComponentResourceManager manager = new ComponentResourceManager(typeof(PalletPlacesUserControl));

is executed

this.cmdSpreading.Image = (Image) manager.GetObject("cmdSpreading.Image");

i end up with an error because manager is null.

A: 

If you use Red Gate's .NET Reflector, you can call a file-save as C# project, and that builds a Visual Studio project that will compile and run (if it is an executable) just like the normal code would, plus you can edit the code there. I would try that first and see what happens.

Richard J. Ross III
thats what im using, maybe its the disassembler tool that i used with it?
mookie
Try right clicking on the assembly, and choose export. Then open project up and see what it looks like.
Richard J. Ross III
that isnt making a difference. The problem i think is because my resourceCulture is null
mookie
Well that would be a problem, wouldn't it? :)
Richard J. Ross III
[EditorBrowsable(EditorBrowsableState.Advanced)] internal static System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { System.Resources.ResourceManager manager = new System.Resources.ResourceManager("Logistics.Products.LayerPicking.Properties.Resources", typeof(Resources).Assembly); resourceMan = manager; } return resourceMan; } }
mookie
that is the code for the section of getting the resources. Ive just never done anything like this with resources before. Most of my experience is much simplier than this.
mookie
Ya me too... try changing the line `if (object.ReferenceEquals(resourceMan, null))` to `if (resourceMan == null)`
Richard J. Ross III
same results, it just passes through as at that poiont resourceMan is allready null
mookie
I dont know then... sorry that I couldn't help you, I would try asking again or waiting another day and putting a bounty on this question...
Richard J. Ross III