7 overrides of PropertyType
PresentationFramework (1)
MS\Internal\Data\IndexerPropertyInfo.cs (1)
70public override Type PropertyType
System.Private.CoreLib (2)
src\System\Reflection\Emit\RuntimePropertyBuilder.cs (1)
161public override Type PropertyType => m_returnType;
src\System\Reflection\RuntimePropertyInfo.cs (1)
249public override Type PropertyType => Signature.ReturnType;
System.Reflection.Context (2)
System\Reflection\Context\Delegation\DelegatingPropertyInfo.cs (1)
54public override Type PropertyType
System\Reflection\Context\Virtual\VirtualPropertyBase.cs (1)
52public sealed override Type PropertyType
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\Properties\RoProperty.cs (1)
54public sealed override Type PropertyType
System.Xaml.Tests (1)
System\Xaml\XamlMemberTests.cs (1)
2386public override Type PropertyType => DelegatingProperty.PropertyType;
444 references to PropertyType
Aspire.Confluent.Kafka (1)
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\Shared\PropertyFetcher.AOT.cs (1)
106if (propertyInfo == null || !typeof(T).IsAssignableFrom(propertyInfo.PropertyType))
Aspire.Microsoft.Data.SqlClient (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (1)
102if (propertyInfo == null || !typeof(T).IsAssignableFrom(propertyInfo.PropertyType))
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (1)
102if (propertyInfo == null || !typeof(T).IsAssignableFrom(propertyInfo.PropertyType))
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Shared\PropertyFetcher.AOT.cs (1)
108if (propertyInfo == null || !typeof(T).IsAssignableFrom(propertyInfo.PropertyType))
dotnet-svcutil-lib (24)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (2)
792memberType = property.PropertyType; 829memberType = property.PropertyType;
FrameworkFork\Microsoft.Xml\Xml\Serialization\Models.cs (5)
219TypeDesc typeDesc = ModelScope.TypeScope.GetTypeDesc(propertyInfo.PropertyType, propertyInfo, true, false); 223CheckSupportedMember(typeDesc, propertyInfo, propertyInfo.PropertyType); 224return new FieldModel(propertyInfo, propertyInfo.PropertyType, typeDesc); 305if (_checkSpecified != SpecifiedAccessor.None && specifiedProperty.PropertyType != typeof(bool)) 307throw new InvalidOperationException(string.Format(ResXml.XmlInvalidSpecifiedType, specifiedProperty.Name, specifiedProperty.PropertyType.FullName, typeof(bool).FullName));
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (1)
175((FieldInfo)MemberInfo).FieldType : ((PropertyInfo)MemberInfo).PropertyType;
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (4)
1319Type currentType = (p == null ? typeof(object) : p.PropertyType); 1383MethodInfo addMethod = type.GetMethod("Add", new Type[] { indexer.PropertyType }); 1386throw new InvalidOperationException(string.Format(ResXml.XmlNoAddMethod, type.FullName, indexer.PropertyType, "ICollection")); 1392return GetDefaultIndexer(type, memberInfo).PropertyType;
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (1)
577Type memType = memInfo is FieldInfo ? ((FieldInfo)memInfo).FieldType : ((PropertyInfo)memInfo).PropertyType;
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (1)
4067_writer.Write(GetStringForTypeof(CodeIdentifier.GetCSharpName(defaultIndexer.PropertyType), elementUseReflection));
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (1)
2614initValue.ILG.ConvertValue(propInfo.PropertyType, localA.LocalType);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (1)
709memberType = property.PropertyType;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataMember.cs (3)
263return ((PropertyInfo)MemberInfo).PropertyType; 325return DataContract.MethodRequiresMemberAccess(getMethod) || !DataContract.IsTypeVisible(property.PropertyType); 350return DataContract.MethodRequiresMemberAccess(setMethod) || !DataContract.IsTypeVisible(property.PropertyType);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (4)
373DataContract propDataContract = context.GetDataContract(prop.PropertyType); 374if (prop.GetValue(value) != null && propDataContract != null && !TryCheckIfNoCountIDictionary(prop.PropertyType, prop.GetValue(value))) 376if (!TryWritePrimitive(prop.PropertyType, prop.GetValue(value), writer, context)) 380context.SerializeWithoutXsiType(propDataContract, writer, prop.GetValue(value), prop.PropertyType.TypeHandle);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\TypeLoader.cs (1)
1361memberType = ((PropertyInfo)memberInfo).PropertyType;
Infrastructure.Common (1)
xunit\ConditionAttribute.cs (1)
117if (pi != null && pi.PropertyType == typeof(bool) && pi.GetMethod != null && pi.GetMethod.IsStatic && pi.GetMethod.GetParameters().Length == 0)
Metrics (5)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (5)
72if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) 110.SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType)); 123property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo()) 125: Expression.Convert(valueParameter, property.PropertyType); 235VerifyResultTypeCompatibility<TProperty>(propertyInfo.PropertyType);
Metrics.Legacy (5)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (5)
72if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) 110.SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType)); 123property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo()) 125: Expression.Convert(valueParameter, property.PropertyType); 235VerifyResultTypeCompatibility<TProperty>(propertyInfo.PropertyType);
Microsoft.AspNetCore.App.Analyzers.Test (1)
Http\HeaderDictionaryIndexerAnalyzerTests.cs (1)
165.Where(p => p.CanWrite && p.CanRead && p.PropertyType == typeof(StringValues) && p.GetIndexParameters().Length == 0)
Microsoft.AspNetCore.Components (8)
CascadingParameterState.cs (1)
130prop.PropertyType));
ComponentFactory.cs (1)
113injectables.Add((property.Name, property.PropertyType, new PropertySetter(type, property), injectAttribute.Key));
PersistentState\PersistentServicesRegistry.cs (1)
185keys.Add(new(key, propertyInfo.PropertyType));
Reflection\ComponentProperties.cs (1)
342if (!propertyInfo.PropertyType.IsAssignableFrom(typeof(Dictionary<string, object>)))
Reflection\PropertyGetter.cs (2)
35getMethod.CreateDelegate(typeof(Func<,>).MakeGenericType(targetType, property.PropertyType)); 37CallPropertyGetterOpenGenericMethod.MakeGenericMethod(targetType, property.PropertyType);
Reflection\PropertySetter.cs (2)
35setMethod.CreateDelegate(typeof(Action<,>).MakeGenericType(targetType, property.PropertyType)); 37CallPropertySetterOpenGenericMethod.MakeGenericMethod(targetType, property.PropertyType);
Microsoft.AspNetCore.Components.Endpoints (4)
FormMapping\Metadata\FormDataMetadataFactory.cs (3)
190Log.CandidateProperty(_logger, propertyHelper.Name, property.PropertyType); 224var propertyTypeInfo = GetOrCreateMetadataFor(property.PropertyType, options); 227Log.PropertyTypeNotSupported(_logger, type, property.Name, property.PropertyType);
src\Shared\PropertyHelper\PropertyHelper.cs (1)
551!property.PropertyType.IsByRefLike &&
Microsoft.AspNetCore.Components.Web (1)
JSComponents\JSComponentInterop.cs (1)
208ParameterInfoByName.Add(propertyInfo.Name, new(propertyInfo.PropertyType));
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\GrpcJsonTranscodingDescriptionProvider.cs (1)
129? ModelMetadataIdentity.ForProperty(bodyDescriptor.PropertyInfo, bodyDescriptor.PropertyInfo.PropertyType, bodyDescriptor.PropertyInfo.DeclaringType!)
Microsoft.AspNetCore.Http.Abstractions (1)
src\Shared\PropertyHelper\PropertyHelper.cs (1)
551!property.PropertyType.IsByRefLike &&
Microsoft.AspNetCore.Http.Extensions (5)
src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (3)
190Log.CandidateProperty(_logger, propertyHelper.Name, property.PropertyType); 224var propertyTypeInfo = GetOrCreateMetadataFor(property.PropertyType, options); 227Log.PropertyTypeNotSupported(_logger, type, property.Name, property.PropertyType);
src\Shared\ParameterBindingMethodCache.cs (1)
328lookupTable.Add(new ParameterLookupKey(properties[i].Name, properties[i].PropertyType), properties[i]);
src\Shared\PropertyAsParameterInfo.cs (1)
30ClassImpl = propertyInfo.PropertyType;
Microsoft.AspNetCore.Http.Extensions.Tests (2)
PropertyAsParameterInfoTests.cs (2)
19Assert.Equal(propertyInfo.PropertyType, parameterInfo.ParameterType); 32Assert.Equal(propertyInfo.PropertyType, parameterInfo.ParameterType);
Microsoft.AspNetCore.Http.Tests (3)
DefaultHttpContextTests.cs (3)
367.Where(p => p.PropertyType.GetTypeInfo().IsInterface); 395if (property.PropertyType == typeof(IFeatureCollection)) 404Assert.Same(features[property.PropertyType], v);
Microsoft.AspNetCore.Identity.EntityFrameworkCore (4)
IdentityUserContext.cs (4)
188if (p.PropertyType != typeof(string)) 236if (p.PropertyType != typeof(string)) 281if (p.PropertyType != typeof(string)) 329if (p.PropertyType != typeof(string))
Microsoft.AspNetCore.InternalTesting (1)
xunit\ConditionalTheoryDiscoverer.cs (1)
56if (property != null && property.PropertyType.Equals(typeof(string)))
Microsoft.AspNetCore.Mvc.Abstractions (1)
src\Shared\ParameterBindingMethodCache.cs (1)
328lookupTable.Add(new ParameterLookupKey(properties[i].Name, properties[i].PropertyType), properties[i]);
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
src\Shared\PropertyAsParameterInfo.cs (1)
30ClassImpl = propertyInfo.PropertyType;
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
2348ParameterType = property.PropertyType,
Microsoft.AspNetCore.Mvc.Core (8)
ApplicationModels\ControllerActionDescriptorBuilder.cs (1)
93ParameterType = propertyModel.PropertyInfo.PropertyType,
ApplicationModels\PropertyModel.cs (1)
24: base(propertyInfo.PropertyType, attributes)
ModelBinding\Metadata\DefaultBindingMetadataProvider.cs (1)
129property.Property.PropertyType == parameter.ParameterType);
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (1)
344propertyHelper.Property.PropertyType,
ModelBinding\Metadata\ModelAttributes.cs (2)
97/// <see cref="TypeAttributes"/> contains attributes retrieved from <see cref="PropertyInfo.PropertyType"/>. 115return GetAttributesForProperty(type, property, property.PropertyType);
ModelBinding\ParameterBinder.cs (1)
260if (modelType != propertyInfo.PropertyType)
src\Shared\PropertyHelper\PropertyHelper.cs (1)
551!property.PropertyType.IsByRefLike &&
Microsoft.AspNetCore.Mvc.Core.Test (33)
ApplicationModels\ActionModelTest.cs (6)
99if (typeof(IEnumerable<object>).IsAssignableFrom(property.PropertyType)) 106else if (typeof(IDictionary<string, string>).IsAssignableFrom(property.PropertyType)) 113else if (typeof(IDictionary<object, object>).IsAssignableFrom(property.PropertyType)) 120else if (property.PropertyType.IsValueType || 121Nullable.GetUnderlyingType(property.PropertyType) != null) 126Assert.NotEqual(value1, Activator.CreateInstance(property.PropertyType));
ApplicationModels\AttributeRouteModelTests.cs (4)
31if (typeof(IEnumerable<object>).IsAssignableFrom(property.PropertyType)) 38else if (property.PropertyType.IsValueType || 39Nullable.GetUnderlyingType(property.PropertyType) != null) 44Assert.NotEqual(value1, Activator.CreateInstance(property.PropertyType));
ApplicationModels\ControllerModelTest.cs (6)
101if (typeof(IEnumerable<object>).IsAssignableFrom(property.PropertyType)) 108else if (typeof(IDictionary<string, string>).IsAssignableFrom(property.PropertyType)) 115else if (typeof(IDictionary<object, object>).IsAssignableFrom(property.PropertyType)) 122else if (property.PropertyType.IsValueType || 123Nullable.GetUnderlyingType(property.PropertyType) != null) 128Assert.NotEqual(value1, Activator.CreateInstance(property.PropertyType));
ApplicationModels\ParameterModelTest.cs (5)
42if (typeof(IEnumerable<object>).IsAssignableFrom(property.PropertyType)) 49else if (typeof(IDictionary<object, object>).IsAssignableFrom(property.PropertyType)) 56else if (property.PropertyType.GetTypeInfo().IsValueType || 57Nullable.GetUnderlyingType(property.PropertyType) != null) 62Assert.NotEqual(value1, Activator.CreateInstance(property.PropertyType));
ApplicationModels\PropertyModelTest.cs (5)
38if (typeof(IEnumerable<object>).IsAssignableFrom(property.PropertyType)) 45else if (typeof(IDictionary<object, object>).IsAssignableFrom(property.PropertyType)) 52else if (property.PropertyType.GetTypeInfo().IsValueType || 53Nullable.GetUnderlyingType(property.PropertyType) != null) 58Assert.NotEqual(value1, Activator.CreateInstance(property.PropertyType));
ModelBinding\Binders\FormFileModelBinderTest.cs (2)
88propertyInfo.PropertyType); 130propertyInfo.PropertyType);
ModelBinding\Metadata\DefaultModelMetadataTest.cs (1)
1011var modelIdentity = ModelMetadataIdentity.ForProperty(property, property.PropertyType, GetType());
RequestFormLimitsAttributeTest.cs (4)
22.Where(pi => property.Name == pi.Name && pi.PropertyType == property.PropertyType) 43.Where(pi => pi.Name == formOptionsProperty.Name && pi.PropertyType == formOptionsProperty.PropertyType)
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
TestModelMetadataProvider.cs (1)
123var key = ModelMetadataIdentity.ForProperty(property, property.PropertyType, containerType);
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (9)
DataAnnotationsMetadataProviderTest.cs (9)
1232var key = ModelMetadataIdentity.ForProperty(property, property.PropertyType, modelType); 1251var key = ModelMetadataIdentity.ForProperty(property, property.PropertyType, modelType); 1270var key = ModelMetadataIdentity.ForProperty(property, property.PropertyType, modelType); 1291var key = ModelMetadataIdentity.ForProperty(property, property.PropertyType, modelType); 1311var key = ModelMetadataIdentity.ForProperty(property, property.PropertyType, modelType); 1330var key = ModelMetadataIdentity.ForProperty(property, property.PropertyType, modelType); 1349var key = ModelMetadataIdentity.ForProperty(property, property.PropertyType, modelType); 1368var key = ModelMetadataIdentity.ForProperty(property, property.PropertyType, modelType); 1430var key = ModelMetadataIdentity.ForProperty(property.PropertyType, property.Name, modelType);
Microsoft.AspNetCore.Mvc.IntegrationTests (9)
BindPropertyIntegrationTest.cs (1)
194ParameterType = propertyInfo.PropertyType,
ValidationIntegrationTests.cs (4)
2313var modelMetadata = modelMetadataProvider.GetMetadataForProperty(propertyInfo, propertyInfo.PropertyType); 2319ParameterType = propertyInfo.PropertyType, 2367var modelMetadata = modelMetadataProvider.GetMetadataForProperty(propertyInfo, propertyInfo.PropertyType); 2373ParameterType = propertyInfo.PropertyType,
ValidationWithRecordIntegrationTests.cs (4)
2104var modelMetadata = modelMetadataProvider.GetMetadataForProperty(propertyInfo, propertyInfo.PropertyType); 2110ParameterType = propertyInfo.PropertyType, 2155var modelMetadata = modelMetadataProvider.GetMetadataForProperty(propertyInfo, propertyInfo.PropertyType); 2161ParameterType = propertyInfo.PropertyType,
Microsoft.AspNetCore.Mvc.Razor (9)
RazorPageActivator.cs (1)
89modelType = pageType.GetRuntimeProperty(ModelPropertyName)?.PropertyType;
RazorPagePropertyActivator.cs (8)
86var value = serviceProvider.GetRequiredKeyedService(property.PropertyType, key); 92else if (typeof(ViewDataDictionary).IsAssignableFrom(property.PropertyType)) 99else if (property.PropertyType == typeof(IUrlHelper)) 106else if (property.PropertyType == typeof(IJsonHelper)) 110else if (property.PropertyType == typeof(DiagnosticSource)) 114else if (property.PropertyType == typeof(HtmlEncoder)) 118else if (property.PropertyType == typeof(IModelExpressionProvider)) 127var value = serviceProvider.GetRequiredService(property.PropertyType);
Microsoft.AspNetCore.Mvc.RazorPages (4)
ApplicationModels\CompiledPageActionDescriptorBuilder.cs (1)
138ParameterType = propertyModel.PropertyInfo.PropertyType,
ApplicationModels\DefaultPageApplicationModelProvider.cs (2)
84var modelTypeInfo = modelProperty.PropertyType.GetTypeInfo(); 91if (modelProperty.PropertyType.IsDefined(typeof(PageModelAttribute), inherit: true))
ApplicationModels\PagePropertyModel.cs (1)
24: base(propertyInfo.PropertyType, attributes)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Infrastructure\PageActionInvokerProviderTest.cs (1)
475declaredModelTypeInfo = pageTypeInfo.GetProperty("Model")?.PropertyType.GetTypeInfo();
Microsoft.AspNetCore.Mvc.ViewFeatures (3)
Filters\LifecycleProperty.cs (1)
20var propertyType = propertyInfo.PropertyType;
Filters\SaveTempDataPropertyFilterBase.cs (2)
133if (!tempDataSerializer.CanSerializeType(property.PropertyType)) 139TypeNameHelper.GetTypeDisplayName(property.PropertyType));
Microsoft.AspNetCore.OpenApi (2)
src\Shared\ParameterBindingMethodCache.cs (1)
328lookupTable.Add(new ParameterLookupKey(properties[i].Name, properties[i].PropertyType), properties[i]);
src\Shared\PropertyAsParameterInfo.cs (1)
30ClassImpl = propertyInfo.PropertyType;
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentServiceTestsBase.cs (1)
218ParameterType = property.PropertyType,
Microsoft.AspNetCore.Routing (1)
src\Shared\PropertyHelper\PropertyHelper.cs (1)
551!property.PropertyType.IsByRefLike &&
Microsoft.AspNetCore.Routing.Abstractions (1)
src\Shared\PropertyHelper\PropertyHelper.cs (1)
551!property.PropertyType.IsByRefLike &&
Microsoft.AspNetCore.Shared.Tests (11)
PropertyHelperTest.cs (10)
347Assert.Equal(typeof(int), property.Property.PropertyType); 362Assert.Equal(typeof(string), result[0].Property.PropertyType); 364Assert.Equal(typeof(string), result[1].Property.PropertyType); 379Assert.Equal(typeof(Guid), result[0].Property.PropertyType); 381Assert.Equal(typeof(string), result[1].Property.PropertyType); 396Assert.Equal(typeof(int), property.Property.PropertyType); 411Assert.Equal(typeof(string), result[0].Property.PropertyType); 413Assert.Equal(typeof(string), result[1].Property.PropertyType); 428Assert.Equal(typeof(Guid), result[0].Property.PropertyType); 430Assert.Equal(typeof(string), result[1].Property.PropertyType);
src\Shared\PropertyHelper\PropertyHelper.cs (1)
551!property.PropertyType.IsByRefLike &&
Microsoft.Build (3)
Instance\ReflectableTaskPropertyInfo.cs (2)
48propertyInfo.PropertyType, 63propertyInfo.PropertyType,
LoadedType.cs (1)
94Type? pt = props[i].PropertyType;
Microsoft.Build.Engine.UnitTests (2)
BackEnd\TaskBuilderTestTask.cs (1)
1310infos[i].PropertyType,
BackEnd\TranslationHelpers.cs (1)
130if (!IsSimpleType(prop.PropertyType))
Microsoft.Build.Tasks.Core (2)
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (1)
191i.PropertyType,
WriteCodeFragment.cs (1)
458attributeType.Value?.GetProperty(parameter.Name)?.PropertyType,
Microsoft.CodeAnalysis.Analyzers (5)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (5)
72if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) 110.SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType)); 123property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo()) 125: Expression.Convert(valueParameter, property.PropertyType); 235VerifyResultTypeCompatibility<TProperty>(propertyInfo.PropertyType);
Microsoft.CodeAnalysis.AnalyzerUtilities (5)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (5)
72if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) 110.SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType)); 123property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo()) 125: Expression.Convert(valueParameter, property.PropertyType); 235VerifyResultTypeCompatibility<TProperty>(propertyInfo.PropertyType);
Microsoft.CodeAnalysis.BannedApiAnalyzers (5)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (5)
72if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) 110.SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType)); 123property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo()) 125: Expression.Convert(valueParameter, property.PropertyType); 235VerifyResultTypeCompatibility<TProperty>(propertyInfo.PropertyType);
Microsoft.CodeAnalysis.EditorFeatures (2)
Lightup\LightupHelpers.cs (2)
81if (!typeof(TResult).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) 83throw new InvalidOperationException($"Property '{property}' produces a value of type '{property.PropertyType}', which is not assignable to type '{typeof(TResult)}'");
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (5)
Options\GlobalOptionsTests.cs (5)
121if (OptionDefinition.IsSupportedOptionType(property.PropertyType)) 133var propertyType = Nullable.GetUnderlyingType(property.PropertyType) ?? property.PropertyType; 135if (propertyType != property.PropertyType) 137var getValueOrDefault = property.PropertyType.GetMethod("GetValueOrDefault", []);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
Debugger\Engine\DkmClrValue.cs (1)
324DkmClrType.Create(appDomain, (TypeImpl)((propertyValue == null) ? property.PropertyType : propertyValue.GetType())),
Debugger\MemberInfo\PropertyInfoImpl.cs (1)
77get { return (TypeImpl)this.Property.PropertyType; }
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (1)
RazorPredefinedProviderNameTests.cs (1)
59.Where(property => property.PropertyType == typeof(string))
Microsoft.CodeAnalysis.PublicApiAnalyzers (5)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (5)
72if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) 110.SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType)); 123property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo()) 125: Expression.Convert(valueParameter, property.PropertyType); 235VerifyResultTypeCompatibility<TProperty>(propertyInfo.PropertyType);
Microsoft.CodeAnalysis.ResxSourceGenerator (5)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (5)
72if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) 110.SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType)); 123property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo()) 125: Expression.Convert(valueParameter, property.PropertyType); 235VerifyResultTypeCompatibility<TProperty>(propertyInfo.PropertyType);
Microsoft.CodeAnalysis.Test.Utilities (5)
Platform\Custom\MetadataSignatureHelper.cs (1)
566AppendType(property.PropertyType, sb);
Syntax\NodeHelpers.cs (4)
183var typeObject = prop.PropertyType; 208return new NodeInfo.FieldInfo(prop.Name, prop.PropertyType, prop.GetValue(node, null)); 214return new NodeInfo.FieldInfo(prop.Name, prop.PropertyType, prop.GetValue(token, null)); 220return new NodeInfo.FieldInfo(prop.Name, prop.PropertyType, prop.GetValue(trivia, null));
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Remote\ServiceDescriptorTests.cs (1)
109AddTypeRecursive(property.PropertyType, type);
Microsoft.CSharp (3)
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (2)
74&& prop1.PropertyType.IsGenericallyEquivalentTo(prop2.PropertyType, prop1, prop2)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (1)
1254prop.RetType = GetCTypeFromType(property.PropertyType);
Microsoft.DotNet.XUnitExtensions (1)
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\ConditionalTestDiscoverer.cs (1)
160if (pi != null && pi.PropertyType == typeof(bool) && pi.GetMethod != null && pi.GetMethod.IsStatic && pi.GetMethod.GetParameters().Length == 0)
Microsoft.DotNet.XUnitV3Extensions (1)
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\ConditionalTestDiscoverer.cs (1)
160if (pi != null && pi.PropertyType == typeof(bool) && pi.GetMethod != null && pi.GetMethod.IsStatic && pi.GetMethod.GetParameters().Length == 0)
Microsoft.Extensions.AI.Abstractions.Tests (3)
Utilities\AIJsonUtilitiesTests.cs (3)
97case null when property.PropertyType == typeof(Func<AIJsonSchemaCreateContext, JsonNode, JsonNode>): 103case null when property.PropertyType == typeof(Func<ParameterInfo, bool>): 110Assert.Fail($"Unexpected property type: {property.PropertyType}");
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultJsonSerializerFactory.cs (1)
103if (IsFieldOnlyType(prop.PropertyType, ref state) == FieldOnlyResult.FieldOnly)
Microsoft.Extensions.Compliance.Redaction (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
134if (property != null && property.CanRead && property.PropertyType == typeof(int))
Microsoft.Extensions.Configuration.Binder (1)
ConfigurationBinder.cs (1)
305property.PropertyType,
Microsoft.Extensions.Diagnostics.Probes (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
134if (property != null && property.CanRead && property.PropertyType == typeof(int))
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
134if (property != null && property.CanRead && property.PropertyType == typeof(int))
Microsoft.Extensions.Http.Resilience (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
134if (property != null && property.CanRead && property.PropertyType == typeof(int))
Microsoft.Extensions.Telemetry (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
134if (property != null && property.CanRead && property.PropertyType == typeof(int))
Microsoft.Maui.Controls (4)
BindingExpression.cs (1)
392 var propertyType = property.PropertyType;
PlatformBindingHelpers.cs (1)
45 var propertyType = targetPropertyInfo?.PropertyType;
Shell\ShellContent.cs (2)
393 if (prop.PropertyType == typeof(string)) 402 var castValue = Convert.ChangeType(value, prop.PropertyType);
Microsoft.Maui.Controls.Xaml (7)
ApplyPropertiesVisitor.cs (2)
671 object convertedValue = value.ConvertTo(propertyInfo.PropertyType, () => propertyInfo, serviceProvider, out exception); 672 if (exception != null || (convertedValue != null && !propertyInfo.PropertyType.IsInstanceOfType(convertedValue)))
MarkupExtensionParser.cs (1)
99 value = strValue.ConvertTo(markupExtension.GetType().GetRuntimeProperty(prop).PropertyType,
MarkupExtensions\AppThemeBindingExtension.cs (1)
72 ?? pi?.PropertyType
MarkupExtensions\OnIdiomExtension.cs (1)
59 ?? pi?.PropertyType
MarkupExtensions\OnPlatformExtension.cs (1)
69 ?? pi?.PropertyType
MarkupExtensions\StaticResourceExtension.cs (1)
43 var propertyType = bp?.ReturnType ?? pi?.PropertyType;
Microsoft.ML.AutoML.Tests (1)
Utils\TaskAgnosticIterationResult.cs (1)
81var propertiesToReport = metric.GetType().GetProperties().Where(p => p.PropertyType == typeof(double));
Microsoft.ML.Data (16)
Data\SchemaDefinition.cs (2)
189ectx.Check(cursorChannelAttrPropertyInfo.PropertyType == typeof(IChannel), 367if (propertyInfo.PropertyType == typeof(IChannel))
DataLoadSave\Database\DatabaseLoader.cs (3)
155if (!InternalDataKindExtensions.TryGetDataKind(property.PropertyType.IsArray ? property.PropertyType.GetElementType() : property.PropertyType, out dk))
DataLoadSave\Text\TextLoader.cs (3)
1618if (!InternalDataKindExtensions.TryGetDataKind(property.PropertyType.IsArray ? property.PropertyType.GetElementType() : property.PropertyType, out dk))
DataView\InternalSchemaDefinition.cs (3)
32public Type FieldOrPropertyType => (MemberInfo is FieldInfo) ? (MemberInfo as FieldInfo).FieldType : (MemberInfo as PropertyInfo).PropertyType; 154GetVectorAndItemType(propertyInfo.Name, propertyInfo.PropertyType, propertyInfo.GetCustomAttributes(), out isVector, out itemType); 246(memberInfo is PropertyInfo && (memberInfo as PropertyInfo).PropertyType == typeof(IChannel)))
DataView\TypedCursor.cs (2)
239InternalSchemaDefinition.GetMappedType(propertyInfo.PropertyType, out actualType, out isVector); 292(memberInfo is PropertyInfo && (memberInfo as PropertyInfo).PropertyType == typeof(IChannel)))
Utils\ApiUtils.cs (3)
78Type propertyType = propertyInfo.PropertyType; 123il.Emit(assignmentOpCode, propertyInfo.PropertyType); 146Type propertyType = propertyInfo.PropertyType;
Microsoft.ML.EntryPoints (1)
JsonUtils\JsonManifestUtils.cs (1)
71var type = ExtractOptionalOrNullableType(fieldInfo.PropertyType);
Microsoft.ML.IntegrationTests (4)
Common.cs (4)
33if (!property.PropertyType.IsArray) 34types[property.Name] = property.PropertyType; 39Type[] typeArgs = { property.PropertyType.GetElementType() }; 40Activator.CreateInstance(property.PropertyType.GetElementType());
Microsoft.ML.InternalCodeAnalyzer (1)
InstanceInitializerAnalyzer.cs (1)
54if (hasInitProp?.PropertyType != typeof(bool))
Microsoft.ML.SearchSpace (3)
Parameter.cs (1)
202var p = Parameter.FromObject(pValue, property.PropertyType);
SearchSpace.cs (2)
260CheckOptionType(attributes.First(), property.Name, property.PropertyType); 276NestOptionAttribute nest => GetSearchSpaceOptionFromType(property.PropertyType),
Microsoft.ML.Tests (2)
CollectionsDataViewTest.cs (2)
79if (property.PropertyType.IsArray) 86if (!CompareObjectValues(xvalue, yvalue, property.PropertyType))
Microsoft.TestUtilities (1)
XUnit\ConditionalTheoryDiscoverer.cs (1)
59if (property != null && property.PropertyType.Equals(typeof(string)))
Microsoft.VisualBasic.Core (1)
Microsoft\VisualBasic\CompilerServices\Symbols.vb (1)
897returnType = propertyBlock.PropertyType
MSBuild (3)
LoadedType.cs (1)
94Type? pt = props[i].PropertyType;
ReflectableTaskPropertyInfo.cs (2)
48propertyInfo.PropertyType, 63propertyInfo.PropertyType,
PresentationBuildTasks (5)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (4)
3875return IsAssignableToIXmlSerializable(pi.PropertyType); 4593if (ReflectionHelper.GetMscorlibType(typeof(IList)).IsAssignableFrom(pi.PropertyType)) 4600else if (!IsAssignableToIXmlSerializable(pi.PropertyType)) 4969if( propertyInfo.PropertyType.IsAssignableFrom(ReflectionHelper.GetMscorlibType(typeof(string))) )
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (1)
2049propertyType = propertyInfo.PropertyType;
PresentationCore (3)
System\Windows\Diagnostics\XamlSourceInfoHelper.cs (3)
82if (s_sourceBamlUriProperty == null || s_sourceBamlUriProperty.PropertyType != typeof(Uri) || 83s_elementLineNumberProperty == null || s_elementLineNumberProperty.PropertyType != typeof(int) || 84s_elementLinePositionProperty == null || s_elementLinePositionProperty.PropertyType != typeof(int))
PresentationFramework (11)
MS\Internal\Data\PropertyPathWorker.cs (2)
1147sourceType = pi1.PropertyType; 1203sourceType = pi.PropertyType;
MS\Internal\Helper.cs (1)
644memberType = propertyInfo.PropertyType;
MS\Internal\WindowsRuntime\Generated\WinRT\Projections.cs (1)
186defaultInterface = runtimeClass.GetProperty(attr.DefaultInterfaceProperty, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly).PropertyType;
System\Windows\Data\CollectionView.cs (1)
1488list.Add(new ItemPropertyInfo(pi.Name, pi.PropertyType, pi));
System\Windows\Markup\BamlRecordReader.cs (4)
1992if (typeof(IXmlSerializable).IsAssignableFrom(pi.PropertyType)) 3663propertyType = propertyInfo.PropertyType; 3800value = OptionallyMakeNullable(propertyInfo.PropertyType, value, propertyInfo.Name); 5810return this.PropertyInfo.PropertyType;
System\Windows\Markup\BamlRecords.cs (1)
4663validType = propInfo.PropertyType;
System\Windows\Markup\XamlTypeMapper.cs (1)
2049propertyType = propertyInfo.PropertyType;
ReachFramework (2)
Serialization\Manager\MetroSerializationManager.cs (1)
846Debug.Assert(propertyInfo.PropertyType == dependencyProperty.PropertyType,
Serialization\Manager\ReachSerializationCacheItems.cs (1)
125TypeCacheItem typeCacheItem = serializersCacheManager.GetTypeCacheItem(propertyInfo.PropertyType);
Roslyn.Diagnostics.Analyzers (5)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (5)
72if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) 110.SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType)); 123property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo()) 125: Expression.Convert(valueParameter, property.PropertyType); 235VerifyResultTypeCompatibility<TProperty>(propertyInfo.PropertyType);
Shared (1)
Data.Validation\LengthAttribute.cs (1)
134if (property != null && property.CanRead && property.PropertyType == typeof(int))
System.ComponentModel.Annotations (3)
System\ComponentModel\DataAnnotations\LocalizableString.cs (1)
132if (property == null || property.PropertyType != typeof(string))
System\ComponentModel\DataAnnotations\MaxLengthAttribute.cs (1)
128if (property != null && property.CanRead && property.PropertyType == typeof(int))
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (1)
288if (property.PropertyType != typeof(string))
System.ComponentModel.Composition (9)
System\ComponentModel\Composition\Hosting\CompositionServices.cs (3)
33return ((PropertyInfo)member).PropertyType; 313if (!dictionary.TryContributeMetadataValue(pi.Name, value, pi.PropertyType, allowsMultiple)) 487return properties.Select(property => new KeyValuePair<string, Type>(property.Name, property.PropertyType));
System\ComponentModel\Composition\MetadataViewGenerator.cs (6)
216Type[] propertyTypeArguments = new Type[] { propertyInfo.PropertyType }; 229propertyInfo.PropertyType, 236propertyInfo.PropertyType, 289proxyCtorIL.AddItemToLocalDictionary(exceptionData, MetadataItemTargetType, propertyInfo.PropertyType); 299proxyCtorIL.AddItemToLocalDictionary(exceptionData, MetadataItemTargetType, propertyInfo.PropertyType); 320propertyInfo.PropertyType,
System.ComponentModel.Composition.Registration (3)
System\ComponentModel\Composition\Registration\PartBuilder.cs (3)
424PropertyInfo declaredPi = pi.DeclaringType.UnderlyingSystemType.GetProperty(pi.Name, pi.PropertyType); 456importBuilder.BuildAttributes(declaredPi.PropertyType, ref attributes); 496exportBuilder.BuildAttributes(declaredPi.PropertyType, ref attributes);
System.ComponentModel.TypeConverter (3)
src\libraries\Common\src\System\Drawing\ColorTable.cs (1)
28if (prop.PropertyType == typeof(Color))
System\ComponentModel\ComponentResourceManager.cs (1)
199if (prop != null && prop.CanWrite && (kvp.Value == null || prop.PropertyType.IsInstanceOfType(kvp.Value)))
System\ComponentModel\ReflectTypeDescriptionProvider.cs (1)
1393propertyInfo.PropertyType,
System.Composition.Convention (3)
System\Composition\Convention\PartConventionBuilder.cs (3)
310Predicate<PropertyInfo> typedFilter = pi => pi.PropertyType.Equals(typeof(T)) && (propertyFilter == null || propertyFilter(pi)); 699importBuilder.BuildAttributes(pi.PropertyType, ref attributes); 741exportBuilder.BuildAttributes(pi.PropertyType, ref attributes);
System.Composition.Hosting (1)
System\Composition\Hosting\Providers\Metadata\MetadataViewProvider.cs (1)
59var m = s_getMetadataValueMethod.MakeGenericMethod(prop.PropertyType);
System.Composition.TypedParts (8)
System\Composition\CompositionContextExtensions.cs (1)
57if (ContractHelpers.TryGetExplicitImportInfo(pi.PropertyType, conventions.GetDeclaredAttributes(pi.DeclaringType, pi), site, out importInfo))
System\Composition\TypedParts\ActivationFeatures\PropertyInjectionFeature.cs (2)
35select new { Site = site, ImportInfo = ContractHelpers.GetImportInfo(pi.PropertyType, attrs, site) }).ToArray(); 95property.PropertyType));
System\Composition\TypedParts\Discovery\TypeInspector.cs (5)
89var contractType = export.ContractType ?? property.PropertyType; 92var exportKey = new CompositionContract(export.ContractType ?? property.PropertyType, export.ContractName); 160AddMetadata(metadata, prop.Name, prop.PropertyType, prop.GetValue(attribute, null)); 168CheckGenericContractCompatibility(partType, property.PropertyType.GetTypeInfo(), contractType); 170else if (!contractType.IsAssignableFrom(property.PropertyType.GetTypeInfo()))
System.Configuration.ConfigurationManager (4)
System\Configuration\ApplicationSettingsBase.cs (2)
448settingsProperty.PropertyType = propertyInfo.PropertyType; 515TypeConverter tc = TypeDescriptor.GetConverter(propertyInfo.PropertyType);
System\Configuration\ConfigurationProperty.cs (2)
120Type propertyType = info.PropertyType; 153info.PropertyType,
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\DsesFilterAndTransform.cs (2)
821if (!RuntimeFeature.IsDynamicCodeSupported && (propertyInfo.DeclaringType!.IsValueType || propertyInfo.PropertyType.IsValueType)) 829propertyInfo.DeclaringType!, propertyInfo.PropertyType);
System.Drawing.Primitives (1)
src\libraries\Common\src\System\Drawing\ColorTable.cs (1)
28if (prop.PropertyType == typeof(Color))
System.Linq.Expressions (17)
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (1)
1105return member is FieldInfo fi ? fi.FieldType : (member as PropertyInfo)!.PropertyType;
System\Linq\Expressions\Compiler\StackSpiller.Bindings.cs (1)
49if (_binding.Member is PropertyInfo property && property.PropertyType.IsValueType)
System\Linq\Expressions\IndexExpression.cs (5)
55return Indexer.PropertyType; 382if (indexer.PropertyType.IsByRef) 386if (indexer.PropertyType == typeof(void)) 395if (getter.ReturnType != indexer.PropertyType) 423if (indexer.PropertyType != valueType)
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
2764if (pi != null) return pi.PropertyType;
System\Linq\Expressions\MemberAssignment.cs (1)
105memberType = pi.PropertyType;
System\Linq\Expressions\MemberExpression.cs (1)
114public sealed override Type Type => _property.PropertyType;
System\Linq\Expressions\MemberListBinding.cs (4)
66/// <paramref name="member"/> does not represent a field or property.-or-The <see cref="FieldInfo.FieldType"/> or <see cref="PropertyInfo.PropertyType"/> of the field or property that <paramref name="member"/> represents does not implement <see cref="Collections.IEnumerable"/>.</exception> 79/// <paramref name="member"/> does not represent a field or property.-or-The <see cref="FieldInfo.FieldType"/> or <see cref="PropertyInfo.PropertyType"/> of the field or property that <paramref name="member"/> represents does not implement <see cref="Collections.IEnumerable"/>.</exception> 98/// <paramref name="propertyAccessor"/> does not represent a property accessor method.-or-The <see cref="PropertyInfo.PropertyType"/> of the property that the method represented by <paramref name="propertyAccessor"/> accesses does not implement <see cref="IEnumerable"/>.</exception> 112/// <paramref name="propertyAccessor"/> does not represent a property accessor method.-or-The <see cref="PropertyInfo.PropertyType"/> of the property that the method represented by <paramref name="propertyAccessor"/> accesses does not implement <see cref="IEnumerable"/>.</exception>
System\Linq\Expressions\MemberMemberBinding.cs (1)
141memberType = pi.PropertyType;
System\Linq\Expressions\NewExpression.cs (2)
335memberType = pi.PropertyType; 348memberType = prop.PropertyType;
System.Private.CoreLib (18)
src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (6)
691if (candidates[i].PropertyType.IsPrimitive) 694!CanChangePrimitive(rtType, candidates[i].PropertyType.UnderlyingSystemType)) 699if (!candidates[i].PropertyType.IsAssignableFrom(returnType)) 719int newMin = FindMostSpecificType(candidates[currentMin].PropertyType, candidates[i].PropertyType, returnType); 853if (returnType != null && returnType != match[i].PropertyType)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
3052if (p.PropertyType.IsEnum) 3055value = Enum.Parse(p.PropertyType, val);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (2)
174Type type = property.PropertyType; 218Type type = property.PropertyType;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TypeAnalysis.cs (1)
54Type propertyType = propertyInfo.PropertyType;
src\libraries\System.Private.CoreLib\src\System\Reflection\CustomAttributeNamedArgument.cs (2)
23PropertyInfo property => property.PropertyType, 65((PropertyInfo)_memberInfo).PropertyType;
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (1)
200NullabilityInfo nullability = GetNullabilityInfo(propertyInfo, propertyInfo.PropertyType, parser);
src\System\Attribute.CoreCLR.cs (1)
108property.PropertyType,
src\System\Reflection\Emit\CustomAttributeBuilder.cs (1)
136Type propType = property.PropertyType;
src\System\Reflection\RuntimeCustomAttributeData.cs (1)
295new CustomAttributeType((RuntimeType)pi.PropertyType));
src\System\RuntimeType.CoreCLR.cs (1)
2873if (returnType is not null && !returnType.IsEquivalentTo(firstCandidate.PropertyType))
System.Private.DataContractSerialization (7)
System\Runtime\Serialization\AccessorBuilder.cs (3)
47Type propertyType = propInfo.PropertyType!; 104Type propertyType = propInfo.PropertyType!; 129var createSetterGeneric = s_createSetterInternal.MakeGenericMethod(propInfo.DeclaringType!, propInfo.PropertyType).CreateDelegate<Func<PropertyInfo, Setter>>();
System\Runtime\Serialization\CodeGenerator.cs (1)
588memberType = property.PropertyType;
System\Runtime\Serialization\DataMember.cs (3)
176_memberType = prop.PropertyType; 260return DataContract.MethodRequiresMemberAccess(getMethod) || !DataContract.IsTypeVisible(property.PropertyType); 285return DataContract.MethodRequiresMemberAccess(setMethod) || !DataContract.IsTypeVisible(property.PropertyType);
System.Private.Xml (22)
System\Xml\Serialization\CodeGenerator.cs (2)
554memberType = property.PropertyType; 587memberType = property.PropertyType;
System\Xml\Serialization\Models.cs (5)
236TypeDesc typeDesc = ModelScope.TypeScope.GetTypeDesc(propertyInfo.PropertyType, propertyInfo, true, false); 240CheckSupportedMember(typeDesc, propertyInfo, propertyInfo.PropertyType); 241return new FieldModel(propertyInfo, propertyInfo.PropertyType, typeDesc); 323if (_checkSpecified != SpecifiedAccessor.None && specifiedProperty.PropertyType != typeof(bool)) 325throw new InvalidOperationException(SR.Format(SR.XmlInvalidSpecifiedType, specifiedProperty.Name, specifiedProperty.PropertyType.FullName, typeof(bool).FullName));
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (2)
635memberType = propInfo.PropertyType; 1060memberType = propertyInfo.PropertyType;
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (4)
1471if (mi is PropertyInfo pi && pi.GetMethod != null && pi.PropertyType == propInfo.PropertyType) 1498if (mi is PropertyInfo pi && pi.SetMethod != null && pi.PropertyType == propInfo.PropertyType)
System\Xml\Serialization\SourceInfo.cs (1)
177((FieldInfo)MemberInfo).FieldType : ((PropertyInfo)MemberInfo).PropertyType;
System\Xml\Serialization\Types.cs (4)
1309Type currentType = (p == null ? typeof(object) : p.PropertyType); 1373MethodInfo? addMethod = type.GetMethod("Add", new Type[] { indexer.PropertyType }); 1376throw new InvalidOperationException(SR.Format(SR.XmlNoAddMethod, type.FullName, indexer.PropertyType, "ICollection")); 1384return GetDefaultIndexer(type, memberInfo).PropertyType;
System\Xml\Serialization\XmlSerializationILGen.cs (1)
586Type memType = (memInfo is FieldInfo) ? ((FieldInfo)memInfo).FieldType : ((PropertyInfo)memInfo).PropertyType;
System\Xml\Serialization\XmlSerializationReaderILGen.cs (1)
2793ilg.ConvertValue(stackType, memInfo is FieldInfo ? ((FieldInfo)memInfo).FieldType : ((PropertyInfo)memInfo).PropertyType);
System\Xml\Serialization\XmlSerializationWriter.cs (1)
1847_writer.Write(GetStringForTypeof(CodeIdentifier.GetCSharpName(defaultIndexer.PropertyType), elementUseReflection));
System\Xml\Serialization\XmlSerializationWriterILGen.cs (1)
2515initValue.ILG.ConvertValue(propInfo.PropertyType, localA.LocalType);
System.Reflection.Context (1)
System\Reflection\Context\Delegation\DelegatingPropertyInfo.cs (1)
56get { return UnderlyingProperty.PropertyType; }
System.Reflection.DispatchProxy (1)
System\Reflection\DispatchProxyGenerator.cs (1)
383PropertyBuilder pb = _tb.DefineProperty(pi.Name, pi.Attributes, pi.PropertyType, pi.GetIndexParameters().Select(p => p.ParameterType).ToArray());
System.Reflection.Emit (1)
System\Reflection\Emit\TypeBuilderImpl.cs (1)
1068if (returnType is not null && !returnType.IsEquivalentTo(firstCandidate.PropertyType))
System.Reflection.MetadataLoadContext (9)
System\Reflection\DefaultBinder.cs (6)
206if (candidates[i].PropertyType.IsPrimitive) 209!CanChangePrimitive(returnType.UnderlyingSystemType, candidates[i].PropertyType.UnderlyingSystemType)) 214if (!candidates[i].PropertyType.IsAssignableFrom(returnType)) 235int newMin = FindMostSpecificType(candidates[currentMin].PropertyType, candidates[i].PropertyType, returnType); 336if (returnType != null && returnType != match[i].PropertyType)
System\Reflection\Runtime\BindingFlagSupport\PropertyPolicies.cs (2)
71if (!(prior.PropertyType.Equals(member.PropertyType)))
System\Reflection\TypeLoading\RuntimeTypeInfo.BindingFlags.cs (1)
144if (!(returnType is null) && !returnType.IsEquivalentTo(firstCandidate.PropertyType))
System.Text.Json (4)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (2)
172typeToConvert: propertyInfo.PropertyType, 281propertyInfo.PropertyType == ignoredMember.PropertyType;
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (2)
241Type declaredPropertyType = propertyInfo.PropertyType; 287Type declaredPropertyType = propertyInfo.PropertyType;
System.Windows.Forms (10)
System\Windows\Forms\DataBinding\BindingManagerBase.cs (5)
114if (property.Name == "Item" && property.PropertyType != typeof(object)) 116return TypeDescriptor.GetProperties(property.PropertyType, [new BrowsableAttribute(true)]); 134if (property.Name == "Item" && property.PropertyType != typeof(object)) 137itemProps = TypeDescriptor.GetProperties(property.PropertyType, [new BrowsableAttribute(true)]); 180return GetItemProperties(property.PropertyType, offset + 1, dataSources, listAccessors);
System\Windows\Forms\DataBinding\ListBindingHelper.cs (5)
231return indexer.PropertyType; 329name = indexer.PropertyType.Name; 552if (props[idx].GetIndexParameters().Length > 0 && props[idx].PropertyType != typeof(object)) 590if (indexer is not null && !typeof(ICustomTypeDescriptor).IsAssignableFrom(indexer.PropertyType)) 592Type type = indexer.PropertyType;
System.Windows.Forms.Design (5)
System\ComponentModel\Design\CollectionEditor.cs (1)
182return property.PropertyType;
System\ComponentModel\Design\InheritanceService.cs (2)
126Debug.Assert(fieldProp.PropertyType == field.FieldType, "Field declared with AccessedThroughPropertyAttribute is associated with a property with a different return type."); 127if (fieldProp is not null && fieldProp.PropertyType == field.FieldType)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (1)
2014expressionType = propertyInfo.PropertyType;
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
130if (prop.PropertyType != typeof(Color))
System.Xaml (1)
System\Xaml\XamlMember.cs (1)
1008return pi.PropertyType;
System.Xaml.Tests (1)
System\Xaml\XamlMemberTests.cs (1)
2386public override Type PropertyType => DelegatingProperty.PropertyType;
Test.Utilities (5)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (5)
72if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) 110.SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType)); 123property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo()) 125: Expression.Convert(valueParameter, property.PropertyType); 235VerifyResultTypeCompatibility<TProperty>(propertyInfo.PropertyType);
Text.Analyzers (5)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (5)
72if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) 110.SingleOrDefault(m => !m.IsStatic && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType.Equals(property.PropertyType)); 123property.PropertyType.GetTypeInfo().IsAssignableFrom(typeof(TProperty).GetTypeInfo()) 125: Expression.Convert(valueParameter, property.PropertyType); 235VerifyResultTypeCompatibility<TProperty>(propertyInfo.PropertyType);