Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can not serialize custom property (Read 1077 times)
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
Can not serialize custom property
Jul 20th, 2011 at 9:26am
Print Post  
public class TestShape : ShapeNode
{
...

public long Id {get; set;}

...

protected override void SaveTo(System.IO.BinaryWriter writer, PersistContext ctx)
{
base.SaveTo(writer, ctx);
writer.Write(Id.ToString());
}
protected override void LoadFrom(System.IO.BinaryReader reader, PersistContext ctx)
{
base.LoadFrom(reader, ctx);
Id = Convert.ToInt64(reader.ReadString());
}
}
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Can not serialize custom property
Reply #1 - Jul 20th, 2011 at 10:59am
Print Post  
And what's wrong with that? Are you calling the RegisterItemClass method to enable serialization for TestShape?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint