46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System;
|
|
using System.Globalization;
|
|
|
|
namespace System.ComponentModel
|
|
{
|
|
/// <summary>Provides a type converter to convert 32-bit signed integer objects to and from other representations.</summary>
|
|
// Token: 0x02000098 RID: 152
|
|
public class Int32Converter : BaseNumberConverter
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.Int32Converter" /> class. </summary>
|
|
// Token: 0x06000513 RID: 1299 RVA: 0x0000DA58 File Offset: 0x0000BC58
|
|
public Int32Converter()
|
|
{
|
|
this.InnerType = typeof(int);
|
|
}
|
|
|
|
// Token: 0x17000156 RID: 342
|
|
// (get) Token: 0x06000514 RID: 1300 RVA: 0x0000DA70 File Offset: 0x0000BC70
|
|
internal override bool SupportHex
|
|
{
|
|
get
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000515 RID: 1301 RVA: 0x0000DA74 File Offset: 0x0000BC74
|
|
internal override string ConvertToString(object value, NumberFormatInfo format)
|
|
{
|
|
return ((int)value).ToString("G", format);
|
|
}
|
|
|
|
// Token: 0x06000516 RID: 1302 RVA: 0x0000DA98 File Offset: 0x0000BC98
|
|
internal override object ConvertFromString(string value, NumberFormatInfo format)
|
|
{
|
|
return int.Parse(value, NumberStyles.Integer, format);
|
|
}
|
|
|
|
// Token: 0x06000517 RID: 1303 RVA: 0x0000DAA8 File Offset: 0x0000BCA8
|
|
internal override object ConvertFromString(string value, int fromBase)
|
|
{
|
|
return Convert.ToInt32(value, fromBase);
|
|
}
|
|
}
|
|
}
|