You can create an extension method where you serialize the object only to deserialize it again. This will create a new object with it's own references, thus a Deep Copy.
Public Module Extensions
<System.Runtime.CompilerServices.Extension()> _
Public Function DeepCopy(Of T)(ByVal Obj As T) As T
If Obj.GetType().IsSerializable = False Then Return Nothing
Using MStream As New MemoryStream
Dim Formatter As New BinaryFormatter
Formatter.Serialize(MStream, Obj)
MStream.Position = 0
Return DirectCast(Formatter.Deserialize(MStream), T)
End Using
End Function
End Module
Now you can just call:
Dim network As List(Of train) = per_network.DeepCopy()
EDIT:
These are the required imports for my code above:
Imports System.IO
Imports System.Runtime.Serialization.Formatters.Binary
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…