20 implementations of IConvertible
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
LinkTagHelperTest.cs (1)
1220private class ConvertToStyleSheet : IConvertible
Microsoft.Build.Engine.UnitTests (1)
BackEnd\TaskBuilderTestTask.cs (1)
28public struct CustomStruct : IConvertible
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\FormattableTestExtensions.cs (1)
28internal struct Convertible : IConvertible
System.Private.CoreLib (17)
src\libraries\System.Private.CoreLib\src\System\Boolean.cs (1)
18IConvertible,
src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
18IConvertible,
src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
26IConvertible,
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (1)
52IConvertible,
src\libraries\System.Private.CoreLib\src\System\DBNull.cs (1)
10public sealed class DBNull : ISerializable, IConvertible
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
65IConvertible,
src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
23IConvertible,
src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
22public abstract partial class Enum : ValueType, IComparable, ISpanFormattable, IConvertible
src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
20IConvertible,
src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
20IConvertible,
src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
20IConvertible,
src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
20IConvertible,
src\libraries\System.Private.CoreLib\src\System\Single.cs (1)
23IConvertible,
src\libraries\System.Private.CoreLib\src\System\String.cs (1)
29IConvertible,
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
20IConvertible,
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
20IConvertible,
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
20IConvertible,
606 references to IConvertible
dotnet-svcutil-lib (7)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeExporter.cs (4)
325return ((IConvertible)value).ToInt16(null); 329return ((IConvertible)value).ToInt32(null); 333return ((IConvertible)value).ToInt64(null); 337return ((IConvertible)value).ToDecimal(null);
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (2)
1131Ldc(((IConvertible)o).ToType(Enum.GetUnderlyingType(valueType), null)); 1147Ldc(((IConvertible)o).ToInt32(CultureInfo.InvariantCulture));
FrameworkFork\Microsoft.Xml\Xml\Serialization\Models.cs (1)
427return new ConstantModel(fieldInfo, ((IConvertible)fieldInfo.GetValue(null)).ToInt64(null));
Microsoft.AspNetCore.Components (2)
src\Http\Routing\src\ParameterPolicyActivator.cs (2)
202if (typeof(IConvertible).IsAssignableFrom(parameters[i].ParameterType)) 220if (serviceProvider != null && !typeof(IConvertible).IsAssignableFrom(parameterType))
Microsoft.AspNetCore.Routing (2)
ParameterPolicyActivator.cs (2)
202if (typeof(IConvertible).IsAssignableFrom(parameters[i].ParameterType)) 220if (serviceProvider != null && !typeof(IConvertible).IsAssignableFrom(parameterType))
Microsoft.Build (3)
TaskParameter.cs (3)
42/// Parameter is a value type. Note: Must be <see cref="IConvertible"/>. 47/// Parameter is an array of value types. Note: Must be <see cref="IConvertible"/>. 659/// task parameter types to be <see cref="IConvertible"/> so this conversion is guaranteed to work for parameters
Microsoft.Build.Engine.UnitTests (3)
BackEnd\TaskBuilderTestTask.cs (3)
35private IConvertible Value => (IConvertible)_value; 37public CustomStruct(IConvertible value)
Microsoft.CodeAnalysis (1)
InternalUtilities\EnumUtilties.cs (1)
20internal static bool ContainsAllValues<T>(int mask) where T : struct, Enum, IConvertible
Microsoft.CodeAnalysis.CodeStyle (1)
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
20internal static bool ContainsAllValues<T>(int mask) where T : struct, Enum, IConvertible
Microsoft.CodeAnalysis.Workspaces (1)
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
20internal static bool ContainsAllValues<T>(int mask) where T : struct, Enum, IConvertible
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
20internal static bool ContainsAllValues<T>(int mask) where T : struct, Enum, IConvertible
Microsoft.ML.ImageAnalytics (1)
VectorToImageTransform.cs (1)
345VectorToImageConvertingEstimator.ColumnOptions ex, bool needScale) where TValue : IConvertible
Microsoft.VisualBasic.Core (161)
Microsoft\VisualBasic\CompilerServices\BooleanType.vb (3)
53Dim ValueInterface As IConvertible 56ValueInterface = TryCast(Value, IConvertible) 140Private Shared Function DecimalToBoolean(ByVal ValueInterface As IConvertible) As Boolean
Microsoft\VisualBasic\CompilerServices\ByteType.vb (3)
43Dim ValueInterface As IConvertible 46ValueInterface = TryCast(Value, IConvertible) 120Private Shared Function DecimalToByte(ByVal ValueInterface As IConvertible) As Byte
Microsoft\VisualBasic\CompilerServices\CharArrayType.vb (2)
37Dim ValueInterface As IConvertible 38ValueInterface = TryCast(Value, IConvertible)
Microsoft\VisualBasic\CompilerServices\CharType.vb (2)
30Dim ValueInterface As IConvertible 33ValueInterface = TryCast(Value, IConvertible)
Microsoft\VisualBasic\CompilerServices\Conversions.vb (34)
60Dim ValueInterface As IConvertible 63ValueInterface = TryCast(Value, IConvertible) 204Dim ValueInterface As IConvertible 207ValueInterface = TryCast(Value, IConvertible) 349Dim ValueInterface As IConvertible 352ValueInterface = TryCast(Value, IConvertible) 495Dim ValueInterface As IConvertible 497ValueInterface = TryCast(Value, IConvertible) 640Dim ValueInterface As IConvertible 643ValueInterface = TryCast(Value, IConvertible) 783Dim ValueInterface As IConvertible 786ValueInterface = TryCast(Value, IConvertible) 928Dim ValueInterface As IConvertible 931ValueInterface = TryCast(Value, IConvertible) 1074Dim ValueInterface As IConvertible 1077ValueInterface = TryCast(Value, IConvertible) 1221Dim ValueInterface As IConvertible 1224ValueInterface = TryCast(Value, IConvertible) 1380Dim ValueInterface As IConvertible 1383ValueInterface = TryCast(Value, IConvertible) 1621Dim ValueInterface As IConvertible 1623ValueInterface = TryCast(Value, IConvertible) 1765Dim ValueInterface As IConvertible 1768ValueInterface = TryCast(Value, IConvertible) 1982Dim ValueInterface As IConvertible 1985ValueInterface = TryCast(Value, IConvertible) 2054Dim ValueInterface As IConvertible 2057ValueInterface = TryCast(Value, IConvertible) 2130Dim ValueInterface As IConvertible 2132ValueInterface = TryCast(Value, IConvertible) 2251Dim ValueInterface As IConvertible 2254ValueInterface = TryCast(Value, IConvertible) 2413Dim iconv As IConvertible = TryCast(Expression, IConvertible)
Microsoft\VisualBasic\CompilerServices\DateType.vb (2)
37Dim ValueInterface As IConvertible 40ValueInterface = TryCast(Value, IConvertible)
Microsoft\VisualBasic\CompilerServices\DecimalType.vb (2)
60Dim valueInterface As IConvertible 63valueInterface = TryCast(Value, IConvertible)
Microsoft\VisualBasic\CompilerServices\DoubleType.vb (3)
51Dim valueInterface As IConvertible 54valueInterface = TryCast(Value, IConvertible) 128Private Shared Function DecimalToDouble(ByVal ValueInterface As IConvertible) As Double
Microsoft\VisualBasic\CompilerServices\IntegerType.vb (3)
43Dim ValueInterface As IConvertible 46ValueInterface = TryCast(Value, IConvertible) 118Private Shared Function DecimalToInteger(ByVal ValueInterface As IConvertible) As Integer
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (3)
200Dim conv1, conv2 As IConvertible 203conv1 = TryCast(Source, IConvertible) 214conv2 = TryCast(Pattern, IConvertible)
Microsoft\VisualBasic\CompilerServices\LongType.vb (3)
46Dim ValueInterface As IConvertible 49ValueInterface = TryCast(Value, IConvertible) 121Private Shared Function DecimalToLong(ByVal ValueInterface As IConvertible) As Long
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (72)
377Dim conv1, conv2 As IConvertible 379conv1 = TryCast(obj1, IConvertible) 380conv2 = TryCast(obj2, IConvertible) 426Dim conv1 As IConvertible 428conv1 = TryCast(obj1, IConvertible) 449Dim conv1, conv2 As IConvertible 452conv1 = TryCast(o1, IConvertible) 464conv2 = TryCast(o2, IConvertible) 481conv1 = CType(o1, IConvertible) 489conv2 = DirectCast(o2, IConvertible) 813Private Shared Function ObjTstDecimal(ByVal i1 As IConvertible, ByVal i2 As IConvertible) As Integer 825Private Shared Function ObjTstString(ByVal conv1 As IConvertible, ByVal tc1 As TypeCode, ByVal conv2 As IConvertible, ByVal tc2 As TypeCode) As Integer 878Dim conv As IConvertible 881conv = TryCast(obj, IConvertible) 933Dim conv As IConvertible 936conv = TryCast(obj, IConvertible) 952Private Shared Function InternalNegObj(ByVal obj As Object, ByVal conv As IConvertible, ByVal tc As TypeCode) As Object 1124Dim iconv As IConvertible 1131iconv = TryCast(obj, IConvertible) 1496Dim conv1, conv2 As IConvertible 1499conv1 = TryCast(o1, IConvertible) 1511conv2 = TryCast(o2, IConvertible) 1528conv1 = CType(o1, IConvertible) 1536conv2 = DirectCast(o2, IConvertible) 1719Private Shared Function AddString(ByVal conv1 As IConvertible, ByVal tc1 As TypeCode, ByVal conv2 As IConvertible, ByVal tc2 As TypeCode) As Object 1793Private Shared Function AddDecimal(ByVal conv1 As IConvertible, ByVal conv2 As IConvertible) As Object 1809Private Shared Function ToVBBool(ByVal conv As IConvertible) As Integer 1817Private Shared Function ToVBBoolConv(ByVal conv As IConvertible) As IConvertible 1826Dim conv1, conv2 As IConvertible 1829conv1 = TryCast(o1, IConvertible) 1841conv2 = TryCast(o2, IConvertible) 2018Private Shared Function SubString(ByVal conv1 As IConvertible, ByVal tc1 As TypeCode, ByVal conv2 As IConvertible, ByVal tc2 As TypeCode) As Object 2111Private Shared Function SubDecimal(ByVal conv1 As IConvertible, ByVal conv2 As IConvertible) As Object 2123Dim conv1, conv2 As IConvertible 2126conv1 = TryCast(o1, IConvertible) 2138conv2 = TryCast(o2, IConvertible) 2320Private Shared Function MulString(ByVal conv1 As IConvertible, ByVal tc1 As TypeCode, ByVal conv2 As IConvertible, ByVal tc2 As TypeCode) As Object 2415Private Shared Function MulDecimal(ByVal conv1 As IConvertible, ByVal conv2 As IConvertible) As Object 2428Dim conv1, conv2 As IConvertible 2431conv1 = TryCast(o1, IConvertible) 2443conv2 = TryCast(o2, IConvertible) 2614Private Shared Function DivString(ByVal conv1 As IConvertible, ByVal tc1 As TypeCode, ByVal conv2 As IConvertible, ByVal tc2 As TypeCode) As Object 2670Private Shared Function DivDecimal(ByVal conv1 As IConvertible, ByVal conv2 As IConvertible) As Object 2722Dim conv1, conv2 As IConvertible 2725conv1 = TryCast(o1, IConvertible) 2726conv2 = TryCast(o2, IConvertible) 2965Private Shared Function ModString(ByVal conv1 As IConvertible, ByVal tc1 As TypeCode, ByVal conv2 As IConvertible, ByVal tc2 As TypeCode) As Object 3053Private Shared Function ModDecimal(ByVal conv1 As IConvertible, ByVal conv2 As IConvertible) As Object 3067Dim conv1, conv2 As IConvertible 3070conv1 = TryCast(o1, IConvertible) 3083conv2 = TryCast(o2, IConvertible) 3270Private Shared Function IDivideString(ByVal conv1 As IConvertible, ByVal tc1 As TypeCode, ByVal conv2 As IConvertible, ByVal tc2 As TypeCode) As Object 3341Dim conv1 As IConvertible 3344conv1 = TryCast(o1, IConvertible) 3378Dim conv1 As IConvertible 3381conv1 = TryCast(o1, IConvertible) 3623Dim iconv As IConvertible 3629iconv = TryCast(o, IConvertible)
Microsoft\VisualBasic\CompilerServices\Operators.vb (3)
5120Dim conv1, conv2 As IConvertible 5123conv1 = TryCast(Left, IConvertible) 5134conv2 = TryCast(Right, IConvertible)
Microsoft\VisualBasic\CompilerServices\ShortType.vb (3)
43Dim ValueInterface As IConvertible 46ValueInterface = TryCast(Value, IConvertible) 119Private Shared Function DecimalToShort(ByVal ValueInterface As IConvertible) As Short
Microsoft\VisualBasic\CompilerServices\SingleType.vb (3)
57Dim ValueInterface As IConvertible 60ValueInterface = TryCast(Value, IConvertible) 134Private Shared Function DecimalToSingle(ByVal ValueInterface As IConvertible) As Single
Microsoft\VisualBasic\CompilerServices\StringType.vb (2)
104Dim ValueInterface As IConvertible 107ValueInterface = TryCast(Value, IConvertible)
Microsoft\VisualBasic\CompilerServices\Versioned.vb (2)
49Dim valueInterface As IConvertible = TryCast(Expression, IConvertible)
Microsoft\VisualBasic\Conversion.vb (10)
124Dim ValueInterface As IConvertible 126ValueInterface = TryCast(Number, IConvertible) 199Dim ValueInterface As IConvertible 201ValueInterface = TryCast(Number, IConvertible) 289Dim ValueInterface As IConvertible 291ValueInterface = TryCast(Number, IConvertible) 405Dim ValueInterface As IConvertible 407ValueInterface = TryCast(Number, IConvertible) 480Dim ValueInterface As IConvertible 483ValueInterface = TryCast(Number, IConvertible)
Microsoft\VisualBasic\Information.vb (2)
349Dim valueInterface As IConvertible 352valueInterface = TryCast(Expression, IConvertible)
Microsoft\VisualBasic\Strings.vb (4)
609Dim ValueInterface As IConvertible = TryCast(Expression, IConvertible) 1250Dim ConvertibleExpression As IConvertible = CType(Expression, IConvertible)
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
292[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IConvertible))]
netstandard (1)
netstandard.cs (1)
867[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IConvertible))]
System.CodeDom (1)
Microsoft\VisualBasic\VBCodeGenerator.cs (1)
817Output.Write("Global.Microsoft.VisualBasic.ChrW(" + ((IConvertible)e.Value).ToInt32(CultureInfo.InvariantCulture).ToString(CultureInfo.InvariantCulture) + ")");
System.ComponentModel.TypeConverter (2)
System\ComponentModel\EnumConverter.cs (2)
151if (value is IConvertible) 153object convertedValue = ((IConvertible)value).ToType(underlyingType, culture);
System.Data.Common (57)
System\Data\Common\BooleanStorage.cs (2)
121value = ((IConvertible)value).ToBoolean(FormatProvider); 157_values[record] = ((IConvertible)value).ToBoolean(FormatProvider);
System\Data\Common\ByteStorage.cs (2)
193value = ((IConvertible)value).ToByte(FormatProvider); 229_values[record] = ((IConvertible)value).ToByte(FormatProvider);
System\Data\Common\CharStorage.cs (2)
120value = ((IConvertible)value).ToChar(FormatProvider); 156char ch = ((IConvertible)value).ToChar(FormatProvider);
System\Data\Common\DateTimeStorage.cs (2)
128value = ((IConvertible)value).ToDateTime(FormatProvider); 165DateTime tmpValue = ((IConvertible)value).ToDateTime(FormatProvider);
System\Data\Common\DbConnectionStringCommon.cs (1)
17return ((IConvertible)value).ToString(CultureInfo.InvariantCulture);
System\Data\Common\DecimalStorage.cs (2)
194value = ((IConvertible)value).ToDecimal(FormatProvider); 225_values[record] = ((IConvertible)value).ToDecimal(FormatProvider);
System\Data\Common\DoubleStorage.cs (2)
193value = ((IConvertible)value).ToDouble(FormatProvider); 229_values[record] = ((IConvertible)value).ToDouble(FormatProvider);
System\Data\Common\Int16Storage.cs (2)
207value = ((IConvertible)value).ToInt16(FormatProvider); 243_values[record] = ((IConvertible)value).ToInt16(FormatProvider);
System\Data\Common\Int32Storage.cs (2)
206value = ((IConvertible)value).ToInt32(FormatProvider); 242_values[record] = ((IConvertible)value).ToInt32(FormatProvider);
System\Data\Common\Int64Storage.cs (2)
198value = ((IConvertible)value).ToInt64(FormatProvider); 234_values[record] = ((IConvertible)value).ToInt64(FormatProvider);
System\Data\Common\SByteStorage.cs (2)
195value = ((IConvertible)value).ToSByte(FormatProvider); 231_values[record] = ((IConvertible)value).ToSByte(FormatProvider);
System\Data\Common\SingleStorage.cs (2)
194value = ((IConvertible)value).ToSingle(FormatProvider); 230_values[record] = ((IConvertible)value).ToSingle(FormatProvider);
System\Data\Common\SQLConvert.cs (19)
436return ((IConvertible)(bool)value).ToString(formatProvider); 438return ((IConvertible)(char)value).ToString(formatProvider); 477IConvertible? iconvertible = (value as IConvertible); 517return ((IConvertible)(string)value).ToChar(formatProvider); 519return ((IConvertible)(string)value).ToSByte(formatProvider); 521return ((IConvertible)(string)value).ToByte(formatProvider); 523return ((IConvertible)(string)value).ToInt16(formatProvider); 525return ((IConvertible)(string)value).ToUInt16(formatProvider); 527return ((IConvertible)(string)value).ToInt32(formatProvider); 529return ((IConvertible)(string)value).ToUInt32(formatProvider); 531return ((IConvertible)(string)value).ToInt64(formatProvider); 533return ((IConvertible)(string)value).ToUInt64(formatProvider); 535return ((IConvertible)(string)value).ToSingle(formatProvider); 537return ((IConvertible)(string)value).ToDouble(formatProvider); 539return ((IConvertible)(string)value).ToDecimal(formatProvider); 541return ((IConvertible)(string)value).ToDateTime(formatProvider); 725IConvertible? iconvertible = (value as IConvertible);
System\Data\Common\UInt16Storage.cs (2)
206value = ((IConvertible)value).ToUInt16(FormatProvider); 242_values[record] = ((IConvertible)value).ToUInt16(FormatProvider);
System\Data\Common\UInt32Storage.cs (2)
205value = ((IConvertible)value).ToUInt32(FormatProvider); 241_values[record] = ((IConvertible)value).ToUInt32(FormatProvider);
System\Data\Common\UInt64Storage.cs (2)
196value = ((IConvertible)value).ToUInt64(FormatProvider); 232_values[record] = ((IConvertible)value).ToUInt64(FormatProvider);
System\Data\Filter\ConstNode.cs (4)
139IConvertible? convertible = (constant as IConvertible); 217IConvertible? convertible = (constant as IConvertible);
System\Data\ProviderBase\SchemaMapping.cs (5)
1155targetColumn.AutoIncrementSeed = ((IConvertible)value).ToInt64(CultureInfo.InvariantCulture); 1165targetColumn.AutoIncrementStep = ((IConvertible)value).ToInt64(CultureInfo.InvariantCulture); 1175targetColumn.ColumnMapping = (MappingType)((IConvertible)value).ToInt32(CultureInfo.InvariantCulture); 1185targetColumn.Namespace = ((IConvertible)value).ToString(CultureInfo.InvariantCulture); 1195targetColumn.Expression = ((IConvertible)value).ToString(CultureInfo.InvariantCulture);
System.Data.Odbc (4)
Common\System\Data\Common\DbConnectionStringCommon.cs (4)
186return ((IConvertible)value).ToBoolean(CultureInfo.InvariantCulture); 225return ((IConvertible)value).ToBoolean(CultureInfo.InvariantCulture); 237return ((IConvertible)value).ToInt32(CultureInfo.InvariantCulture); 249return ((IConvertible)value).ToString(CultureInfo.InvariantCulture);
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\RuntimeSettingParser.cs (1)
66case IConvertible convertible:
System.Private.CoreLib (325)
src\libraries\System.Private.CoreLib\src\System\AppContextConfigHelper.cs (2)
78case IConvertible convertible: 188case IConvertible convertible:
src\libraries\System.Private.CoreLib\src\System\Boolean.cs (16)
326bool IConvertible.ToBoolean(IFormatProvider? provider) 331char IConvertible.ToChar(IFormatProvider? provider) 336sbyte IConvertible.ToSByte(IFormatProvider? provider) 341byte IConvertible.ToByte(IFormatProvider? provider) 346short IConvertible.ToInt16(IFormatProvider? provider) 351ushort IConvertible.ToUInt16(IFormatProvider? provider) 356int IConvertible.ToInt32(IFormatProvider? provider) 361uint IConvertible.ToUInt32(IFormatProvider? provider) 366long IConvertible.ToInt64(IFormatProvider? provider) 371ulong IConvertible.ToUInt64(IFormatProvider? provider) 376float IConvertible.ToSingle(IFormatProvider? provider) 381double IConvertible.ToDouble(IFormatProvider? provider) 386decimal IConvertible.ToDecimal(IFormatProvider? provider) 391DateTime IConvertible.ToDateTime(IFormatProvider? provider) 396object IConvertible.ToType(Type type, IFormatProvider? provider) 398return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\Byte.cs (16)
182bool IConvertible.ToBoolean(IFormatProvider? provider) 187char IConvertible.ToChar(IFormatProvider? provider) 192sbyte IConvertible.ToSByte(IFormatProvider? provider) 197byte IConvertible.ToByte(IFormatProvider? provider) 202short IConvertible.ToInt16(IFormatProvider? provider) 207ushort IConvertible.ToUInt16(IFormatProvider? provider) 212int IConvertible.ToInt32(IFormatProvider? provider) 217uint IConvertible.ToUInt32(IFormatProvider? provider) 222long IConvertible.ToInt64(IFormatProvider? provider) 227ulong IConvertible.ToUInt64(IFormatProvider? provider) 232float IConvertible.ToSingle(IFormatProvider? provider) 237double IConvertible.ToDouble(IFormatProvider? provider) 242decimal IConvertible.ToDecimal(IFormatProvider? provider) 247DateTime IConvertible.ToDateTime(IFormatProvider? provider) 252object IConvertible.ToType(Type type, IFormatProvider? provider) 254return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\Char.cs (16)
517bool IConvertible.ToBoolean(IFormatProvider? provider) 522char IConvertible.ToChar(IFormatProvider? provider) 527sbyte IConvertible.ToSByte(IFormatProvider? provider) 532byte IConvertible.ToByte(IFormatProvider? provider) 537short IConvertible.ToInt16(IFormatProvider? provider) 542ushort IConvertible.ToUInt16(IFormatProvider? provider) 547int IConvertible.ToInt32(IFormatProvider? provider) 552uint IConvertible.ToUInt32(IFormatProvider? provider) 557long IConvertible.ToInt64(IFormatProvider? provider) 562ulong IConvertible.ToUInt64(IFormatProvider? provider) 567float IConvertible.ToSingle(IFormatProvider? provider) 572double IConvertible.ToDouble(IFormatProvider? provider) 577decimal IConvertible.ToDecimal(IFormatProvider? provider) 582DateTime IConvertible.ToDateTime(IFormatProvider? provider) 587object IConvertible.ToType(Type type, IFormatProvider? provider) 589return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\Convert.cs (68)
100if (value is IConvertible temp) 112return value is IConvertible convertible ? convertible.GetTypeCode() == TypeCode.DBNull : false; 136if (value is not IConvertible v) 168internal static object DefaultToType(IConvertible value, Type targetType, IFormatProvider? provider) 242if (value is not IConvertible ic) 317return value == null ? false : ((IConvertible)value).ToBoolean(null); 322return value == null ? false : ((IConvertible)value).ToBoolean(provider); 340return ((IConvertible)value).ToBoolean(null); 412return ((IConvertible)value).ToBoolean(null); 422return value == null ? (char)0 : ((IConvertible)value).ToChar(null); 427return value == null ? (char)0 : ((IConvertible)value).ToChar(provider); 432return ((IConvertible)value).ToChar(null); 505return ((IConvertible)value).ToChar(null); 512return ((IConvertible)value).ToChar(null); 519return ((IConvertible)value).ToChar(null); 524return ((IConvertible)value).ToChar(null); 535return value == null ? (sbyte)0 : ((IConvertible)value).ToSByte(null); 541return value == null ? (sbyte)0 : ((IConvertible)value).ToSByte(provider); 647return ((IConvertible)value).ToSByte(null); 657return value == null ? (byte)0 : ((IConvertible)value).ToByte(null); 662return value == null ? (byte)0 : ((IConvertible)value).ToByte(provider); 750return ((IConvertible)value).ToByte(null); 760return value == null ? (short)0 : ((IConvertible)value).ToInt16(null); 765return value == null ? (short)0 : ((IConvertible)value).ToInt16(provider); 859return ((IConvertible)value).ToInt16(null); 870return value == null ? (ushort)0 : ((IConvertible)value).ToUInt16(null); 876return value == null ? (ushort)0 : ((IConvertible)value).ToUInt16(provider); 974return ((IConvertible)value).ToUInt16(null); 984return value == null ? 0 : ((IConvertible)value).ToInt32(null); 989return value == null ? 0 : ((IConvertible)value).ToInt32(provider); 1100return ((IConvertible)value).ToInt32(null); 1111return value == null ? 0 : ((IConvertible)value).ToUInt32(null); 1117return value == null ? 0 : ((IConvertible)value).ToUInt32(provider); 1225return ((IConvertible)value).ToUInt32(null); 1235return value == null ? 0 : ((IConvertible)value).ToInt64(null); 1240return value == null ? 0 : ((IConvertible)value).ToInt64(provider); 1329return ((IConvertible)value).ToInt64(null); 1340return value == null ? 0 : ((IConvertible)value).ToUInt64(null); 1346return value == null ? 0 : ((IConvertible)value).ToUInt64(provider); 1450return ((IConvertible)value).ToUInt64(null); 1460return value == null ? 0 : ((IConvertible)value).ToSingle(null); 1465return value == null ? 0 : ((IConvertible)value).ToSingle(provider); 1481return ((IConvertible)value).ToSingle(null); 1553return ((IConvertible)value).ToSingle(null); 1563return value == null ? 0 : ((IConvertible)value).ToDouble(null); 1568return value == null ? 0 : ((IConvertible)value).ToDouble(provider); 1589return ((IConvertible)value).ToDouble(null); 1656return ((IConvertible)value).ToDouble(null); 1666return value == null ? 0 : ((IConvertible)value).ToDecimal(null); 1671return value == null ? 0 : ((IConvertible)value).ToDecimal(provider); 1687return ((IConvertible)value).ToDecimal(null); 1759return ((IConvertible)value).ToDecimal(null); 1774return value == null ? DateTime.MinValue : ((IConvertible)value).ToDateTime(null); 1779return value == null ? DateTime.MinValue : ((IConvertible)value).ToDateTime(provider); 1799return ((IConvertible)value).ToDateTime(null); 1804return ((IConvertible)value).ToDateTime(null); 1809return ((IConvertible)value).ToDateTime(null); 1815return ((IConvertible)value).ToDateTime(null); 1820return ((IConvertible)value).ToDateTime(null); 1826return ((IConvertible)value).ToDateTime(null); 1831return ((IConvertible)value).ToDateTime(null); 1837return ((IConvertible)value).ToDateTime(null); 1842return ((IConvertible)value).ToDateTime(null); 1847return ((IConvertible)value).ToDateTime(null); 1852return ((IConvertible)value).ToDateTime(null); 1857return ((IConvertible)value).ToDateTime(null); 1862return ((IConvertible)value).ToDateTime(null); 1877if (value is IConvertible ic)
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (15)
1976bool IConvertible.ToBoolean(IFormatProvider? provider) => throw InvalidCast(nameof(Boolean)); 1977char IConvertible.ToChar(IFormatProvider? provider) => throw InvalidCast(nameof(Char)); 1978sbyte IConvertible.ToSByte(IFormatProvider? provider) => throw InvalidCast(nameof(SByte)); 1979byte IConvertible.ToByte(IFormatProvider? provider) => throw InvalidCast(nameof(Byte)); 1980short IConvertible.ToInt16(IFormatProvider? provider) => throw InvalidCast(nameof(Int16)); 1981ushort IConvertible.ToUInt16(IFormatProvider? provider) => throw InvalidCast(nameof(UInt16)); 1982int IConvertible.ToInt32(IFormatProvider? provider) => throw InvalidCast(nameof(Int32)); 1983uint IConvertible.ToUInt32(IFormatProvider? provider) => throw InvalidCast(nameof(UInt32)); 1984long IConvertible.ToInt64(IFormatProvider? provider) => throw InvalidCast(nameof(Int64)); 1985ulong IConvertible.ToUInt64(IFormatProvider? provider) => throw InvalidCast(nameof(UInt64)); 1986float IConvertible.ToSingle(IFormatProvider? provider) => throw InvalidCast(nameof(Single)); 1987double IConvertible.ToDouble(IFormatProvider? provider) => throw InvalidCast(nameof(Double)); 1988decimal IConvertible.ToDecimal(IFormatProvider? provider) => throw InvalidCast(nameof(Decimal)); 1992DateTime IConvertible.ToDateTime(IFormatProvider? provider) => this; 1994object IConvertible.ToType(Type type, IFormatProvider? provider) => Convert.DefaultToType(this, type, provider);
src\libraries\System.Private.CoreLib\src\System\DBNull.cs (16)
42bool IConvertible.ToBoolean(IFormatProvider? provider) 47char IConvertible.ToChar(IFormatProvider? provider) 52sbyte IConvertible.ToSByte(IFormatProvider? provider) 57byte IConvertible.ToByte(IFormatProvider? provider) 62short IConvertible.ToInt16(IFormatProvider? provider) 67ushort IConvertible.ToUInt16(IFormatProvider? provider) 72int IConvertible.ToInt32(IFormatProvider? provider) 77uint IConvertible.ToUInt32(IFormatProvider? provider) 82long IConvertible.ToInt64(IFormatProvider? provider) 87ulong IConvertible.ToUInt64(IFormatProvider? provider) 92float IConvertible.ToSingle(IFormatProvider? provider) 97double IConvertible.ToDouble(IFormatProvider? provider) 102decimal IConvertible.ToDecimal(IFormatProvider? provider) 107DateTime IConvertible.ToDateTime(IFormatProvider? provider) 112object IConvertible.ToType(Type type, IFormatProvider? provider) 114return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (16)
1034bool IConvertible.ToBoolean(IFormatProvider? provider) 1039char IConvertible.ToChar(IFormatProvider? provider) 1044sbyte IConvertible.ToSByte(IFormatProvider? provider) 1049byte IConvertible.ToByte(IFormatProvider? provider) 1054short IConvertible.ToInt16(IFormatProvider? provider) 1059ushort IConvertible.ToUInt16(IFormatProvider? provider) 1064int IConvertible.ToInt32(IFormatProvider? provider) 1069uint IConvertible.ToUInt32(IFormatProvider? provider) 1074long IConvertible.ToInt64(IFormatProvider? provider) 1079ulong IConvertible.ToUInt64(IFormatProvider? provider) 1084float IConvertible.ToSingle(IFormatProvider? provider) 1089double IConvertible.ToDouble(IFormatProvider? provider) 1094decimal IConvertible.ToDecimal(IFormatProvider? provider) 1099DateTime IConvertible.ToDateTime(IFormatProvider? provider) 1104object IConvertible.ToType(Type type, IFormatProvider? provider) 1106return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\Double.cs (16)
452bool IConvertible.ToBoolean(IFormatProvider? provider) 457char IConvertible.ToChar(IFormatProvider? provider) 462sbyte IConvertible.ToSByte(IFormatProvider? provider) 467byte IConvertible.ToByte(IFormatProvider? provider) 472short IConvertible.ToInt16(IFormatProvider? provider) 477ushort IConvertible.ToUInt16(IFormatProvider? provider) 482int IConvertible.ToInt32(IFormatProvider? provider) 487uint IConvertible.ToUInt32(IFormatProvider? provider) 492long IConvertible.ToInt64(IFormatProvider? provider) 497ulong IConvertible.ToUInt64(IFormatProvider? provider) 502float IConvertible.ToSingle(IFormatProvider? provider) 507double IConvertible.ToDouble(IFormatProvider? provider) 512decimal IConvertible.ToDecimal(IFormatProvider? provider) 517DateTime IConvertible.ToDateTime(IFormatProvider? provider) 522object IConvertible.ToType(Type type, IFormatProvider? provider) 524return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\Enum.cs (15)
2177bool IConvertible.ToBoolean(IFormatProvider? provider) => Convert.ToBoolean(GetValue()); 2178char IConvertible.ToChar(IFormatProvider? provider) => Convert.ToChar(GetValue()); 2179sbyte IConvertible.ToSByte(IFormatProvider? provider) => Convert.ToSByte(GetValue()); 2180byte IConvertible.ToByte(IFormatProvider? provider) => Convert.ToByte(GetValue()); 2181short IConvertible.ToInt16(IFormatProvider? provider) => Convert.ToInt16(GetValue()); 2182ushort IConvertible.ToUInt16(IFormatProvider? provider) => Convert.ToUInt16(GetValue()); 2183int IConvertible.ToInt32(IFormatProvider? provider) => Convert.ToInt32(GetValue()); 2184uint IConvertible.ToUInt32(IFormatProvider? provider) => Convert.ToUInt32(GetValue()); 2185long IConvertible.ToInt64(IFormatProvider? provider) => Convert.ToInt64(GetValue()); 2186ulong IConvertible.ToUInt64(IFormatProvider? provider) => Convert.ToUInt64(GetValue()); 2187float IConvertible.ToSingle(IFormatProvider? provider) => Convert.ToSingle(GetValue()); 2188double IConvertible.ToDouble(IFormatProvider? provider) => Convert.ToDouble(GetValue()); 2189decimal IConvertible.ToDecimal(IFormatProvider? provider) => Convert.ToDecimal(GetValue()); 2190DateTime IConvertible.ToDateTime(IFormatProvider? provider) => throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Enum", "DateTime")); 2191object IConvertible.ToType(Type type, IFormatProvider? provider) => Convert.DefaultToType(this, type, provider);
src\libraries\System.Private.CoreLib\src\System\Int16.cs (16)
185bool IConvertible.ToBoolean(IFormatProvider? provider) 190char IConvertible.ToChar(IFormatProvider? provider) 195sbyte IConvertible.ToSByte(IFormatProvider? provider) 200byte IConvertible.ToByte(IFormatProvider? provider) 205short IConvertible.ToInt16(IFormatProvider? provider) 210ushort IConvertible.ToUInt16(IFormatProvider? provider) 215int IConvertible.ToInt32(IFormatProvider? provider) 220uint IConvertible.ToUInt32(IFormatProvider? provider) 225long IConvertible.ToInt64(IFormatProvider? provider) 230ulong IConvertible.ToUInt64(IFormatProvider? provider) 235float IConvertible.ToSingle(IFormatProvider? provider) 240double IConvertible.ToDouble(IFormatProvider? provider) 245decimal IConvertible.ToDecimal(IFormatProvider? provider) 250DateTime IConvertible.ToDateTime(IFormatProvider? provider) 255object IConvertible.ToType(Type type, IFormatProvider? provider) 257return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\Int32.cs (16)
200bool IConvertible.ToBoolean(IFormatProvider? provider) 205char IConvertible.ToChar(IFormatProvider? provider) 210sbyte IConvertible.ToSByte(IFormatProvider? provider) 215byte IConvertible.ToByte(IFormatProvider? provider) 220short IConvertible.ToInt16(IFormatProvider? provider) 225ushort IConvertible.ToUInt16(IFormatProvider? provider) 230int IConvertible.ToInt32(IFormatProvider? provider) 235uint IConvertible.ToUInt32(IFormatProvider? provider) 240long IConvertible.ToInt64(IFormatProvider? provider) 245ulong IConvertible.ToUInt64(IFormatProvider? provider) 250float IConvertible.ToSingle(IFormatProvider? provider) 255double IConvertible.ToDouble(IFormatProvider? provider) 260decimal IConvertible.ToDecimal(IFormatProvider? provider) 265DateTime IConvertible.ToDateTime(IFormatProvider? provider) 270object IConvertible.ToType(Type type, IFormatProvider? provider) 272return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\Int64.cs (16)
197bool IConvertible.ToBoolean(IFormatProvider? provider) 202char IConvertible.ToChar(IFormatProvider? provider) 207sbyte IConvertible.ToSByte(IFormatProvider? provider) 212byte IConvertible.ToByte(IFormatProvider? provider) 217short IConvertible.ToInt16(IFormatProvider? provider) 222ushort IConvertible.ToUInt16(IFormatProvider? provider) 227int IConvertible.ToInt32(IFormatProvider? provider) 232uint IConvertible.ToUInt32(IFormatProvider? provider) 237long IConvertible.ToInt64(IFormatProvider? provider) 242ulong IConvertible.ToUInt64(IFormatProvider? provider) 247float IConvertible.ToSingle(IFormatProvider? provider) 252double IConvertible.ToDouble(IFormatProvider? provider) 257decimal IConvertible.ToDecimal(IFormatProvider? provider) 262DateTime IConvertible.ToDateTime(IFormatProvider? provider) 267object IConvertible.ToType(Type type, IFormatProvider? provider) 269return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (1)
492idx[i] = ((IConvertible)providedArgs![i]!).ToInt32(null);
src\libraries\System.Private.CoreLib\src\System\SByte.cs (16)
188bool IConvertible.ToBoolean(IFormatProvider? provider) 193char IConvertible.ToChar(IFormatProvider? provider) 198sbyte IConvertible.ToSByte(IFormatProvider? provider) 203byte IConvertible.ToByte(IFormatProvider? provider) 208short IConvertible.ToInt16(IFormatProvider? provider) 213ushort IConvertible.ToUInt16(IFormatProvider? provider) 218int IConvertible.ToInt32(IFormatProvider? provider) 223uint IConvertible.ToUInt32(IFormatProvider? provider) 228long IConvertible.ToInt64(IFormatProvider? provider) 233ulong IConvertible.ToUInt64(IFormatProvider? provider) 238float IConvertible.ToSingle(IFormatProvider? provider) 243double IConvertible.ToDouble(IFormatProvider? provider) 248decimal IConvertible.ToDecimal(IFormatProvider? provider) 253DateTime IConvertible.ToDateTime(IFormatProvider? provider) 258object IConvertible.ToType(Type type, IFormatProvider? provider) 260return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\Single.cs (16)
447bool IConvertible.ToBoolean(IFormatProvider? provider) 452char IConvertible.ToChar(IFormatProvider? provider) 457sbyte IConvertible.ToSByte(IFormatProvider? provider) 462byte IConvertible.ToByte(IFormatProvider? provider) 467short IConvertible.ToInt16(IFormatProvider? provider) 472ushort IConvertible.ToUInt16(IFormatProvider? provider) 477int IConvertible.ToInt32(IFormatProvider? provider) 482uint IConvertible.ToUInt32(IFormatProvider? provider) 487long IConvertible.ToInt64(IFormatProvider? provider) 492ulong IConvertible.ToUInt64(IFormatProvider? provider) 497float IConvertible.ToSingle(IFormatProvider? provider) 502double IConvertible.ToDouble(IFormatProvider? provider) 507decimal IConvertible.ToDecimal(IFormatProvider? provider) 512DateTime IConvertible.ToDateTime(IFormatProvider? provider) 517object IConvertible.ToType(Type type, IFormatProvider? provider) 519return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (16)
179bool IConvertible.ToBoolean(IFormatProvider? provider) 184char IConvertible.ToChar(IFormatProvider? provider) 189sbyte IConvertible.ToSByte(IFormatProvider? provider) 194byte IConvertible.ToByte(IFormatProvider? provider) 199short IConvertible.ToInt16(IFormatProvider? provider) 204ushort IConvertible.ToUInt16(IFormatProvider? provider) 209int IConvertible.ToInt32(IFormatProvider? provider) 214uint IConvertible.ToUInt32(IFormatProvider? provider) 219long IConvertible.ToInt64(IFormatProvider? provider) 224ulong IConvertible.ToUInt64(IFormatProvider? provider) 229float IConvertible.ToSingle(IFormatProvider? provider) 234double IConvertible.ToDouble(IFormatProvider? provider) 239decimal IConvertible.ToDecimal(IFormatProvider? provider) 244DateTime IConvertible.ToDateTime(IFormatProvider? provider) 249object IConvertible.ToType(Type type, IFormatProvider? provider) 251return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (16)
195bool IConvertible.ToBoolean(IFormatProvider? provider) 200char IConvertible.ToChar(IFormatProvider? provider) 205sbyte IConvertible.ToSByte(IFormatProvider? provider) 210byte IConvertible.ToByte(IFormatProvider? provider) 215short IConvertible.ToInt16(IFormatProvider? provider) 220ushort IConvertible.ToUInt16(IFormatProvider? provider) 225int IConvertible.ToInt32(IFormatProvider? provider) 230uint IConvertible.ToUInt32(IFormatProvider? provider) 235long IConvertible.ToInt64(IFormatProvider? provider) 240ulong IConvertible.ToUInt64(IFormatProvider? provider) 245float IConvertible.ToSingle(IFormatProvider? provider) 250double IConvertible.ToDouble(IFormatProvider? provider) 255decimal IConvertible.ToDecimal(IFormatProvider? provider) 260DateTime IConvertible.ToDateTime(IFormatProvider? provider) 265object IConvertible.ToType(Type type, IFormatProvider? provider) 267return Convert.DefaultToType((IConvertible)this, type, provider);
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (16)
194bool IConvertible.ToBoolean(IFormatProvider? provider) 199char IConvertible.ToChar(IFormatProvider? provider) 204sbyte IConvertible.ToSByte(IFormatProvider? provider) 209byte IConvertible.ToByte(IFormatProvider? provider) 214short IConvertible.ToInt16(IFormatProvider? provider) 219ushort IConvertible.ToUInt16(IFormatProvider? provider) 224int IConvertible.ToInt32(IFormatProvider? provider) 229uint IConvertible.ToUInt32(IFormatProvider? provider) 234long IConvertible.ToInt64(IFormatProvider? provider) 239ulong IConvertible.ToUInt64(IFormatProvider? provider) 244float IConvertible.ToSingle(IFormatProvider? provider) 249double IConvertible.ToDouble(IFormatProvider? provider) 254decimal IConvertible.ToDecimal(IFormatProvider? provider) 259DateTime IConvertible.ToDateTime(IFormatProvider? provider) 264object IConvertible.ToType(Type type, IFormatProvider? provider) 266return Convert.DefaultToType((IConvertible)this, type, provider);
System.Private.Xml (3)
System\Xml\Serialization\Models.cs (1)
447return new ConstantModel(fieldInfo, ((IConvertible)fieldInfo.GetValue(null)!).ToInt64(null));
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (2)
588value = ((IConvertible)value).ToDouble(null); 640value = new XmlQueryItemSequence(new XmlAtomicValue(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Double), ((IConvertible)value).ToDouble(null)));
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
268[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IConvertible))]
System.Windows.Forms (6)
System\Windows\Forms\DataBinding\Binding.cs (4)
653if (!(cevent.Value is DBNull) && cevent.Value is not null && cevent.DesiredType is not null && !cevent.DesiredType.IsInstanceOfType(cevent.Value) && (cevent.Value is IConvertible)) 666if (!(cevent.Value is DBNull) && cevent.DesiredType is not null && !cevent.DesiredType.IsInstanceOfType(cevent.Value) && (cevent.Value is IConvertible)) 728if (value is IConvertible) 802if (value is IConvertible)
System\Windows\Forms\Internal\Formatter.cs (2)
215else if (value is IConvertible) 364else if (value is IConvertible)
System.Windows.Forms.Design (18)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (17)
562if (rhs is IConvertible ic) 626if (index is IConvertible ic) 932if (result is IConvertible ic) 994Debug.Assert(o is IConvertible, $"Array size expression could not be resolved to IConvertible: {(o.GetType().Name)}"); 996if (o is IConvertible ic) 1036if (index is IConvertible convertible) 1063if (left is IConvertible icLeft && right is IConvertible icRight) 1247private static object ExecuteBinaryExpression(IConvertible left, IConvertible right, CodeBinaryOperatorType op) 1283private static object ExecuteBinaryOperator(IConvertible left, IConvertible right, CodeBinaryOperatorType op) 1427private static bool ExecuteBooleanOperator(IConvertible left, IConvertible right, CodeBinaryOperatorType op) 1467private static object ExecuteMathOperator(IConvertible left, IConvertible right, CodeBinaryOperatorType op) 1557if (rhs is IConvertible ic && p.PropertyType != rhs.GetType())
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (1)
321if (argArray[t] is IConvertible convertible)
System.Xaml.Tests (3)
System\Xaml\XamlTypeTests.cs (3)
1707yield return new object?[] { new SubXamlType(typeof(IConvertible), new XamlSchemaContext()), null }; 1913yield return new object[] { new SubXamlType(typeof(IConvertible), new XamlSchemaContext()), true }; 2658yield return new object[] { new SubXamlType(typeof(IConvertible), new XamlSchemaContext()), false };