Visual Basic (Declaration) | |
---|---|
Public Class SerializerClone Inherits MemberwiseClone |
C# | |
---|---|
public class SerializerClone : MemberwiseClone |
Library/Library.Test/TestWeakReferenceT.cs
C# | Copy Code |
---|---|
string value = "Testing Value"; Utils.WeakReference<string> r; r = new Utils.WeakReference<string>(value); Utils.WeakReference<string> r2 = new Cloning.SerializerClone().Clone(r); Assert.AreEqual(r.Target, r2.Target); Assert.AreEqual(value, r2.Target); string tmp; Assert.IsTrue(r2.TryGetTarget(out tmp) && tmp == value); |
VB.NET | Copy Code |
---|---|
Dim value As String = "Testing Value" Dim r As Utils.WeakReference(Of String) r = New Utils.WeakReference(Of String)(value) Dim r2 As Utils.WeakReference(Of String) = New Cloning.SerializerClone().Clone(r) Assert.AreEqual(r.Target, r2.Target) Assert.AreEqual(value, r2.Target) Dim tmp As String Assert.IsTrue(r2.TryGetTarget(tmp) AndAlso tmp = value) |
System.Object
CSharpTest.Net.Cloning.ObjectCloner
CSharpTest.Net.Cloning.MemberwiseClone
CSharpTest.Net.Cloning.SerializerClone
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7