82 references to CanConvertFrom
BinaryFormatTests (4)
FormatTests\FormattedObject\BinaryFormattedTypes.cs (4)
24converter.CanConvertFrom(typeof(string)) && converter.CanConvertTo(typeof(string)), 27converter.CanConvertFrom(typeof(byte[])) && converter.CanConvertTo(typeof(byte[])), 46(converter.CanConvertFrom(typeof(string)) && converter.CanConvertTo(typeof(string))) 47|| (converter.CanConvertFrom(typeof(byte[])) && converter.CanConvertTo(typeof(byte[]))),
Microsoft.AspNetCore.Components (1)
BindConverter.cs (1)
2044if (typeConverter == null || !typeConverter.CanConvertFrom(typeof(string)))
Microsoft.AspNetCore.Http.Abstractions.Tests (3)
PathStringTests.cs (3)
296Assert.True(converter.CanConvertFrom(typeof(string))); 297Assert.False(converter.CanConvertFrom(typeof(int))); 298Assert.False(converter.CanConvertFrom(typeof(bool)));
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\ModelMetadata.cs (1)
777IsConvertibleType = TypeDescriptor.GetConverter(ModelType).CanConvertFrom(typeof(string));
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\ModelBindingHelper.cs (1)
693var canConvertFrom = converter.CanConvertFrom(value.GetType());
Microsoft.Extensions.Configuration.Binder (1)
ConfigurationBinder.cs (1)
941if (converter.CanConvertFrom(typeof(string)))
PresentationCore.Tests (6)
BinaryFormat\BinaryFormattedTypes.cs (4)
25converter.CanConvertFrom(typeof(string)) && converter.CanConvertTo(typeof(string)), 28converter.CanConvertFrom(typeof(byte[])) && converter.CanConvertTo(typeof(byte[])), 47(converter.CanConvertFrom(typeof(string)) && converter.CanConvertTo(typeof(string))) 48|| (converter.CanConvertFrom(typeof(byte[])) && converter.CanConvertTo(typeof(byte[]))),
TestUtilities\BinaryFormatTestExtensions.cs (2)
60return !((converter.CanConvertFrom(typeof(string)) && converter.CanConvertTo(typeof(string))) 61|| (converter.CanConvertFrom(typeof(byte[])) && converter.CanConvertTo(typeof(byte[]))));
PresentationFramework (7)
MS\Internal\Data\DefaultValueConverter.cs (2)
155canConvertFrom = (typeConverter != null) ? typeConverter.CanConvertFrom(targetType) : false; 167canConvertFrom = (typeConverter != null) ? typeConverter.CanConvertFrom(sourceType) : false;
MS\Internal\Data\PropertyPathWorker.cs (1)
1409if (tc != null && tc.CanConvertFrom(typeof(string)))
System\Windows\Data\BindingExpressionBase.cs (1)
2198if (converter != null && converter.CanConvertFrom(value.GetType()))
System\Windows\PropertyPath.cs (1)
788if (tc != null && tc.CanConvertFrom(typeof(string)))
System\Windows\PropertyPathConverter.cs (1)
274if (converter.CanConvertTo(typeof(string)) && converter.CanConvertFrom(typeof(string)))
System\Windows\StyleHelper.cs (1)
5915if (typeConverter != null && typeConverter.CanConvertFrom(typeof(String)))
System.Configuration.ConfigurationManager (5)
System\Configuration\ApplicationSettingsBase.cs (1)
519if (tc.CanConvertTo(typeof(string)) && tc.CanConvertFrom(typeof(string)))
System\Configuration\ConfigurationProperty.cs (2)
280if (!Converter.CanConvertFrom(value.GetType())) 401!_converter.CanConvertFrom(typeof(string)) ||
System\Configuration\SettingsPropertyValue.cs (2)
209if (converter != null && converter.CanConvertTo(typeof(string)) && converter.CanConvertFrom(typeof(string))) 262if (converter != null && converter.CanConvertTo(typeof(string)) && converter.CanConvertFrom(typeof(string)))
System.Data.Common (2)
System\Data\XMLSchema.cs (2)
50if (converter.CanConvertFrom(typeof(string))) 297if (converter.CanConvertFrom(typeof(string)))
System.Drawing.Common.Tests (7)
System\Drawing\IconConverterTests.cs (2)
37Assert.True(_icoConv.CanConvertFrom(typeof(byte[])), "byte[] (no context)"); 50Assert.True(_icoConvFrmTD.CanConvertFrom(typeof(byte[])), "TD byte[] (no context)");
System\Drawing\ImageConverterTests.cs (3)
61Assert.True(_imgConv.CanConvertFrom(typeof(byte[])), "byte[] (no context)"); 64Assert.True(_imgConv.CanConvertFrom(typeof(Icon)), "Icon (no context)"); 76Assert.True(_imgConvFrmTD.CanConvertFrom(typeof(byte[])), "TD byte[] (no context)");
System\Drawing\ImageFormatConverterTests.cs (2)
29Assert.True(_imgFmtConv.CanConvertFrom(typeof(string)), "string (no context)"); 36Assert.True(_imgFmtConvFrmTD.CanConvertFrom(typeof(string)), "TD string (no context)");
System.Windows.Forms (19)
System\Resources\ResXDataNode.cs (4)
252if (converter.CanConvertTo(typeof(string)) && converter.CanConvertFrom(typeof(string))) 266if (converter.CanConvertTo(typeof(byte[])) && converter.CanConvertFrom(typeof(byte[]))) 364if (!converter.CanConvertFrom(typeof(string))) 404&& converter.CanConvertFrom(typeof(byte[]))
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (6)
987if ((converter.CanConvertTo(typeof(string)) && converter.CanConvertFrom(typeof(string))) 988|| (converter.CanConvertTo(typeof(byte[])) && converter.CanConvertFrom(typeof(byte)))) 1184if (converter.CanConvertFrom(typeof(string))) 1188else if (converter.CanConvertFrom(typeof(byte[]))) 1562if (converter.CanConvertFrom(typeof(string))) 1566else if (converter.CanConvertFrom(typeof(byte[])))
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (3)
917else if (typeof(Image).IsAssignableFrom(type) || imageTypeConverter.CanConvertFrom(type)) 944if (!imageTypeConverter.CanConvertFrom(_props[i].PropertyType)) 1475if (boundColumnConverter is not null && boundColumnConverter.CanConvertFrom(valueType))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.cs (1)
159if (converter.CanConvertTo(typeof(string)) && converter.CanConvertFrom(typeof(string)))
System\Windows\Forms\Internal\Formatter.cs (5)
166if (targetConverter is not null && targetConverter != targetTypeTypeConverter && targetConverter.CanConvertFrom(sourceType)) 211else if (targetConverter is not null && targetConverter.CanConvertFrom(sourceType)) 311if (targetConverter is not null && targetTypeTypeConverter != targetConverter && targetConverter.CanConvertFrom(sourceType)) 346if (targetConverter is not null && targetConverter.CanConvertFrom(s_booleanType)) 369if (targetConverter is not null && targetConverter.CanConvertFrom(sourceType))
System.Windows.Forms.Design (6)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (2)
734if (!imageTypeConverter.CanConvertFrom(propertyDescriptor.PropertyType)) 830else if (typeof(Image).IsAssignableFrom(type) || imageTypeConverter.CanConvertFrom(type))
System\Windows\Forms\Design\DataGridViewDesigner.cs (4)
435if (!imageTypeConverter.CanConvertFrom(dataFieldProperty.PropertyType)) 496if (!imageTypeConverter.CanConvertFrom(dataFieldProperty.PropertyType)) 634if (imageTypeConverter.CanConvertFrom(propType)) 647else if (typeof(Image).IsAssignableFrom(propType) || imageTypeConverter.CanConvertFrom(propType))
System.Windows.Forms.Primitives.TestUtilities (2)
System\Windows\Forms\BinaryFormat\BinaryFormatTestExtensions.cs (2)
64return !((converter.CanConvertFrom(typeof(string)) && converter.CanConvertTo(typeof(string))) 65|| (converter.CanConvertFrom(typeof(byte[])) && converter.CanConvertTo(typeof(byte[]))));
System.Windows.Forms.Tests (11)
System\Windows\Forms\ColumnHeaderConverterTests.cs (1)
21Assert.Equal(expected, converter.CanConvertFrom(sourceType));
System\Windows\Forms\CursorConverterTests.cs (1)
21Assert.Equal(expected, converter.CanConvertFrom(sourceType));
System\Windows\Forms\Layout\TableLayoutSettingsTypeConverterTests.cs (1)
24Assert.Equal(expected, converter.CanConvertFrom(sourceType));
System\Windows\Forms\LinkAreaConverterTests.cs (1)
21Assert.Equal(expected, converter.CanConvertFrom(sourceType));
System\Windows\Forms\LinkConverterTests.cs (1)
19Assert.Equal(expected, converter.CanConvertFrom(sourceType));
System\Windows\Forms\ListViewGroupConverterTests.cs (1)
23Assert.Equal(expected, converter.CanConvertFrom(sourceType));
System\Windows\Forms\ListViewItemConverterTests.cs (1)
23Assert.Equal(expected, converter.CanConvertFrom(sourceType));
System\Windows\Forms\ListViewSubItemConverterTests.cs (1)
23Assert.Equal(expected, converter.CanConvertFrom(sourceType));
System\Windows\Forms\OpacityConverterTests.cs (1)
20Assert.Equal(expected, converter.CanConvertFrom(sourceType));
System\Windows\Forms\PaddingConverterTests.cs (1)
22Assert.Equal(expected, converter.CanConvertFrom(sourceType));
System\Windows\Forms\TableLayoutPanelCellPositionTests.cs (1)
107Assert.Equal(expected, converter.CanConvertFrom(sourceType));
System.Xaml (5)
System\Windows\Markup\ValueSerializer.cs (2)
144else if (converter.CanConvertTo(typeof(string)) && converter.CanConvertFrom(typeof(string)) && 179if (converter != null && converter.CanConvertTo(typeof(string)) && converter.CanConvertFrom(typeof(string)) &&
System\Xaml\Runtime\ClrObjectRuntime.cs (1)
641if (typeConverter.CanConvertFrom(value.GetType()))
System\Xaml\Schema\BuiltInValueConverter.cs (2)
176!stdConverter.CanConvertFrom(typeof(string)) || !stdConverter.CanConvertFrom(typeof(Uri)) ||
System.Xaml.Tests (1)
System\Windows\Markup\NameReferenceConverterTests.cs (1)
23Assert.Equal(expected, converter.CanConvertFrom(type!));