serialization - How to serialize a custom object base properties using Protobuf.net C# -
i have custom class inherits picturebox control , when deserialize object missing basic properties "name" example. here class.
[protocontract] [protoinclude(100,typeof(picturebox))] class card : picturebox { [protomember(1)] public string cardid { get; set; } [protomember(2)] public string cardname { get; set; } [protomember(3)] public string cardcolor { get; set; } [protomember(4)] public string cardtype { get; set; } [protomember(5)] public string cardrarity { get; set; } [protomember(6)] public bool tapped { get; set; } [protomember(7)] public bool revealed { get; set; } }
one possibility (untested) if can't modify base class, reveal need:
[protomember(8)] public new string name { { return base.name; } set { base.name = value; } }
i using technique apply own attributes (or change defaultattribute
value) properties of standard controls, when making own controls (to example, own label
) , seems work.
Comments
Post a Comment