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

Glossary Item Box

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

Syntax

Visual Basic (Declaration) 
Public Class SerializerClone 
   Inherits MemberwiseClone
C# 
public class SerializerClone : MemberwiseClone 

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)

Inheritance Hierarchy

System.Object
   CSharpTest.Net.Cloning.ObjectCloner
      CSharpTest.Net.Cloning.MemberwiseClone
         CSharpTest.Net.Cloning.SerializerClone

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys