using System.Collections; using System.Collections.Generic; using System.Text; using System.Globalization; using System; using System.Numerics; namespace Rokojori { public class BigIntegerSerializer: CustomSerializer { public override List HandlingTypes() { return new List(){ typeof( BigInteger ) }; } public override JSONData Serialize( object value ) { var bigInteger = (BigInteger) value; return new JSONValue( bigInteger.ToString( "R" ) ); } public override void Deserialize( JSONData data, Reference referenceRelation ) { if ( referenceRelation.target == null ) { return; } var bigInteger = BigInteger.Parse( data.stringValue ); referenceRelation.AssignValue( bigInteger ); } } }