Re: [ADVANCED-DOTNET] Saving the contents of a collection of objects...

2007-03-05 Thread Erik M. Erikson
If all the types have been marked with the [Serializable()] tag, then the following is the simplest approach: private MyType _MyObject; private void PersistToFile() { BinaryFormatter binaryformatter = new BinaryFormatter(); _FileStream.Position = 0; binaryformatter.Serialize( _FileStr

Re: [ADVANCED-DOTNET] Saving the contents of a collection of objects...

2007-03-05 Thread Peter Osucha
th me here). Peter -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Knowlton, Gerald F. Sent: Monday, March 05, 2007 9:54 AM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: [ADVANCED-DOTNET] Saving the contents of a collection of objects...

Re: [ADVANCED-DOTNET] Saving the contents of a collection of objects...

2007-03-05 Thread Dave Lacerte
I, By default, the XmlSerializer will be able to serialize your class, with no modifications to it (which means, no extra attribute). However, it's not going to serialize an IDictionnary (HashTable, SortedList, etc). In that case, your collection should implement ICollection (all un-keyed collect

Re: [ADVANCED-DOTNET] Saving the contents of a collection of objects...

2007-03-05 Thread Phil Sayers
T topics. [mailto:[EMAIL PROTECTED] Behalf Of Knowlton, Gerald F. Sent: Monday, March 05, 2007 9:54 AM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: [ADVANCED-DOTNET] Saving the contents of a collection of objects... Hello all, I am looking for a solution to saving the contents of a colle

[ADVANCED-DOTNET] Saving the contents of a collection of objects...

2007-03-05 Thread Knowlton, Gerald F.
Hello all, I am looking for a solution to saving the contents of a collection of objects to disk and then reading the data back into the collection. Suppose I have this collection called "Col" and each item is an object called "ID". The ID object has two properties called "Name" and