Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More on cloning
Message
De
16/04/2013 15:45:59
 
 
À
16/04/2013 15:30:17
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01571111
Message ID:
01571132
Vues:
28
BTW, here is a deep copy approach:
''' <summary>
''' Using generics will solve some performance issues
''' </summary>
''' <typeparam name="T"></typeparam>
''' <param name="item"></param>
''' <returns></returns>
Public Shared Function DeepCopy(Of T)(item As T) As T
	Dim formatter As New BinaryFormatter()
	Dim stream As New MemoryStream()
	formatter.Serialize(stream, item)
	stream.Seek(0, SeekOrigin.Begin)
	Dim result As T = DirectCast(formatter.Deserialize(stream), T)
	stream.Close()
	Return result
End Function
Do you think I should have used a deep copy instead to avoid such situation, assuming the problem I am facing is in fact due that this is not a real copy of everything included in oApp?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform