Why are resx files needed?

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.
 
B

Ben Rush

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.
 
?

=?ISO-8859-2?Q?=A3ukasz?=

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
 
B

Bob Powell [MVP]

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.
 

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