473,386 Members | 1,827 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,386 software developers and data experts.

Serializing Collections with Interface members

I have a collection class and in order to make it type safe etc , I only add
and retrive members of Interface types.

But during XMLSerialization I get errors.

Is there any workaround ?

public class OrgRatingCollection:CollectionBase

{

public void Add(IRating item)

{

this.List.Add(item);

}
public IRating this[int index]

{

get

{
return (IRating) this.List[index];

}

set

{

this.List[index] = value;

}

}

}

}
Nov 19 '05 #1
1 1147
to serialize a collection, all object in the collection must be
serializable. defining a interface has no impact.

-- bruce (sqlwork.com)

"Akshay Kumar" <ak*******@hotmail.com> wrote in message
news:Ok**************@TK2MSFTNGP11.phx.gbl...
I have a collection class and in order to make it type safe etc , I only
add
and retrive members of Interface types.

But during XMLSerialization I get errors.

Is there any workaround ?

public class OrgRatingCollection:CollectionBase

{

public void Add(IRating item)

{

this.List.Add(item);

}
public IRating this[int index]

{

get

{
return (IRating) this.List[index];

}

set

{

this.List[index] = value;

}

}

}

}

Nov 19 '05 #2

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

Similar topics

1
by: Waz | last post by:
I'm having some problems serializing a class that contains a collection. Creating the TestClass below and then calling its Serialize method throws the error: There was an error reflecting...
0
by: big A | last post by:
I am receiving an error stating that File or Assembly name <filname.dll>, or one of its dependencies, was not found In one assembly I have three abstract classes In another I have three...
2
by: Tobias Zimmergren | last post by:
Hi, just wondering what serializing really is, and howto use it? Thanks. Tobias __________________________________________________________________ Tobias ICQ#: 55986339 Current ICQ status: +...
3
by: axr | last post by:
Having trouble with Serilization of objects that contain members which are of type Interface eg public class SomeClass { ISomeInterface1 itf1; ClassType1 ct1; ISomeInterface2 itf2;
1
by: Peter Nofelt | last post by:
Hey All, I am having issue with serializing a class and its base class using ..net 2.0. I am using IXmlSerializable I've provided code displaying my at the bottom of this post. Thanks ahead...
2
by: Lee | last post by:
Assuming I have an interface defined: public interface IDTPersistableCollection: IList<IDTPersistableObject> { //Few specific properties defined } When I try to create an object based on...
0
by: j.askey | last post by:
Hi, I have a class that is inherited from Panel. Because Panel is not serializable, I have implemented the ISerializable interface on this class and I can sucessfully save and load classes from...
2
by: ilitirit | last post by:
Can anyone explain why the following program doesn't work? The attributes and elements of the MessageList class are not being generated. Am I doing something incorrectly? Or if this is a bug...
2
by: etienne.maitre | last post by:
Hi, I work against .NET 2.0 using C# 2.0. I am facing a problem trying to serialize the class foo (given below). Basically, foo can contain other foos in a list. When I try to create a...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.