If I have a base class that is derived from many classes, and I want to make
all the classes serializable. Is there a way I can do this from the base
class or must I add [Serializable()] to every class, even if it's parent
class has the [Serializable()] attribute.
I'm thinking no from what I've seen on google so far. 2 1580
Hasani,
As you are finding each serializable class needs the Serializable attribute,
even when derived from classes that already have the Serializable attribute.
In case you don't have them the following MSDN Magazine articles are useful
for understanding Serialization. http://msdn.microsoft.com/msdnmag/issues/02/04/net/ http://msdn.microsoft.com/msdnmag/issues/02/07/net/ http://msdn.microsoft.com/msdnmag/issues/02/09/net/
Binary serialization is going to use less space then SOAP Serialization.
SOAP serialization is really intended for Web Services (SOAP). There is also
XML serialization which is not tied directly to SOAP Serialization, however
you get a similar result.
Hope this helps
Jay
"Hasani" <bi*******@hax0 r.dyndns.org> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. . If I have a base class that is derived from many classes, and I want to
make all the classes serializable. Is there a way I can do this from the base class or must I add [Serializable()] to every class, even if it's parent class has the [Serializable()] attribute. I'm thinking no from what I've seen on google so far.
Good Find
Thx
"Jay B. Harlow [MVP - Outlook]" <Ja********@ema il.msn.com> wrote in message
news:uO******** ******@tk2msftn gp13.phx.gbl... Hasani, As you are finding each serializable class needs the Serializable
attribute, even when derived from classes that already have the Serializable
attribute. In case you don't have them the following MSDN Magazine articles are
useful for understanding Serialization.
http://msdn.microsoft.com/msdnmag/issues/02/04/net/ http://msdn.microsoft.com/msdnmag/issues/02/07/net/ http://msdn.microsoft.com/msdnmag/issues/02/09/net/
Binary serialization is going to use less space then SOAP Serialization. SOAP serialization is really intended for Web Services (SOAP). There is
also XML serialization which is not tied directly to SOAP Serialization,
however you get a similar result.
Hope this helps Jay
"Hasani" <bi*******@hax0 r.dyndns.org> wrote in message news:%2******** *******@TK2MSFT NGP10.phx.gbl.. . If I have a base class that is derived from many classes, and I want to make all the classes serializable. Is there a way I can do this from the base class or must I add [Serializable()] to every class, even if it's parent class has the [Serializable()] attribute. I'm thinking no from what I've seen on google so far.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Dave |
last post by:
Hi
I'm making a 3D Engine which consists of the class C3DEngine. Part of this
engine is a file loader, a class called CMeshLoader.
I have made an instance of CMeshLoader in C3DEngine, ie composition.
Unfortunately, CMeshLoader sometimes needs to refer
to private members of C3DEngine. Inheritance, friends, and composition are
all swirling around in my head at the moment. I know that
inheritance is not the solution. Can someone please...
|
by: uAsking |
last post by:
I'm building a client side application that uses webservices. In the client
application I'm inheriting from basic types used by the webservices, so the
wevservice provides the classes and sets all the serialization attributes for
them.
The classes are in a very basic structure with a Single object that contains
two other objects.
I inhert from them and add a function with converts the object returned from
the webservice into my object...
|
by: ^MisterJingo^ |
last post by:
Hi all,
I have a question regarding inheritance. I'll use the following code
for an example (its been stripped down to the minimum):
// code start
using System;
class Animal
{
|
by: jason |
last post by:
we have developed a .NET class library that defines a family of
reusable business objects. the class library is developed in C#, and
works quite well.
one problem, however, is that as more and more applications are being
developed to consume this class library, we are running into deployment
and version controll issues.
i recall a lot of this kind of thing being solved with distributed
application models, such as the EJB...
|
by: Evian Spring |
last post by:
We are planning on using "SqlServer" mode for our ASP.NET session
state.
I know for the classes we store in Session that I need to mark them
with the SerializableAttribute as described in this knowledge base
article:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q312112&ID=KB;EN-US;q312112
My question is, if I store in session a class that contains members
| |
by: Frank Millman |
last post by:
Hi all
I recently posted a question about subclassing. I did not explain my
full requirement very clearly, and my proposed solution was not pretty.
I will attempt to explain what I am trying to do more fully, and
describe a possible solution. It is still not pretty, so I would
appreciate any comments.
I have a base class (ClassA), which is an abstract class. Most of the
methods and attributes are common to all subclasses, so there is...
|
by: Roy Chastain |
last post by:
I have a schema that has been in existence over 1 year. I have been making a few minor modifications to it recently and suddenly
the generated C# classes have made a radical change.
I have just compared the xsd source to the last compiled version on 8/25/06 and they are identical, yet the generated C# is
different. I do not know enough about XSD and schemas to understand how the original output was generated, but I need to get it
back.
...
|
by: groovyghoul |
last post by:
Hi
I have the following XML file:
===========================================================
<?xml version="1.0" encoding="UTF-16"?>
<Policy xmlns="http://tempuri.org/richard.xsd">
<TransType />
<LOB />
<Name>
<FirstName />
|
by: Casper |
last post by:
Hi,
i read several articles about serialization. I know now that it is a process
of converting an object into a stream of data so that it can be is easily
transmittable over the network or can be continued in a persistent storage
location.
Now i did some tests in order to understand it better:
I first executed the code below (this (summarized) code produces a virtual
simple shopping cart which is put in the Profile of the user) with...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |