Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: socket programming Pin
Tom Larsen28-Feb-04 20:30
Tom Larsen28-Feb-04 20:30 
GeneralRe: socket programming Pin
dabuskol28-Feb-04 20:39
dabuskol28-Feb-04 20:39 
GeneralRe: socket programming Pin
Tom Larsen1-Mar-04 4:17
Tom Larsen1-Mar-04 4:17 
GeneralRe: socket programming Pin
dabuskol16-Mar-04 23:04
dabuskol16-Mar-04 23:04 
GeneralRemoval of a forms Captionbar. Pin
Lars Fisker28-Feb-04 18:18
Lars Fisker28-Feb-04 18:18 
GeneralRe: Removal of a forms Captionbar. Pin
Andres Coder28-Feb-04 21:13
Andres Coder28-Feb-04 21:13 
GeneralRe: Removal of a forms Captionbar. Pin
Lars Fisker29-Feb-04 0:48
Lars Fisker29-Feb-04 0:48 
GeneralSerialization problem Pin
Jasper4C#28-Feb-04 6:47
Jasper4C#28-Feb-04 6:47 
Hi ppl!

May be you can help me with this:

I have some collection inside collection of my classes and I need to serialize it. The tree looks like this:

class NewsSourceCollection : CollectionBase, ISerializable
{
//This class is a main class and generally will hold all the data and List's

void Add (NewsSourceSingle in_param)
{
this.List.Add(new NewsSourceSingle(in_param));
}

void RemoveAt (int index)
{
this.List.RemoveAt(index);
}

void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
//Question number 1: How I can serialize a List from System.Collection ???
}

private newsSourcesColllection(SerializationInfo info, StreamingContext context)
{
//Here goes deserialization
}

} //class close

class NewsSourceSingle : ISerializable
{
//This class will be used by NewsSourceCollection to Add or Remove from List and hold instance of NewsItemsCollection class to add some sub items there

private NewsItemsCollection m_ns;

public NewsSourceSingle ()
{
//c'tor
this.m_ns = new NewsItemsCollection ();
}

void Add(some_param)
{
this.m_s.Add(some_param);
}

.
.
.
.

+same functions to support ISerializable

}

class NewsItemsCollection : CollectionBase, ISerializable
{
//This class will hold all collection of NewsItems

+the same function for supporing ISerializable

}//class close

class NewsItems : ISerializable
{
string pp;
string dd;

+same functions to support ISerializable

} class close


Question number 2: I can Formatter.Serialize (stream,object) but I can not (!) deserialize it !! Why ? Because Assembly of my type 'NewsProg version=1.0.9.245 Token....' is not found !!?????

Question 3: How can I serialize List (of System.Collection) ??

"I have not failed.
I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
GeneralRe: Serialization problem Pin
Heath Stewart29-Feb-04 10:31
protectorHeath Stewart29-Feb-04 10:31 
GeneralAccelerator(shortcut) for TabPage Pin
Gigiwig28-Feb-04 6:16
Gigiwig28-Feb-04 6:16 
GeneralRe: Accelerator(shortcut) for TabPage Pin
Mazdak28-Feb-04 6:28
Mazdak28-Feb-04 6:28 
GeneralRe: Accelerator(shortcut) for TabPage Pin
Mazdak28-Feb-04 6:33
Mazdak28-Feb-04 6:33 
GeneralCapturing other mouse buttons... Pin
profoundwhispers28-Feb-04 5:20
profoundwhispers28-Feb-04 5:20 
GeneralRe: Capturing other mouse buttons... Pin
leppie28-Feb-04 5:26
leppie28-Feb-04 5:26 
GeneralMenuItem.Shortcut has no Esc key?! Pin
profoundwhispers28-Feb-04 4:03
profoundwhispers28-Feb-04 4:03 
GeneralRe: MenuItem.Shortcut has no Esc key?! Pin
Nick Parker28-Feb-04 4:18
protectorNick Parker28-Feb-04 4:18 
GeneralRe: MenuItem.Shortcut has no Esc key?! Pin
Mazdak28-Feb-04 4:52
Mazdak28-Feb-04 4:52 
GeneralRe: MenuItem.Shortcut has no Esc key?! Pin
profoundwhispers28-Feb-04 5:23
profoundwhispers28-Feb-04 5:23 
GeneralRe: MenuItem.Shortcut has no Esc key?! Pin
Nick Parker28-Feb-04 6:11
protectorNick Parker28-Feb-04 6:11 
GeneralRe: MenuItem.Shortcut has no Esc key?! Pin
Heath Stewart28-Feb-04 4:24
protectorHeath Stewart28-Feb-04 4:24 
GeneralZero Value STRRET Type - GetDisplayNameOf Pin
Tristan Rhodes27-Feb-04 23:34
Tristan Rhodes27-Feb-04 23:34 
GeneralURL Validator Pin
camasmartin27-Feb-04 18:52
camasmartin27-Feb-04 18:52 
GeneralRe: URL Validator Pin
Heath Stewart28-Feb-04 4:16
protectorHeath Stewart28-Feb-04 4:16 
GeneralRe: URL Validator Pin
camasmartin28-Feb-04 6:48
camasmartin28-Feb-04 6:48 
GeneralOutlook Bar Problem Pin
BigBlob20227-Feb-04 12:49
BigBlob20227-Feb-04 12:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.