31 references to ChangeType
Microsoft.CodeAnalysis.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (2)
129if (existingConstants[0].Equals(Convert.ChangeType(2, existingConstants[0].GetType())) && 130existingConstants[1].Equals(Convert.ChangeType(1, existingConstants[1].GetType())))
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (2)
129if (existingConstants[0].Equals(Convert.ChangeType(2, existingConstants[0].GetType())) && 130existingConstants[1].Equals(Convert.ChangeType(1, existingConstants[1].GetType())))
Microsoft.Data.Analysis (12)
GroupBy.cs (1)
486retColumn[rowIndex] = (double)Convert.ChangeType(_dataFrame.Columns[columnIndex].Sum(rowEnumerable), typeof(double)) / rowEnumerable.Count;
PrimitiveDataFrameColumn.cs (11)
265double middleValue = (double)Convert.ChangeType(this[sortIndices[middle].Value].Value, typeof(double)); 268double otherMiddleValue = (double)Convert.ChangeType(this[sortIndices[middle - 1].Value].Value, typeof(double)); 280return (double)Convert.ChangeType((T)Sum(), typeof(double)) / (Length - NullCount); 350T convertedValue = (T)Convert.ChangeType(value, typeof(T)); 716object convertedLower = Convert.ChangeType(min, typeof(T)); 718return Clamp((T)convertedLower, (T)Convert.ChangeType(max, typeof(T)), inPlace); 746object convertedLower = Convert.ChangeType(min, typeof(T)); 748return Filter((T)convertedLower, (T)Convert.ChangeType(max, typeof(T))); 760max = (float)Convert.ChangeType(Max(), typeof(float)); 768min = (float)Convert.ChangeType(Min(), typeof(float)); 776mean = (float)Convert.ChangeType(Sum(), typeof(float)) / Length;
Microsoft.Data.Analysis.Tests (3)
DataFrameTests.cs (1)
1002row[i] = Convert.ChangeType(12, column.DataType);
DataFrameTests.Utils.cs (2)
207DataFrameColumn baseColumn1 = DataFrameColumn.Create("Column1", Enumerable.Range(0, length).Select(x => (T1)Convert.ChangeType(x % 2 == 0 ? 0 : 1, typeof(T1)))); 208DataFrameColumn baseColumn2 = DataFrameColumn.Create("Column2", Enumerable.Range(0, length).Select(x => (T2)Convert.ChangeType(x % 2 == 0 ? 0 : 1, typeof(T2))));
Microsoft.Extensions.Configuration.Binder (1)
ConfigurationBinder.cs (1)
729keyTypeIsInteger ? Convert.ChangeType(child.Key, keyType) :
Microsoft.Maui.Controls (2)
BindableProperty.cs (1)
224 value = Convert.ChangeType(value, returnType);
Shell\ShellContent.cs (1)
402 var castValue = Convert.ChangeType(value, prop.PropertyType);
Microsoft.ML.Data (2)
DataView\DataViewConstructionUtils.cs (2)
395key = (ulong)Convert.ChangeType(rawKeyValue, typeof(ulong)); 400dst = (TDst)Convert.ChangeType(result, typeof(TDst));
Microsoft.ML.LightGbm (1)
LightGbmTrainerBase.cs (1)
449field.SetValue(LightGbmTrainerOptions, Convert.ChangeType(modelParameters[lightGbmName], field.FieldType));
Microsoft.VisualBasic.Core (2)
Microsoft\VisualBasic\CompilerServices\ConversionResolution.vb (2)
145o1 = Convert.ChangeType(o1, Type1) 146o2 = Convert.ChangeType(o2, Type2)
System.Private.Xml (2)
System\Xml\Serialization\XmlSerializationWriter.cs (2)
4217WriteValue(type != null ? Convert.ChangeType(value, type) : value); 4225WriteValue(type != null ? Convert.ChangeType(value, type) : value);
System.Reflection.Emit (1)
System\Reflection\Emit\ModuleBuilderImpl.cs (1)
896defaultValue = Convert.ChangeType(defaultValue, type.GetEnumUnderlyingType());
System.Xaml.Tests (1)
System\Windows\Markup\ValueSerializerTests.cs (1)
480return Convert.ChangeType(value, destinationType)!;