Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More on cloning
Message
From
16/04/2013 15:45:59
 
 
To
16/04/2013 15:30:17
General information
Forum:
ASP.NET
Category:
Other
Title:
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01571111
Message ID:
01571132
Views:
29
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
Previous
Reply
Map
View

Click here to load this message in the networking platform