73 references to ChangeType
dotnet-svcutil-lib (2)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (1)
2257ilg.Ldc(Convert.ChangeType(value, source.Type, CultureInfo.InvariantCulture));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (1)
981Ldc(Convert.ChangeType(o, Enum.GetUnderlyingType(valueType), null));
Microsoft.AspNetCore.Components (1)
src\Http\Routing\src\ParameterPolicyActivator.cs (1)
226parameters[i] = Convert.ChangeType(arguments[argumentPosition], parameterType, CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\Binders\EnumTypeModelBinder.cs (1)
80var underlying = Convert.ChangeType(
Microsoft.AspNetCore.Routing (1)
ParameterPolicyActivator.cs (1)
226parameters[i] = Convert.ChangeType(arguments[argumentPosition], parameterType, CultureInfo.InvariantCulture);
Microsoft.Build (9)
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupLoggingHelper.cs (1)
248sb.Append((string)Convert.ChangeType(parameterValue, typeof(string), CultureInfo.CurrentCulture));
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (3)
723return InternalSetTaskParameter(parameter, Convert.ChangeType(expandedParameterValue, parameterType, CultureInfo.InvariantCulture)); 754finalTaskInputs.Add(Convert.ChangeType(item.ItemSpec, parameterType.GetElementType(), CultureInfo.InvariantCulture)); 838stringOutputs[i] = (string)Convert.ChangeType(output, typeof(string), CultureInfo.InvariantCulture);
Evaluation\Expander.cs (2)
3981args[0] = Convert.ChangeType(args[0], objectInstance.GetType(), CultureInfo.InvariantCulture); 4535coercedArguments[n] = Convert.ChangeType(args[n], parameters[n].ParameterType, CultureInfo.InvariantCulture);
TaskParameter.cs (3)
162wrappedParameter = (string)Convert.ChangeType(wrappedParameter, typeof(string), CultureInfo.InvariantCulture); 562stringValue = (string)Convert.ChangeType(_wrappedParameter, typeof(string), CultureInfo.InvariantCulture); 665valueString = (string)Convert.ChangeType(_wrappedParameter, typeof(string), CultureInfo.InvariantCulture);
Microsoft.Build.Engine.UnitTests (2)
TaskParameter_Tests.cs (2)
63object value = Convert.ChangeType(testValueAsString, type, CultureInfo.InvariantCulture); 102object value = Convert.ChangeType(values[i], type, CultureInfo.InvariantCulture);
Microsoft.Build.Tasks.Core (1)
WriteCodeFragment.cs (1)
609return new CodePrimitiveExpression(Convert.ChangeType(value, targetType, CultureInfo.InvariantCulture));
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\ConstVal.cs (1)
85return (T)Convert.ChangeType(o, typeof(T), CultureInfo.InvariantCulture);
Microsoft.Data.Analysis (2)
DataFrame.cs (2)
562value = Convert.ChangeType(value, column.DataType, cultureInfo); 638value = Convert.ChangeType(value, column.DataType, cultureInfo);
Microsoft.Extensions.AI.Abstractions (1)
AdditionalPropertiesDictionary{TValue}.cs (1)
177value = (T)Convert.ChangeType(obj, typeof(T), CultureInfo.InvariantCulture);
Microsoft.JSInterop (1)
Infrastructure\TaskGenericsUtil.cs (1)
94: (T)Convert.ChangeType(result, typeof(T), CultureInfo.InvariantCulture)!;
Microsoft.Maui.Controls (3)
BindingExpression.cs (1)
367 object arg = Convert.ChangeType(part.Content, parameter.ParameterType, CultureInfo.InvariantCulture);
BindingExpressionHelper.cs (1)
47 value = Convert.ChangeType(value, convertTo, CultureInfo.CurrentCulture);
CompareStateTrigger.cs (1)
77 value1 = Convert.ChangeType(value1, value2.GetType(), CultureInfo.InvariantCulture);
MSBuild (3)
TaskParameter.cs (3)
162wrappedParameter = (string)Convert.ChangeType(wrappedParameter, typeof(string), CultureInfo.InvariantCulture); 562stringValue = (string)Convert.ChangeType(_wrappedParameter, typeof(string), CultureInfo.InvariantCulture); 665valueString = (string)Convert.ChangeType(_wrappedParameter, typeof(string), CultureInfo.InvariantCulture);
MSBuildTaskHost (3)
TaskParameter.cs (3)
162wrappedParameter = (string)Convert.ChangeType(wrappedParameter, typeof(string), CultureInfo.InvariantCulture); 562stringValue = (string)Convert.ChangeType(_wrappedParameter, typeof(string), CultureInfo.InvariantCulture); 665valueString = (string)Convert.ChangeType(_wrappedParameter, typeof(string), CultureInfo.InvariantCulture);
PresentationBuildTasks (2)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (2)
2520uintValue += (uint)Convert.ChangeType(rawEnumValue, typeof(uint), TypeConverterHelper.InvariantEnglishUS); 2539bamlBinaryWriter.Write((byte)Convert.ChangeType(convertedValue, typeof(byte), TypeConverterHelper.InvariantEnglishUS));
PresentationFramework (4)
MS\Internal\Data\DefaultValueConverter.cs (2)
455return System.Convert.ChangeType(o, _targetType, culture); 463: System.Convert.ChangeType(o, _sourceType, culture);
System\Windows\Markup\BamlRecords.cs (2)
2520uintValue += (uint)Convert.ChangeType(rawEnumValue, typeof(uint), TypeConverterHelper.InvariantEnglishUS); 2539bamlBinaryWriter.Write((byte)Convert.ChangeType(convertedValue, typeof(byte), TypeConverterHelper.InvariantEnglishUS));
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
331convertedValue = Convert.ChangeType(value, expectedValueType, CultureInfo.CurrentCulture);
System\ComponentModel\DataAnnotations\EnumDataTypeAttribute.cs (1)
105Convert.ChangeType(enumValue, Enum.GetUnderlyingType(enumType), CultureInfo.InvariantCulture).ToString();
System.ComponentModel.Composition (2)
Microsoft\Internal\GenerationServices.cs (2)
90rawValue = Convert.ChangeType(value, Enum.GetUnderlyingType(valueType), null); 125ilGenerator.LoadInt((int)Convert.ChangeType(rawValue, typeof(int), CultureInfo.InvariantCulture));
System.ComponentModel.TypeConverter (1)
System\ComponentModel\BaseNumberConverter.cs (1)
104return Convert.ChangeType(value, destinationType, culture);
System.Configuration.ConfigurationManager (2)
System\Configuration\AppSettingsReader.cs (1)
67return Convert.ChangeType(val, type, CultureInfo.InvariantCulture);
System\Diagnostics\TraceUtils.cs (1)
200Convert.ChangeType(value, type, CultureInfo.InvariantCulture);
System.Data.Common (9)
System\Data\Common\SQLConvert.cs (1)
553return Convert.ChangeType(value, type, formatProvider);
System\Data\DataRowExtensions.cs (1)
199value = nullableType.IsEnum ? Enum.ToObject(nullableType, value) : Convert.ChangeType(value, nullableType, null);
System\Data\Filter\BinaryNode.cs (1)
1072value = Convert.ChangeType(value, DataStorage.GetTypeStorage(resultType), FormatProvider);
System\Data\XmlDataLoader.cs (2)
928hasErrors = (bool)Convert.ChangeType(_dataReader.Value, typeof(bool), CultureInfo.InvariantCulture); 938rowOrder = (int)Convert.ChangeType(_dataReader.Value, typeof(int), CultureInfo.InvariantCulture);
System\Data\XMLDiffLoader.cs (1)
318pos = (int)Convert.ChangeType(value, typeof(int), null);
System\Data\XMLSchema.cs (3)
2043int ordinal = (int)Convert.ChangeType(tmp, typeof(int), null); 2157int ordinal = (int)Convert.ChangeType(tmp, typeof(int), null); 2530int ordinal = (int)Convert.ChangeType(tmp, typeof(int), null);
System.Data.Odbc (2)
System\Data\Odbc\OdbcMetaDataFactory.cs (1)
251sqlType = (ODBC32.SQL_TYPE)(int)Convert.ChangeType(getTypeInfoValues[indexDATA_TYPE], typeof(int), null);
System\Data\Odbc\OdbcParameter.cs (1)
999value = Convert.ChangeType(value, _typemap._type, null);
System.Private.CoreLib (3)
src\libraries\System.Private.CoreLib\src\System\ComponentModel\DefaultValueAttribute.cs (1)
69_value = Convert.ChangeType(value, type, CultureInfo.InvariantCulture);
src\libraries\System.Private.CoreLib\src\System\Convert.cs (1)
225return ChangeType(value, conversionType, CultureInfo.CurrentCulture);
src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
1005result = (TUnderlying)ToObject(enumType, Convert.ChangeType(value.ToString(), underlyingType, CultureInfo.InvariantCulture)!);
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\CodeGenerator.cs (1)
808Ldc(Convert.ChangeType(o, Enum.GetUnderlyingType(valueType), null));
System.Private.Xml (4)
System\Xml\Serialization\CodeGenerator.cs (1)
778Ldc(Convert.ChangeType(o, Enum.GetUnderlyingType(valueType), null));
System\Xml\Serialization\XmlSerializationWriterILGen.cs (1)
2129ilg.Ldc(Convert.ChangeType(value, source.Type!, CultureInfo.InvariantCulture));
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (1)
495value = Convert.ChangeType(value, destinationType, CultureInfo.InvariantCulture);
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (1)
710return Convert.ChangeType(ToNumber(argument), type, CultureInfo.InvariantCulture);
System.Runtime.Serialization.Formatters (1)
System\Runtime\Serialization\FormatterConverter.cs (1)
15return System.Convert.ChangeType(value, type, CultureInfo.InvariantCulture);
System.Windows.Forms (7)
System\Windows\Forms\ComponentModel\COM2Interop\COM2Enum.cs (1)
99value = Convert.ChangeType(value, _values[0].GetType(), CultureInfo.InvariantCulture);
System\Windows\Forms\ComponentModel\COM2Interop\Com2IPerPropertyBrowsingHandler.Com2IPerPropertyBrowsingEnum.cs (1)
120valueItems[i] = Convert.ChangeType(valueItems[i], targetType, CultureInfo.InvariantCulture);
System\Windows\Forms\DataBinding\Binding.cs (4)
652cevent.Value = Convert.ChangeType(cevent.Value, cevent.DesiredType, CultureInfo.CurrentCulture); 665cevent.Value = Convert.ChangeType(cevent.Value, cevent.DesiredType, CultureInfo.CurrentCulture); 727object ret = Convert.ChangeType(value, type, CultureInfo.CurrentCulture); 801ret = Convert.ChangeType(value, type, CultureInfo.CurrentCulture);
System\Windows\Forms\Internal\Formatter.cs (1)
386return Convert.ChangeType(value, type, formatInfo);
System.Windows.Forms.Design (1)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (1)
976o = Convert.ChangeType(o, arrayType, CultureInfo.InvariantCulture);
xunit.assert (1)
Sdk\AssertHelper.cs (1)
321 converted = Convert.ChangeType(value, targetType, CultureInfo.CurrentCulture);