CSharpTest.Net
SerializerClone Constructor
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Cloning Namespace > SerializerClone Class : SerializerClone Constructor

Glossary Item Box

Used to duplicate objects either by the ISerializable interface or by field-level duplication.

Syntax

Visual Basic (Declaration) 
Public Function New()
C# 
public SerializerClone()

Example

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.NETCopy 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)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys