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

C#

 
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 
GeneralRe: Serialization problem Pin
Heath Stewart29-Feb-04 10:31
protectorHeath Stewart29-Feb-04 10:31 
First, read Serializing Objects[^] in the .NET Framework SDK.

If you attribute a class with SerializableAttribute, by default any private and public fields are serialized, so long as those types are serializable. Since you're deriving from the CollectionBase - which uses the ArrayList internally, which is serializable - your class is already serializable. You don't need to implement ISerializable unless you want to override serialization.

The second error is because the Type which is being deserialized is defined in an assembly that cannot be found. Make sure that when deserializing your assembly, your assembly can be found. See How the Runtime Locates Assemblies[^] in the .NET Framework SDK for more information.

For the answer to your third question, see the answers above. Mosts lists in the .NET Framework are already serializable. For example, the following creates an XML document with the content of an ArrayList:
using System;
using System.Collections;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Soap;
public class Test
{
  static void Main()
  {
    ArrayList list = new ArrayList();
    list.Add("One");
    list.Add("Two");
    list.Add("Three");
    SoapFormatter formatter = new SoapFormatter();
    using (Stream s = new FileStream("Test.xml", FileMode.Create))
      formatter.Serialize(s, list);
  }
}


 

Microsoft MVP, Visual C#
My Articles
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 
GeneralRe: Outlook Bar Problem Pin
Matthew Hazlett27-Feb-04 13:16
Matthew Hazlett27-Feb-04 13:16 

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.