Why are resx files needed?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Why does Visual Studio uses resx files to save Windows Forms information?
Why doesn't Visual Studio save everything inside the "Component Designer
generated code" region? I thought that was the whole idea about this region.
 
My guess is that it's much easier to search for data in resx files than in
the auto-generated code blocks (there are simple access methods for
searching your assembly's resx files). I imagine this persists the idea of
extensibility, ease of metadata consumption, et al. that makes the runtime
so vibrant. As far as any technical reasons beyond the model of
extensibility I mentioned earlier, I know of none.
 
Rene said:
Why does Visual Studio uses resx files to save Windows Forms information?
Why doesn't Visual Studio save everything inside the "Component Designer
generated code" region? I thought that was the whole idea about this region.

In resx files there are e.g. icons, bitmaps, imagelists that you use.
(Generally, all binary 'things', which cannot be in code)

£ukasz
 
I guess that technically things like images could be persisted in the code
but if you look at the XML in a resx file you'll see that even a small image
can reuire a lot of code to define. Your source code would be huge and
confusing with thousands of lines of gibberish.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top