Currently I'm doing this:
inside the class to serialize itself. Then calling:
Whenever I need to serialize it. My question is, is this good practice? Or should I place the serialization in a private sub in the form I call it in?
Code:
Public Sub Serialization(ByVal file_name As String)
Dim sw As New StreamWriter(file_name)
Dim x As New XmlSerializer(Me.GetType)
x.Serialize(sw, Me)
sw.Close()
End Sub
Code:
<myclass>.Serialization(<myfile.xml>)