Visual Basic (Declaration) | |
---|---|
Public Function New( _ ByVal instance As Object, _ ByVal ParamArray namePaths() As String _ ) |
Parameters
- instance
- The instance whos properties are to be serialized
- namePaths
- optionally named paths to the properties to seralize
Library/Library.Test/TestPropertySerializer.cs
C# | Copy Code |
---|---|
HaveReadOnly data = new HaveReadOnly(); data.Value = "a"; ObjectSerializer ser = new ObjectSerializer(data, "Value"); ser.Serialize(Dictionary); HaveReadOnly test = new HaveReadOnly(); ser = new ObjectSerializer(test, "Value"); ser.Deserialize(Dictionary); Assert.AreEqual("a", test.Value); |
VB.NET | Copy Code |
---|---|
Dim data As New HaveReadOnly() data.Value = "a" Dim ser As New ObjectSerializer(data, "Value") ser.Serialize(Dictionary) Dim test As New HaveReadOnly() ser = New ObjectSerializer(test, "Value") ser.Deserialize(Dictionary) Assert.AreEqual("a", test.Value) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
ObjectSerializer ClassObjectSerializer Members