473,231 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Properties.Settings; ArrayList and a custom object

Hello,

I am writing a Windows Forms application using .NET Framework 2.0 and
Visual Studio 2005.

I would like to use Properties.Settings class to persist a collection
of custom objects. For that I am creating a setting called Connections
of type System.Collections.ArrayList using the Properties designer in
VS.

At run-time I populate an arraylist with instances of my class and then
I set the Connections property to this arraylist. Then, I execute the
Save command on the Settings.Default.

The Save command does not generate an error, but no settings are
persisted either.

Do I need to do something special with ArrayList and my class
(serialization, perhaps) in order for settings to be persisted
correctly?

Many thanks for your help!

Evgueni

Jan 28 '06 #1
4 8695
Evgueni,

I have your same problem; have you found a solution or a reason why
this is not working?

Thank you,
Gabriele

Feb 6 '06 #2
Unfortunately, no. Nobody responded to this posting or to the
WindowsForms.net forum...

Feb 6 '06 #3
I haven't been able to find this information either. I'm using one of my
MSDN support incidents on it. I'll post what they come up with.

"po*****@hotmail.com" wrote:
Unfortunately, no. Nobody responded to this posting or to the
WindowsForms.net forum...

Feb 15 '06 #4
Hello Eugene.

I think I've figured this one out. I haven't tried it out on ArrayList but
it's worked for every Type I've tried it on, including Bitmaps and custom
types.

First of all, if your type is a custom type (like class MyFont : Font) then
you'll have to mark it as [Serializable] and implement ISerializable. I
think you also have to write a serializable constructor.

Then you mark your settings property with
[SettingsSerializeAs(SettingsSerializeAs.Binary)]. Settings of certain types
cannot be created in the designer. In that case you'll have to add a file
Settings.cs that extends your internal sealed partial class Settings.

Tony
To**********@Fluke.com

"eu*****@rusmex.com" wrote:
Hello,

I am writing a Windows Forms application using .NET Framework 2.0 and
Visual Studio 2005.

I would like to use Properties.Settings class to persist a collection
of custom objects. For that I am creating a setting called Connections
of type System.Collections.ArrayList using the Properties designer in
VS.

At run-time I populate an arraylist with instances of my class and then
I set the Connections property to this arraylist. Then, I execute the
Save command on the Settings.Default.

The Save command does not generate an error, but no settings are
persisted either.

Do I need to do something special with ArrayList and my class
(serialization, perhaps) in order for settings to be persisted
correctly?

Many thanks for your help!

Evgueni

Feb 17 '06 #5

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

Similar topics

4
by: John Kandell | last post by:
Hi, I posted this in the asp.net group, but didn't get a response. Maybe someone here can help me with this... --- Would someone be able to shed some light on what is the cost of saving a...
2
by: Ric | last post by:
Please forgive me if i dont explain this situation correctly. i'll try to do my best. because the arraylist.add method only accepts one argument, i created an object with several public...
8
by: a | last post by:
I'm trying to save data from a custom object into the profile object, but it is not structured the way that I want. I'm trying to get the custom object to serialize as xml to a Profile object...
0
by: a | last post by:
I need to create an instance of a custom object 'School.Teacher' and use it in a Profile object. I'm developing a bad case of "Pretzel Logic" thinking about this. Filling the custom object ...
9
by: Greger | last post by:
Hi, I am building an architecture that passes my custom objects to and from webservices. (Our internal architecture requires me to use webservices to any suggestion to use other remoting...
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?Y3Nz?= | last post by:
I am new to ASP.net webservice and have a quesiton. Is is possible to pass custom object to a web service (using VB 2005)? My custom object will look like this Public Class Myclass Public...
0
by: =?Utf-8?B?RnV0cm9uaWNzIERldmVsb3Blcg==?= | last post by:
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...
1
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
I'm running VS2008 & attempting to solve a problem I've encountered while developing some software for our business. Here's the basic idea...I've created a class that represents a file (with...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.