473,508 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

For serialization experts...

To
Hi. I've two big serialization problems:

The first is about the <nonserialized> attribute on a field on a mother
class. His inheritance seems to be effective only if the member is public.
If it is not the case, when I try to seriliazise the child class, vb tries
to serialize my non serializable member!!!!

The second problem is about the serialization of a class which inherit from
a hastable. The hashtable implements ISerializable so I must redefine a
"getObjectData" method in ordre to specify wich member should be serialize.
But I don't want to have a method like this in every collection I use!!!!
I'd prefer a system with the <serializable> attribute on the class wich
serialize every member not declared <nonserialized>. Is there a way to avoid
it??

Thank tou very much!

Thibaut
Nov 21 '05 #1
2 1145
Hi there,

Have you considered implementing your very own serializer class?
You could as well implement a new attribute that you could mark your
non-serializable elements of the class with.

Cheers,
Oleg
"To" <a@b.com> wrote in message news:cs**********@s1.news.oleane.net...
Hi. I've two big serialization problems:

The first is about the <nonserialized> attribute on a field on a mother
class. His inheritance seems to be effective only if the member is public.
If it is not the case, when I try to seriliazise the child class, vb tries
to serialize my non serializable member!!!!

The second problem is about the serialization of a class which inherit from a hastable. The hashtable implements ISerializable so I must redefine a
"getObjectData" method in ordre to specify wich member should be serialize. But I don't want to have a method like this in every collection I use!!!!
I'd prefer a system with the <serializable> attribute on the class wich
serialize every member not declared <nonserialized>. Is there a way to avoid it??

Thank tou very much!

Thibaut

Nov 21 '05 #2
To
I'd like to do it but I can't. The collections I use already inherit from
hashtable. I'm in a real project configuration. There are already a lot of
users of this class. Unfortunately I can't rebuild the model....
Thank you

"Oleg Skopincevs" <ol**************@comhem.se> a écrit dans le message de
news:k3*******************@newsb.telia.net...
Hi there,

Have you considered implementing your very own serializer class?
You could as well implement a new attribute that you could mark your
non-serializable elements of the class with.

Cheers,
Oleg
"To" <a@b.com> wrote in message news:cs**********@s1.news.oleane.net...
Hi. I've two big serialization problems:

The first is about the <nonserialized> attribute on a field on a mother
class. His inheritance seems to be effective only if the member is public. If it is not the case, when I try to seriliazise the child class, vb tries to serialize my non serializable member!!!!

The second problem is about the serialization of a class which inherit

from
a hastable. The hashtable implements ISerializable so I must redefine a
"getObjectData" method in ordre to specify wich member should be

serialize.
But I don't want to have a method like this in every collection I use!!!! I'd prefer a system with the <serializable> attribute on the class wich
serialize every member not declared <nonserialized>. Is there a way to

avoid
it??

Thank tou very much!

Thibaut


Nov 21 '05 #3

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

Similar topics

3
3156
by: Aaron Clamage | last post by:
Hi, I'm not sure that if this is the right forum, but any help would be greatly appreciated. I am porting some java serialization code to c# and I can't figure out the correct way to do it. ...
3
2441
by: Alexander | last post by:
When i store rule on PC with .NET.SP1 i cant restore them from PC without SP1. An i get this Error: System.Runtime.Serialization.SerializationException: Possible Version mismatch. Type...
2
3881
by: Vinayak Kamat | last post by:
Hi, I've got two classes - Entity which will have an array of Child objects in it and Child class. class Entity { public Child Children;
2
10381
by: Vinayak Kamat | last post by:
Hi, I've got two classes - Entity which will have an array of Child objects in it and Child class. class Entity { public Child Children;
1
1399
by: R Karthick | last post by:
I am new to serialization. Apologies, if my question sounds really basic. Stuck in this problem for the last two hours. Thought, will ask the experts instead of banging my head more. This is...
4
11380
by: mijalko | last post by:
Hi, I have inherited my class from System.Drawing.Printing.PrintDocument and I wish to serialize this object using XmlSerializer. And I get exception "There was an error reflecting type ...". If I...
5
6106
by: Nikola Skoric | last post by:
I ran in Mono a program developed on .NET Framework 2.0 and it ran OK until I tried to desirialize a object. There the program died abruptly dumping this: System.ArgumentOutOfRangeException:...
1
11044
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
2
5533
by: mkvenkit.vc | last post by:
Hello, I hope this is the right place to post a question on Boost. If not, please let me know where I can post this message and I will do so. I am having a strange problem with std::string as...
0
7223
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
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
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
7377
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
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.