What can be stored in application settings?

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

Guest

I've been toying with the idea that it might be nicer to store all my
settings as application settings rather than having to play games with saving
and restoring from an external file. However, my data to be saved is
represented by several structures that contain all kinds of things. In
looking at the settings grid I don't see how an arbitrary object can be
specified - only things like the primitive data types and some other Windows
things I don't understand yet. Is there a way to represent any arbitrary
object in the settings? Thanks.
 
[...] However, my data to be saved is
represented by several structures that contain all kinds of things. In
looking at the settings grid I don't see how an arbitrary object can be
specified [...] Is there a way to represent any arbitrary
object in the settings? Thanks.

I haven't played much with this. But I would think that any object that
is serializable ought to be storable in the settings.

So, if you make your data into serializable objects, there should be a way
to add them to the settings.

My apologies if I'm off-base here. I haven't tried it myself...just
thinking about what *should* be convenient and possible. :)

Pete
 
Check this post:
9/21/2005
XmlSerialization with IDictionary and CollectionBase Objects
http://sholliday.spaces.live.com/blog/


It shows how to xml serialize objects, collections of object, objects with
subcollection objects.


You can look at this entry:
2/8/2006
Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and 2.0)

whichs shows how to put info in your config file(s), though this blog entry
isn't a "exact match" like the first one I mention above.
 
Via this group I learned how to use CSharp to read and write XML
files. Very simple. And I think by your description it is the type
of file you need.

Look up XmlTextReader and XmlTextWriter.

Dom
 
That is correct. Any class which can be serialized as XML can be stored in
Application Settings.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

Peter Duniho said:
[...] However, my data to be saved is
represented by several structures that contain all kinds of things. In
looking at the settings grid I don't see how an arbitrary object can be
specified [...] Is there a way to represent any arbitrary
object in the settings? Thanks.

I haven't played much with this. But I would think that any object that
is serializable ought to be storable in the settings.

So, if you make your data into serializable objects, there should be a way
to add them to the settings.

My apologies if I'm off-base here. I haven't tried it myself...just
thinking about what *should* be convenient and possible. :)

Pete
 

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

Back
Top