473,406 Members | 2,549 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,406 software developers and data experts.

Updated Serialized Class

Originally, I had a class like the following that I would serialize to
persist values from an options dialog:

[Serializable()]
public class MyClass
{
private int _someNum;
private string _someString;

public int SomeNum
{
get { return _someNum; }
set { _someNum = value; }
}

public int SomeString
{
get { return _someString; }
set { _someString = value; }
}
}

I later added a boolean type to the class as such:

[Serializable()]
public class MyClass
{
private int _someNum;
private string _someString;
private bool _someBool

public int SomeNum
{
get { return _someNum; }
set { _someNum = value; }
}

public string SomeString
{
get { return _someString; }
set { _someString = value; }
}

public bool SomeBool
{
get { return _someBool; }
set { _someString = someBool; }
}
}

Clients already have the original configuration class serialized on
their machines and now I need to ensure that, when the updated
application is installed, the value of SomeBool is true, by default.

Without deleting the original configuration file, is there any way that
I can ensure that the value of SomeBool is set to true? After the
update, it would be a little silly to ask that the users open their
options dialog to verify that the CheckBox is checked. ;-)

Thank you in advance,

--
Sean

website: http://senfo.blogspot.com
Feb 14 '07 #1
3 1247
By the way, in hindsight, yes, I should have used settings
(http://msdn2.microsoft.com/en-us/lib...printer).aspx).
I still might migrate the code, but I'm kind of in crunch mode right now!

--
Sean

website: http://senfo.blogspot.com
Feb 14 '07 #2
senfo wrote:
By the way, in hindsight, yes, I should have used settings
(http://msdn2.microsoft.com/en-us/lib...printer).aspx).
I still might migrate the code, but I'm kind of in crunch mode right now!
Well never mind...I ended up migrating all my code to use Settings and I
must say that it was quite painless (mainly because the custom
architecture I designed was almost identical to the one in .NET (at
least when you ignore the implementation)).

Thank you,

--
Sean

website: http://senfo.blogspot.com
Feb 14 '07 #3
senfo wrote:
senfo wrote:
>By the way, in hindsight, yes, I should have used settings
(http://msdn2.microsoft.com/en-us/lib...printer).aspx).
I still might migrate the code, but I'm kind of in crunch mode right
now!

Well never mind...I ended up migrating all my code to use Settings and I
must say that it was quite painless (mainly because the custom
architecture I designed was almost identical to the one in .NET (at
least when you ignore the implementation)).
There are a good reason why serialization is usually not
recommended for long term persistence.

Arne
Feb 18 '07 #4

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

Similar topics

4
by: Daniel Reber | last post by:
I have an exe that serializes one of it's classes to disk. I also have the exact same .cs file that contains the class that was serialized, in a Windows service application. I am trying to load...
0
by: Wim Hollebrandse | last post by:
Here's the scenario. I'm serializing a particular object, which contains other objects as properties. I have this particular enum type that won't get included in the serialized XML. For...
7
by: Neal Andrews | last post by:
Hi All, Does anyone know how to stop Events from being serialized in a class that uses the <Serializable()> attribute? I have tried using the <NonSerialized()> attribute but for some bizarre...
0
by: Marty Cruise | last post by:
I use a custom class to hold several other custom classes (some are collections). Each child class has properties, methods, etc. In some of these methods, I need to use particular information...
5
by: EqDev | last post by:
I have a class that is a control derived from UserControl. I want to use serialization and deserialization with this calss but I get an exception "Cannot serialize member...
0
by: Don Leckie | last post by:
Hi, I hope someone can really help me. This problem has me stumped. I have class "A" that does not implement Serializable, but class "A" subclasses Serializable class "B". Therefore, when...
3
by: CindyRob | last post by:
I am using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, with hotfix 82202, Visual studio .NET 2003 with hotfix 823639. I have generated a proxy class using wsdl.exe from a schema that has an...
5
by: twahl | last post by:
Hi, In the WS I've defined a class that contains both data and methods. I'm trying to pass this class to a client application using a web method. When I access this class on the client only the...
0
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
0
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,...
0
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...

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.