473,471 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using the Properties.Settings file

I am trying to store a collection of custom types in a Properties.Settings
file which I will be updating at run time and saving on exit of the program.
I understand how to use the Properties.Settings file in this way for normal
types (ints, chars etc) but I am struggling to get it to work for my own
types.

The type I want to use in the Settings file is a custom implementation of
the generic Dictionary class using a string and another custom type (so -
MyCustomType : Dictionary<string, MyOtherCustomType>). The MyOtherCustomType
class is also a custom implementation of a generic container, it is a List of
MyObject's (so - MyOtherCustomType : List<MyObject>). And finally the
MyObject class stores an enum and a Color.

Now, I have already got the Properties.System file to work for the
MyOtherCustomType class but I can't seem to get it to work for the
MyCustomType class. I understand that I need to implement IXmlSerializable
but I am unsure of whether it should be implemented in the MyCustomType class
only or whether all my own types / objects that I want to be serialized with
the class need to implement it too. I am also unsure about how to implement
the interface's ReadXml and WriteXml methods. I have read a post on this
forum in answer to a similar question and tried to adapt their code to suit
my own but had no luck. Can anyone give me a brief outline of what these
methods should do relative to my types / objects?

Thanks,

James
Oct 11 '07 #1
0 1674

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
9
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
16
by: Timm | last post by:
I'm trying to use ASP objects (basically formed and populated based on Web.Config settings) and I want to use them in a different non-asp program with minimal reprogramming. So, my question is how...
4
by: Sai | last post by:
Hi, I am using VSTO 2005 Beta for building an excel application. I added application configuration file to the project (app.config) and it has the following section in it. <configuration>...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
13
by: Dave | last post by:
When using the properties designer to store application wide properties how do you get this to work across a project group containing an EXE and a collection of DLLs. I'm using C#.Net 2005. I...
2
by: =?Utf-8?B?c21pdGhrbDQy?= | last post by:
I'm just now beginning to experiment with WCF, and I've run into an odd hiccup right at the beginning. I presume it's just something I'm doing wrong, but I can't figure it out. I've created a...
3
by: DaBrain | last post by:
I have a program that uses settings. When I save my settings they are saved: Properties.Settings.Default.Save(); when I restart the application, my settings are present, the changes are in...
6
by: TS | last post by:
I cannot get this to work. I added an app.config to a project i reference from my web application project (vs 05) but can see no way to access the settings within it. the other thing is that I...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.