Files
2026-06-04 11:42:34 +02:00

46 lines
1.4 KiB
C#

using System;
using System.Globalization;
namespace System.ComponentModel
{
/// <summary>Provides a type converter to convert 16-bit unsigned integer objects to and from other representations.</summary>
// Token: 0x020000D7 RID: 215
public class UInt16Converter : BaseNumberConverter
{
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.UInt16Converter" /> class. </summary>
// Token: 0x06000749 RID: 1865 RVA: 0x00013BFC File Offset: 0x00011DFC
public UInt16Converter()
{
this.InnerType = typeof(ushort);
}
// Token: 0x170001BD RID: 445
// (get) Token: 0x0600074A RID: 1866 RVA: 0x00013C14 File Offset: 0x00011E14
internal override bool SupportHex
{
get
{
return true;
}
}
// Token: 0x0600074B RID: 1867 RVA: 0x00013C18 File Offset: 0x00011E18
internal override string ConvertToString(object value, NumberFormatInfo format)
{
return ((ushort)value).ToString("G", format);
}
// Token: 0x0600074C RID: 1868 RVA: 0x00013C3C File Offset: 0x00011E3C
internal override object ConvertFromString(string value, NumberFormatInfo format)
{
return ushort.Parse(value, NumberStyles.Integer, format);
}
// Token: 0x0600074D RID: 1869 RVA: 0x00013C4C File Offset: 0x00011E4C
internal override object ConvertFromString(string value, int fromBase)
{
return Convert.ToUInt16(value, fromBase);
}
}
}