I would like to learn more about serialization.
The code I did is :
Dim f As System.IO.FileStream
Dim binFormat As New BinaryFormatter
f = nothing
try
f = New FileStream("items.txt", FileMode.Create)
binFormat.Serialize(f, MyPanel)
finally
f.close()
end try
MyPanel is declared as Panel. (dim myPanel as Panel ...)
Even I create myPanel as this :
Public Class MyPanelClass
Inherits Panel
Implements ISerializable
Public Sub GetObjectData(ByVal info As
System.Runtime.Serialization.SerializationInfo, ByVal context As
System.Runtime.Serialization.StreamingContext) Implements
System.Runtime.Serialization.ISerializable.GetObjectData
Dim i As Integer
i = 1 ' this code is not reachable **** what should I write
here. need an example, please ***********************
End Sub
End Class
...
dim myPanel as MyPanelClass
...
I need a simple sample (specifically : saving panel & objects on it).
Thanks