Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass
- {
- public BigInteger Value { get; set; }
- public Dictionary<BigInteger, string> Dictionary { get; set; } = new Dictionary<BigInteger, string>();
- }
- public class BigIntegerConverter : TypeConverter
- {
- public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- if(value is string)
- {
- return BigInteger.Parse((string)value);
- }
- return base.ConvertFrom(context, culture, value);
- }
- public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
- {
- if(sourceType == typeof(string))
- {
- return true;
- }
- return base.CanConvertFrom(context, sourceType);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement