4 types derived from Type
System.Private.CoreLib (3)
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (1)
13internal partial class ModifiedType : Type
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureType.cs (1)
17internal abstract class SignatureType : Type
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeInfo.cs (1)
9public abstract partial class TypeInfo : Type, IReflectableType
System.Windows.Forms.Tests (1)
System\Windows\Forms\ListBindingHelperTests.cs (1)
767public class CustomTypeDescriptorType : Type, ICustomTypeDescriptor
26410 references to Type
AnalyzerRunner (2)
CodeRefactoringRunner.cs (1)
178var refactoringTypes = new HashSet<Type>();
DiagnosticAnalyzerRunner.cs (1)
257var analyzerTypes = new HashSet<Type>();
ApiExplorerWebSite (2)
ApiExplorerInboundOutboundConvention.cs (1)
17public ApiExplorerInboundOutboundConvention(Type type)
ApiExplorerVisibilityDisabledConvention.cs (1)
16public ApiExplorerVisibilityDisabledConvention(Type type)
Aspire.Azure.AI.OpenAI (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Azure.Data.Tables (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Azure.Messaging.EventHubs (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Azure.Messaging.EventHubs.Tests (1)
AspireEventHubsExtensionsTests.cs (1)
49private static readonly Type[] s_clientTypes =
Aspire.Azure.Messaging.ServiceBus (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Azure.Messaging.WebPubSub (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Azure.Search.Documents (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Azure.Security.KeyVault (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Azure.Storage.Blobs (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Azure.Storage.Queues (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Confluent.Kafka.Tests (10)
ReflectionHelpers.cs (10)
12public static readonly Lazy<Type> MetricsChannelType = new Lazy<Type>(() => ComponentAssembly.GetType("Aspire.Confluent.Kafka.MetricsChannel")!); 13public static readonly Lazy<Type> ProducerConnectionFactoryType = new Lazy<Type>(() => ComponentAssembly.GetType("Aspire.Confluent.Kafka.ProducerConnectionFactory`2")!); 14public static readonly Lazy<Type> ProducerConnectionFactoryStringKeyStringValueType = new Lazy<Type>(() => ProducerConnectionFactoryType.Value.MakeGenericType(typeof(string), typeof(string))); 15public static readonly Lazy<Type> ConsumerConnectionFactoryType = new Lazy<Type>(() => ComponentAssembly.GetType("Aspire.Confluent.Kafka.ConsumerConnectionFactory`2")!); 16public static readonly Lazy<Type> ConsumerConnectionFactoryStringKeyStringValueType = new Lazy<Type>(() => ConsumerConnectionFactoryType.Value.MakeGenericType(typeof(string), typeof(string)));
Aspire.Dashboard (1)
Otlp\Model\OtlpInstrument.cs (1)
20public required OtlpInstrumentType Type { get; init; }
Aspire.Dashboard.Tests (1)
AssemblyExtensionsTests.cs (1)
89public override object[] GetCustomAttributes(Type attributeType, bool inherit)
Aspire.Elastic.Clients.Elasticsearch (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Hosting (5)
ApplicationModel\ResourceNotificationService.cs (1)
67public object? GetService(Type serviceType) => null;
Dcp\Model\Schema.cs (1)
8private readonly Dictionary<Type, (string Kind, string Resource)> _byType = new();
Eventing\DistributedApplicationEventing.cs (3)
12private readonly ConcurrentDictionary<Type, List<DistributedApplicationEventSubscription>> _eventSubscriptionListLookup = new(); 13private readonly ConcurrentDictionary<DistributedApplicationEventSubscription, Type> _subscriptionEventTypeLookup = new(); 122if (_subscriptionEventTypeLookup.TryGetValue(subscription, out var eventType))
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\AzureProvisioner.cs (1)
267var type = resource.GetType();
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppsInfrastructure.cs (1)
756private ProvisioningParameter AllocateParameter(IManifestExpressionProvider parameter, Type? type = null, SecretType secretType = SecretType.None)
Aspire.Hosting.Testing (7)
DistributedApplicationFactory.cs (3)
20public class DistributedApplicationFactory(Type entryPoint, string[] args) : IDisposable, IAsyncDisposable 22private readonly Type _entryPoint = entryPoint ?? throw new ArgumentNullException(nameof(entryPoint)); 35public DistributedApplicationFactory(Type entryPoint) : this(entryPoint, [])
DistributedApplicationTestingBuilder.cs (4)
41public static Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, CancellationToken cancellationToken = default) 70public static Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, string[] args, CancellationToken cancellationToken = default) 100public static async Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, string[] args, Action<DistributedApplicationOptions, HostApplicationBuilderSettings> configureBuilder, CancellationToken cancellationToken = default) 110private sealed class SuspendingDistributedApplicationFactory(Type entryPoint, string[] args, Action<DistributedApplicationOptions, HostApplicationBuilderSettings> configureBuilder)
Aspire.Hosting.Testing.Tests (1)
TestingBuilderTests.cs (1)
50var appHostType = appHostAssembly.GetTypes().FirstOrDefault(t => t.Name.EndsWith("_AppHost"))
Aspire.Hosting.Tests (1)
Utils\TestServiceProvider.cs (1)
19public object? GetService(Type serviceType)
Aspire.Microsoft.Azure.Cosmos (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Microsoft.Data.SqlClient (4)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (2)
108var declaringType = propertyInfo.DeclaringType; 136static PropertyFetch? DynamicInstantiationHelper(Type declaringType, PropertyInfo propertyInfo)
Aspire.Microsoft.EntityFrameworkCore.Cosmos (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Microsoft.EntityFrameworkCore.SqlServer (4)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (2)
108var declaringType = propertyInfo.DeclaringType; 136static PropertyFetch? DynamicInstantiationHelper(Type declaringType, PropertyInfo propertyInfo)
Aspire.Milvus.Client (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.MongoDB.Driver (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.MySqlConnector (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.NATS.Net (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Npgsql (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.OpenAI (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Oracle.EntityFrameworkCore (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Playground.Tests (4)
Infrastructure\DistributedApplicationExtensions.cs (3)
248foreach (var dbContextType in dbContextTypes) 263private static bool DerivesFromDbContext(Type type) 265var baseType = type.BaseType;
Infrastructure\DistributedApplicationTestFactory.cs (1)
25var appHostType = appHostAssembly.GetTypes().FirstOrDefault(t => t.Name.EndsWith("_AppHost"))
Aspire.Pomelo.EntityFrameworkCore.MySql (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Qdrant.Client (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.RabbitMQ.Client (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.Seq (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.StackExchange.Redis (9)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Implementation\RedisProfilerEntryToActivityConverter.cs (5)
21Type profiledCommandType = Type.GetType("StackExchange.Redis.Profiling.ProfiledCommand, StackExchange.Redis", throwOnError: true)!; 22Type scriptMessageType = Type.GetType("StackExchange.Redis.RedisDatabase+ScriptEvalMessage, StackExchange.Redis", throwOnError: true)!; 198Type classType,
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Shared\PropertyFetcher.AOT.cs (2)
114var declaringType = propertyInfo.DeclaringType; 142static PropertyFetch? DynamicInstantiationHelper(Type declaringType, PropertyInfo propertyInfo)
Aspire.StackExchange.Redis.DistributedCaching (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Aspire.StackExchange.Redis.OutputCaching (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
BasicWebSite (3)
Formatters\VCardFormatter_V3.cs (1)
24protected override bool CanWriteType(Type type)
Formatters\VCardFormatter_V4.cs (1)
25protected override bool CanWriteType(Type type)
RequestScopedActionConstraint.cs (1)
27var constraintType = typeof(Constraint);
BinaryFormatTests (5)
FormatTests\FormattedObject\BinaryFormattedTypes.cs (4)
15public void Types_UseBinaryFormatter(Type type) 31public static TheoryData<Type> BinaryFormattedTypes_TestData => new() 42public void Types_DoNotUseBinaryFormatter(Type type) 51public static TheoryData<Type> NotBinaryFormattedTypes_TestData => new()
FormatTests\FormattedObject\HashTableTests.cs (1)
263public object Convert(object value, Type type) => throw new NotImplementedException();
Binding.UDS.IntegrationTests (3)
ServiceHelper.cs (3)
19var startupType = typeof(TStartup); 20var configureServicesMethod = startupType.GetMethod("ConfigureServices", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, new Type[] { typeof(IServiceCollection) }); 21var configureMethod = startupType.GetMethod("Configure", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, new Type[] { typeof(IHost) });
BuildActionTelemetryTable (12)
Program.cs (9)
478internal static ImmutableArray<Type> GetCodeActionAndProviderTypes(IEnumerable<Assembly> assemblies) 488static bool isCodeActionType(Type t) => typeof(CodeAction).IsAssignableFrom(t); 490static bool isCodeActionProviderType(Type t) => typeof(CodeFixProvider).IsAssignableFrom(t) 494internal static ImmutableArray<(string TypeName, string Hash)> GetTelemetryInfos(ImmutableArray<Type> codeActionAndProviderTypes) 502static (string TypeName, string Hash) GetTelemetryInfo(Type type) 686private class FullNameTypeComparer : IEqualityComparer<Type> 690public bool Equals(Type? x, Type? y) 693public int GetHashCode([DisallowNull] Type obj)
src\Workspaces\Core\Portable\Shared\Extensions\TelemetryExtensions.cs (3)
15public static Guid GetTelemetryId(this Type type, short scope = 0, string? additionalSuffixString = null) 38public static Type GetTypeForTelemetry(this Type type)
Client.ExpectedExceptions.IntegrationTests (2)
CallbackDebugBehaviorTests.cs (2)
39System.Collections.ObjectModel.KeyedCollection<Type, IEndpointBehavior> endpointBehaviors = factory.Endpoint.EndpointBehaviors; 65System.Collections.ObjectModel.KeyedCollection<Type, IEndpointBehavior> endpointBehaviors2 = factory2.Endpoint.EndpointBehaviors;
ComDisabled.Tests (3)
DataObjectComTests.cs (3)
76public object GetData(Type format) => throw new NotImplementedException(); 79public bool GetDataPresent(Type format) => throw new NotImplementedException(); 84public void SetData(Type format, object data) => throw new NotImplementedException();
ConfigurationSchemaGenerator (8)
ConfigSchemaEmitter.cs (4)
371Type.GetType("Microsoft.CodeAnalysis.Shared.Extensions.ISymbolExtensions, Microsoft.CodeAnalysis.Workspaces")! 375Type.GetType("Microsoft.CodeAnalysis.Shared.Utilities.DocumentationComment, Microsoft.CodeAnalysis.Workspaces")! 738public override bool CanConvert(Type typeToConvert) => typeof(JsonNode).IsAssignableFrom(typeToConvert) && typeToConvert != typeof(JsonValue); 776public override JsonNode? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
RuntimeSource\Configuration.Binder\Parser\Extensions.cs (2)
20/// <see cref="System.Type.FullName"/> like rendering of the symbol name. 56/// <see cref="System.Type.FullName"/> like rendering of the symbol name.
RuntimeSource\Configuration.Binder\Specs\Types\TypeSpec.cs (1)
27/// <see cref="System.Type.FullName"/> like rendering of the type name.
RuntimeSource\Roslyn\GetBestTypeByMetadataName.cs (1)
88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
ConfigurationSchemaGenerator.Tests (2)
src\Components\Common\ConfigurationSchemaAttributes.cs (2)
12public ConfigurationSchemaAttribute(string path, Type type, string[]? exclusionPaths = null) 27public Type Type { get; }
Contract.Data.IntegrationTests (4)
DataContractTests.4.1.1.cs (4)
70public override Type ResolveName(string typeName, string typeNamespace, Type declaredType, DataContractResolver knownTypeResolver) 82public override bool TryResolveType(Type type, Type declaredType, DataContractResolver knownTypeResolver, out XmlDictionaryString typeName, out XmlDictionaryString typeNamespace)
Contract.Fault.IntegrationTests (1)
FaultExceptionTests.cs (1)
23Type detail = typeof(FaultDetail);
ControllersFromServicesWebSite (1)
Startup.cs (1)
43public TypesPart(params Type[] types)
DesignSurfaceExt (13)
DesignSurfaceExt.cs (1)
121Type hostType = host.RootComponent.GetType();
NameCreationServiceImp.cs (1)
17public string CreateName(IContainer container, Type type)
PropertyGridExt.cs (1)
73protected override object GetService(Type service) => DesignerHost?.GetService(service) ?? base.GetService(service);
TabOrderHooker.cs (2)
27Type tabOrderType = designAssembly.GetType("System.Windows.Forms.Design.TabOrder"); 55Type tabOrderType = designAssembly.GetType("System.Windows.Forms.Design.TabOrder");
TypeDiscoveryService.cs (8)
19private readonly ConcurrentDictionary<Type, ImmutableArray<Type>> _discoveredTypesCache = new(); 21public ICollection GetTypes(Type baseType, bool excludeGlobalTypes) 27static ImmutableArray<Type> FindTypes(Type baseType, Assembly[] assemblies) 29var builder = ImmutableArray.CreateBuilder<Type>(); 33Type[] types; 43foreach (var type in types)
Diagnostics.EFCore.FunctionalTests (1)
Helpers\PlatformHelper.cs (1)
12return Type.GetType("Mono.Runtime") != null;
dotnet-svcutil.xmlserializer (44)
Microsoft\Tools\ServiceModel\SvcUtil\ExportModule.cs (11)
24internal delegate bool IsTypeExcludedDelegate(Type t); 25internal delegate void TypeLoadErrorEventHandler(Type type, string errorMessage); 31private readonly List<Type> _types = new List<Type>(); 34private static Type serviceContractAttributeType = Tool.SMAssembly.GetType("System.ServiceModel.ServiceContractAttribute"); 51foreach (Type type in _types) 62private object LoadContract(Type type) 66Type contractDescription = Tool.SMAssembly.GetType("System.ServiceModel.Description.ContractDescription"); 67MethodInfo GetContract = contractDescription.GetMethod("GetContract", BindingFlags.Public| BindingFlags.Static, null, new Type[] { typeof(Type) }, null); 84private static bool IsContractType(Type type)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (4)
231static public Type[] LoadTypes(Assembly assembly) 233Type[] types; 246types = Array.FindAll<Type>(rtle.Types, delegate (Type t) { return t != null; });
Microsoft\Tools\ServiceModel\SvcUtil\Options.cs (16)
32private List<Type> _referencedTypes; 34private Dictionary<string, Type> _excludedTypes; 44internal List<Type> ReferencedTypes { get { return _referencedTypes; } } 123internal bool IsTypeExcluded(Type type) 134private static Type s_typeOfDateTimeOffset = typeof(DateTimeOffset); 333_parent._referencedTypes = new List<Type>(); 339Dictionary<string, Type> foundCollectionTypes = AddSpecifiedTypesToDictionary(collectionTypesArgs, Options.Cmd.CollectionType); 382private Dictionary<string, Type> AddSpecifiedTypesToDictionary(IList<string> typeArgs, string cmd) 384Dictionary<string, Type> specifiedTypes = new Dictionary<string, Type>(typeArgs.Count); 394private void AddReferencedTypesFromAssembly(Assembly assembly, Dictionary<string, Type> foundCollectionTypes) 396foreach (Type type in InputModule.LoadTypes(assembly)) 406private void AddMscorlib(Dictionary<string, Type> foundCollectionTypes) 477internal static bool IsTypeSpecified(Type type, Dictionary<string, Type> specifiedTypes, string cmd) 479Type foundType = null;
Microsoft\Tools\ServiceModel\SvcUtil\XmlSerializerGenerator.cs (13)
48List<Type> types = CollectXmlSerializerTypes(assembly, mappings); 117private List<Type> CollectXmlSerializerTypes(Assembly assembly, List<XmlMapping> mappings) 119List<Type> types = new List<Type>(); 122contractLoader.ContractLoadErrorCallback = delegate (Type contractType, string errorMessage) 127Type contractDescriptionType = Tool.SMAssembly.GetType("System.ServiceModel.Description.ContractDescription"); 141Type xmlSerializerOperationBehaviorType = Tool.SMAssembly.GetType("System.ServiceModel.Description.XmlSerializerOperationBehavior"); 148Type operationType = Tool.SMAssembly.GetType("System.ServiceModel.Description.OperationDescription"); 162Type keyedByTypeCollectionType = Tool.SMAssembly.GetType("System.Collections.Generic.KeyedByTypeCollection`1"); 169Type iOperationBehaviorType = Tool.SMAssembly.GetType("System.ServiceModel.Description.IOperationBehavior"); 176keyedByTypeCollectionType = keyedByTypeCollectionType.MakeGenericType(new Type[] { iOperationBehaviorType }); 190findMethod = findMethod.MakeGenericMethod(new Type[] { xmlSerializerOperationBehaviorType }); 230types.Add((Type)contractTypeProperty.GetValue(contract));
dotnet-svcutil-lib (2477)
CodeDomFixup\CodeDomHelpers.cs (6)
27Type namespaceHelper = typeof(ServiceContractGenerator).GetTypeInfo().Assembly.GetType(typeof(ServiceContractGenerator).FullName + "+NamespaceHelper"); 125internal static bool MatchType(CodeTypeReference typeRef, Type type) 167internal static bool MatchGenericBaseType(CodeTypeReference typeRef, Type type) 172internal static bool MatchBaseType(CodeTypeReference typeRef, Type type) 177internal static bool MatchAnyBaseType(CodeTypeReference typeRef, Type[] types) 197internal static bool MatchSignatures(CodeParameterDeclarationExpressionCollection args1, Type[] args2)
CodeDomFixup\CodeDomVisitors\AttributeFixer.cs (2)
16private static Type[] s_attrsToRemove = new Type[]
CodeDomFixup\CodeDomVisitors\ConstructorFixer.cs (13)
17private static Type[][] s_validCtors = new Type[][] 19Array.Empty<Type>(), 20new Type[] { typeof(string), }, 21new Type[] { typeof(InstanceContext), }, 22new Type[] { typeof(string), typeof(string), }, 23new Type[] { typeof(string), typeof(EndpointAddress), }, 24new Type[] { typeof(InstanceContext), typeof(string), }, 25new Type[] { typeof(InstanceContext), typeof(string), typeof(string), }, 26new Type[] { typeof(InstanceContext), typeof(string), typeof(EndpointAddress), }, 27new Type[] { typeof(Binding), typeof(EndpointAddress), }, 28new Type[] { typeof(InstanceContext), typeof(Binding), typeof(EndpointAddress), }, 41private static bool IsValidConstructor(CodeConstructor ctor, Type[][] validCtors)
CodeDomFixup\CodeDomVisitors\NamespaceFixer.cs (6)
18private Dictionary<string, Type> _xmlTypes = new Dictionary<string, Type>(); 19private Dictionary<string, Type> _codeDomTypes = new Dictionary<string, Type>(); 25foreach (var type in msxmlTypes) 36foreach (var type in mscodedomTypes)
CodeDomFixup\CodeDomVisitors\PropertyFieldNameScope.cs (1)
14public PropertyFieldNameScope(Type type)
CodeDomFixup\CodeDomVisitors\SimpleTypeRemapper.cs (4)
12protected Type srcType; 15public SimpleTypeRemapper(Type srcType, Type destType) : this(srcType, destType.FullName) { } 16public SimpleTypeRemapper(Type srcType, string destType)
CodeDomFixup\CodeDomVisitors\XmlDomAttributeFixer.cs (2)
13private static readonly Type[] s_filteredTypes = new Type[] { typeof(Microsoft.Xml.XmlAttribute), };
CodeDomFixup\MethodCreationHelper.cs (1)
1358Type bindingElementType = isHttps ? typeof(HttpsTransportBindingElement) : typeof(HttpTransportBindingElement);
CommandProcessorOptions.cs (21)
42public List<Type> ReferencedTypes { get; private set; } 44public List<Type> ReferencedCollectionTypes { get; private set; } 103this.ReferencedTypes = new List<Type>(); 105this.ReferencedCollectionTypes = new List<Type>(); 858private static Dictionary<string, Type> AddSpecifiedTypesToDictionary(IList<string> typeArgs, string cmd) 860Dictionary<string, Type> specifiedTypes = new Dictionary<string, Type>(typeArgs.Count); 872private void AddReferencedTypesFromAssembly(Assembly assembly, Dictionary<string, Type> foundCollectionTypes, Dictionary<string, Type> excludedTypes) 874foreach (Type type in TypeLoader.LoadTypes(assembly, this.Verbosity.Value)) 892private void AddStdLibraries(Dictionary<string, Type> foundCollectionTypes, Dictionary<string, Type> excludedTypes) 894List<Type> coreTypes = new List<Type> 901foreach (var type in coreTypes) 911private static bool IsTypeSpecified(Type type, Dictionary<string, Type> specifiedTypes, string cmd) 917if (specifiedTypes.TryGetValue(type.FullName, out Type foundType)) 945private void AddReferencedCollectionTypes(IList<string> collectionTypesArgs, Dictionary<string, Type> foundCollectionTypes) 952Type foundType = null; 971foundType = foundType ?? Type.GetType(collectionType);
FrameworkFork\Microsoft.CodeDom\Compiler\CodeDOMProvider.cs (1)
154public virtual TypeConverter GetConverter(Type type)
FrameworkFork\Microsoft.CodeDom\Compiler\CompilerInfo.cs (7)
23private Type _type; 37public Type CodeDomProviderType 47_type = Type.GetType(_codeDomProviderTypeName); 64Type type = Type.GetType(_codeDomProviderTypeName); 79ConstructorInfo ci = CodeDomProviderType.GetConstructor(new Type[] { typeof(IDictionary<string, string>) }); 94ConstructorInfo constructor = CodeDomProviderType.GetConstructor(new Type[] { typeof(IDictionary<string, string>) });
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (3)
78public override TypeConverter GetConverter(Type type) 4613public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 4651public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
FrameworkFork\Microsoft.CodeDom\System\CodeArrayCreateExpression.cs (3)
62public CodeArrayCreateExpression(Type createType, params CodeExpression[] initializers) 92public CodeArrayCreateExpression(Type createType, int size) 122public CodeArrayCreateExpression(Type createType, CodeExpression size)
FrameworkFork\Microsoft.CodeDom\System\CodeCastExpression.cs (1)
62public CodeCastExpression(Type targetType, CodeExpression expression)
FrameworkFork\Microsoft.CodeDom\System\CodeMemberField.cs (1)
61public CodeMemberField(Type type, string name)
FrameworkFork\Microsoft.CodeDom\System\CodeObjectCreateExpression.cs (1)
61public CodeObjectCreateExpression(Type createType, params CodeExpression[] parameters)
FrameworkFork\Microsoft.CodeDom\System\CodeParameterDeclarationExpression.cs (1)
63public CodeParameterDeclarationExpression(Type type, string name)
FrameworkFork\Microsoft.CodeDom\System\CodeTypeOfExpression.cs (1)
57public CodeTypeOfExpression(Type type)
FrameworkFork\Microsoft.CodeDom\System\CodeTypeReference.cs (5)
57public CodeTypeReference(Type type) 78public CodeTypeReference(Type type, CodeTypeReferenceOptions codeTypeReferenceOption) : this(type) 100private void InitializeFromType(Type type) 105Type currentType = type; 119Type[] genericArgs = type.GetGenericArguments();
FrameworkFork\Microsoft.CodeDom\System\CodeTypeReferenceCollection.cs (1)
88public void Add(Type value)
FrameworkFork\Microsoft.CodeDom\System\CodeTypeReferenceExpression.cs (1)
57public CodeTypeReferenceExpression(Type type)
FrameworkFork\Microsoft.CodeDom\System\CodeVariableDeclarationStatement.cs (2)
61public CodeVariableDeclarationStatement(Type type, string name) 93public CodeVariableDeclarationStatement(Type type, string name, CodeExpression initExpression)
FrameworkFork\Microsoft.Xml\External\Extensions.cs (4)
19public static MethodInfo GetMethod(this Type type, String name, BindingFlags bindingAttr, System.Reflection.Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) 24public static MethodInfo GetMethod(this Type type, String name, BindingFlags bindingAttr, System.Reflection.Binder binder, Type[] types, ParameterModifier[] modifiers)
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\XmlBinaryReader.cs (16)
21internal static readonly Type TypeOfObject = typeof(System.Object); 22internal static readonly Type TypeOfString = typeof(System.String); 24private static volatile Type[] s_tokenTypeMap = null; 320private System.Type _valueType; 641public override System.Type ValueType 1768public override object ReadContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver) 3287Type[] map = new Type[256]; 3299Type TypeOfInt32 = typeof(System.Int32); 3302Type TypeOfDecimal = typeof(System.Decimal); 3308Type TypeOfDateTime = typeof(System.DateTime); 3317Type TypeOfDateTimeOffset = typeof(System.DateTimeOffset); 3321Type TypeOfByteArray = typeof(System.Byte[]); 3339private System.Type GetValueType(BinXmlToken token) 3341Type t = s_tokenTypeMap[(int)token]; 4213private object ValueAs(BinXmlToken token, Type returnType, IXmlNamespaceResolver namespaceResolver)
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\XmlBinaryReaderAsync.cs (2)
37public override Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver) 57public override Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlAsyncCheckReader.cs (6)
231public override System.Type ValueType 294public override object ReadContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver) 414public override object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver) 420public override object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver, string localName, string namespaceURI) 826public override Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver) 850public override Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlReader.cs (4)
202public virtual System.Type ValueType 378public virtual object ReadContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver) 586public virtual object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver) 599public virtual object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver, string localName, string namespaceURI)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlReaderAsync.cs (2)
57public virtual async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver) 111public virtual async Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlSubtreeReader.cs (1)
795public override object ReadContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlSubtreeReaderAsync.cs (1)
220public override async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWrappingReader.cs (1)
52public override System.Type ValueType { get { return reader.ValueType; } }
FrameworkFork\Microsoft.Xml\Xml\Core\XsdValidatingReader.cs (4)
130private static volatile Type s_typeOfString; 408public override System.Type ValueType 709public override object ReadContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver) 1042public override object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver)
FrameworkFork\Microsoft.Xml\Xml\Core\XsdValidatingReaderAsync.cs (2)
78public override async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver) 173public override async Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
FrameworkFork\Microsoft.Xml\Xml\Resolvers\XmlPreloadedResolver.cs (4)
40internal virtual bool SupportsType(Type type) 115internal override bool SupportsType(Type type) 224public override Object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn) 266public override bool SupportsType(Uri absoluteUri, Type type)
FrameworkFork\Microsoft.Xml\Xml\Resolvers\XmlPreloadedResolverAsync.cs (1)
21Type ofObjectToReturn)
FrameworkFork\Microsoft.Xml\Xml\Resolvers\XmlSystemPathResolver.cs (1)
21public override Object GetEntity(Uri uri, string role, Type typeOfObjectToReturn)
FrameworkFork\Microsoft.Xml\Xml\schema\DatatypeImplementation.cs (103)
433Type derivedType = this.GetType(); 434Type baseType = datatype.GetType(); 492public override Type ValueType { get { return typeof(string); } } 536internal abstract Type ListValueType { get; } 542internal override object ParseValue(string s, Type typDest, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr) 1022public override Type ValueType { get { return ListValueType; } } 1026internal override Type ListValueType { get { return _itemType.ListValueType; } } 1184private static readonly Type s_atomicValueType = typeof(object); 1185private static readonly Type s_listValueType = typeof(object[]); 1218public override Type ValueType { get { return s_atomicValueType; } } 1224internal override Type ListValueType { get { return s_listValueType; } } 1374private static readonly Type s_atomicValueType = typeof(string); 1375private static readonly Type s_listValueType = typeof(string[]); 1384public override Type ValueType { get { return s_atomicValueType; } } 1388internal override Type ListValueType { get { return s_listValueType; } } 1525private static readonly Type s_atomicValueType = typeof(bool); 1526private static readonly Type s_listValueType = typeof(bool[]); 1537public override Type ValueType { get { return s_atomicValueType; } } 1539internal override Type ListValueType { get { return s_listValueType; } } 1605private static readonly Type s_atomicValueType = typeof(float); 1606private static readonly Type s_listValueType = typeof(float[]); 1617public override Type ValueType { get { return s_atomicValueType; } } 1619internal override Type ListValueType { get { return s_listValueType; } } 1694private static readonly Type s_atomicValueType = typeof(double); 1695private static readonly Type s_listValueType = typeof(double[]); 1706public override Type ValueType { get { return s_atomicValueType; } } 1708internal override Type ListValueType { get { return s_listValueType; } } 1785private static readonly Type s_atomicValueType = typeof(decimal); 1786private static readonly Type s_listValueType = typeof(decimal[]); 1798public override Type ValueType { get { return s_atomicValueType; } } 1800internal override Type ListValueType { get { return s_listValueType; } } 1878private static readonly Type s_atomicValueType = typeof(TimeSpan); 1879private static readonly Type s_listValueType = typeof(TimeSpan[]); 1890public override Type ValueType { get { return s_atomicValueType; } } 1892internal override Type ListValueType { get { return s_listValueType; } } 2023private static readonly Type s_atomicValueType = typeof(DateTime); 2024private static readonly Type s_listValueType = typeof(DateTime[]); 2045public override Type ValueType { get { return s_atomicValueType; } } 2047internal override Type ListValueType { get { return s_listValueType; } } 2426private static readonly Type s_atomicValueType = typeof(byte[]); 2427private static readonly Type s_listValueType = typeof(byte[][]); 2438public override Type ValueType { get { return s_atomicValueType; } } 2440internal override Type ListValueType { get { return s_listValueType; } } 2527private static readonly Type s_atomicValueType = typeof(byte[]); 2528private static readonly Type s_listValueType = typeof(byte[][]); 2539public override Type ValueType { get { return s_atomicValueType; } } 2541internal override Type ListValueType { get { return s_listValueType; } } 2627private static readonly Type s_atomicValueType = typeof(Uri); 2628private static readonly Type s_listValueType = typeof(Uri[]); 2639public override Type ValueType { get { return s_atomicValueType; } } 2648internal override Type ListValueType { get { return s_listValueType; } } 2723private static readonly Type s_atomicValueType = typeof(XmlQualifiedName); 2724private static readonly Type s_listValueType = typeof(XmlQualifiedName[]); 2750public override Type ValueType { get { return s_atomicValueType; } } 2752internal override Type ListValueType { get { return s_listValueType; } } 3059private static readonly Type s_atomicValueType = typeof(XmlQualifiedName); 3060private static readonly Type s_listValueType = typeof(XmlQualifiedName[]); 3086public override Type ValueType { get { return s_atomicValueType; } } 3088internal override Type ListValueType { get { return s_listValueType; } } 3265private static readonly Type s_atomicValueType = typeof(long); 3266private static readonly Type s_listValueType = typeof(long[]); 3286public override Type ValueType { get { return s_atomicValueType; } } 3288internal override Type ListValueType { get { return s_listValueType; } } 3329private static readonly Type s_atomicValueType = typeof(int); 3330private static readonly Type s_listValueType = typeof(int[]); 3342public override Type ValueType { get { return s_atomicValueType; } } 3344internal override Type ListValueType { get { return s_listValueType; } } 3386private static readonly Type s_atomicValueType = typeof(short); 3387private static readonly Type s_listValueType = typeof(short[]); 3399public override Type ValueType { get { return s_atomicValueType; } } 3401internal override Type ListValueType { get { return s_listValueType; } } 3442private static readonly Type s_atomicValueType = typeof(sbyte); 3443private static readonly Type s_listValueType = typeof(sbyte[]); 3455public override Type ValueType { get { return s_atomicValueType; } } 3457internal override Type ListValueType { get { return s_listValueType; } } 3530private static readonly Type s_atomicValueType = typeof(ulong); 3531private static readonly Type s_listValueType = typeof(ulong[]); 3543public override Type ValueType { get { return s_atomicValueType; } } 3545internal override Type ListValueType { get { return s_listValueType; } } 3586private static readonly Type s_atomicValueType = typeof(uint); 3587private static readonly Type s_listValueType = typeof(uint[]); 3599public override Type ValueType { get { return s_atomicValueType; } } 3601internal override Type ListValueType { get { return s_listValueType; } } 3642private static readonly Type s_atomicValueType = typeof(ushort); 3643private static readonly Type s_listValueType = typeof(ushort[]); 3655public override Type ValueType { get { return s_atomicValueType; } } 3657internal override Type ListValueType { get { return s_listValueType; } } 3697private static readonly Type s_atomicValueType = typeof(byte); 3698private static readonly Type s_listValueType = typeof(byte[]); 3710public override Type ValueType { get { return s_atomicValueType; } } 3712internal override Type ListValueType { get { return s_listValueType; } } 3806private static readonly Type s_atomicValueType = typeof(XmlQualifiedName); 3807private static readonly Type s_listValueType = typeof(XmlQualifiedName[]); 3836public override Type ValueType { get { return s_atomicValueType; } } 3838internal override Type ListValueType { get { return s_listValueType; } } 3848private static readonly Type s_atomicValueType = typeof(char); 3849private static readonly Type s_listValueType = typeof(char[]); 3851public override Type ValueType { get { return s_atomicValueType; } } 3853internal override Type ListValueType { get { return s_listValueType; } } 3950private static readonly Type s_atomicValueType = typeof(Guid); 3951private static readonly Type s_listValueType = typeof(Guid[]); 3953public override Type ValueType { get { return s_atomicValueType; } } 3955internal override Type ListValueType { get { return s_listValueType; } }
FrameworkFork\Microsoft.Xml\Xml\schema\GenerateConverter.cs (52)
22public static Type[] InterfaceTypes = { typeof(Boolean), typeof(DateTime), typeof(Decimal), typeof(Double), typeof(Int32), typeof(Int64), typeof(Single), typeof(String), typeof(Object) }; 383List<Type> uniqueTypes = new List<Type>(); 386foreach (Type tSrc in group.FindUniqueSourceTypes(null)) 389foreach (Type tDst in group.FindUniqueDestinationTypes(null)) 393foreach (Type t in uniqueTypes) 399foreach (Type tDst in InterfaceTypes) 401foreach (Type tSrc in InterfaceTypes) 441IList<Type> uniqueSourceTypes, uniqueDestTypes; 446foreach (Type tDst in InterfaceTypes) 459foreach (Type tSrc in InterfaceTypes) 489foreach (Type tSrc in uniqueSourceTypes) 514foreach (Type tSrc in InterfaceTypes) 529foreach (Type tDst in uniqueDestTypes) 557foreach (Type tDst in group.FindUniqueDestinationTypes(null)) 588foreach (Type tSrc in uniqueSourceTypes) 600foreach (Type tDst in group.FindUniqueDestinationTypes(typeof(object))) 604foreach (Type tSrc in group.FindUniqueSourceTypes(typeof(object))) 633foreach (Type tSrc in uniqueSourceTypes) 649foreach (Type tDst in uniqueDestTypes) 664private void StartMethod(Type typeSrc, Type typeDst) 686private void StartMethodSignature(Type typeSrc, Type typeDst) 714private bool MethodHasResolver(Type typeSrc, Type typeDst) 789Type tSrc, tDst; 829private string GenerateSourceTypeMatch(Type type) 841private static string ClrTypeName(Type type) 849private static string ClrTypeToCSharpName(Type type) 869private static bool IsInterfaceMethod(Type type) 888Type clrTypeSrc = ClrTypeNameToType(rule[1]); 889Type clrTypeDst = ClrTypeNameToType(rule[2]); 901public IList<Type> FindUniqueSourceTypes(Type tDst) 903List<Type> types = new List<Type>(); 914public IList<Type> FindUniqueDestinationTypes(Type tSrc) 916List<Type> types = new List<Type>(); 927public IList<ConversionRule> Find(XmlTypeCode code, Type tSrc, Type tDst) 985private static Type ClrTypeNameToType(string name) 987Type type = Type.GetType("System." + name); 990type = Type.GetType("System.IO." + name); 1009private Type _clrTypeSrc,_clrTypeDst; 1012public ConversionRule(XmlTypeCode xmlType, Type clrTypeSrc, Type clrTypeDst, string convExpr) 1025public Type SourceType 1030public Type DestinationType
FrameworkFork\Microsoft.Xml\Xml\schema\Preprocessor.cs (1)
370Type returnType = obj.GetType();
FrameworkFork\Microsoft.Xml\Xml\schema\XmlAtomicValue.cs (2)
201public override Type ValueType 344public override object ValueAs(Type type, IXmlNamespaceResolver nsResolver)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaDatatype.cs (5)
29public abstract Type ValueType { get; } 54public virtual object ChangeType(object value, Type targetType) 71public virtual object ChangeType(object value, Type targetType, IXmlNamespaceResolver namespaceResolver) 113internal abstract object ParseValue(string s, Type typDest, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr); 274Type t = value.GetType();
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (167)
263public abstract object ChangeType(bool value, Type destinationType); 264public abstract object ChangeType(int value, Type destinationType); 265public abstract object ChangeType(long value, Type destinationType); 266public abstract object ChangeType(decimal value, Type destinationType); 267public abstract object ChangeType(float value, Type destinationType); 268public abstract object ChangeType(double value, Type destinationType); 269public abstract object ChangeType(DateTime value, Type destinationType); 270public abstract object ChangeType(DateTimeOffset value, Type destinationType); 271public abstract object ChangeType(string value, Type destinationType); 272public abstract object ChangeType(string value, Type destinationType, IXmlNamespaceResolver nsResolver); 273public abstract object ChangeType(object value, Type destinationType); 274public abstract object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver); 281private Type _clrTypeDefault; 335protected XmlBaseConverter(XmlBaseConverter converterAtomic, Type clrTypeDefault) 342protected static readonly Type ICollectionType = typeof(ICollection); 343protected static readonly Type IEnumerableType = typeof(IEnumerable); 344protected static readonly Type IListType = typeof(IList); 345protected static readonly Type ObjectArrayType = typeof(object[]); 346protected static readonly Type StringArrayType = typeof(string[]); 347protected static readonly Type XmlAtomicValueArrayType = typeof(XmlAtomicValue[]); 350protected static readonly Type DecimalType = typeof(decimal); 351protected static readonly Type Int32Type = typeof(int); 352protected static readonly Type Int64Type = typeof(long); 353protected static readonly Type StringType = typeof(string); 354protected static readonly Type XmlAtomicValueType = typeof(XmlAtomicValue); 355protected static readonly Type ObjectType = typeof(object); 356protected static readonly Type ByteType = typeof(byte); 357protected static readonly Type Int16Type = typeof(short); 358protected static readonly Type SByteType = typeof(sbyte); 359protected static readonly Type UInt16Type = typeof(ushort); 360protected static readonly Type UInt32Type = typeof(uint); 361protected static readonly Type UInt64Type = typeof(ulong); 362protected static readonly Type XPathItemType = typeof(XPathItem); 363protected static readonly Type DoubleType = typeof(double); 364protected static readonly Type SingleType = typeof(float); 365protected static readonly Type DateTimeType = typeof(DateTime); 366protected static readonly Type DateTimeOffsetType = typeof(DateTimeOffset); 367protected static readonly Type BooleanType = typeof(bool); 368protected static readonly Type ByteArrayType = typeof(Byte[]); 369protected static readonly Type XmlQualifiedNameType = typeof(XmlQualifiedName); 370protected static readonly Type UriType = typeof(Uri); 371protected static readonly Type TimeSpanType = typeof(TimeSpan); 372protected static readonly Type XPathNavigatorType = typeof(XPathNavigator); 475public override object ChangeType(bool value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 476public override object ChangeType(DateTime value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 477public override object ChangeType(DateTimeOffset value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 478public override object ChangeType(decimal value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 479public override object ChangeType(double value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 480public override object ChangeType(int value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 481public override object ChangeType(long value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 482public override object ChangeType(float value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 483public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver nsResolver) { return (object)ChangeType((object)value, destinationType, nsResolver); } 484public override object ChangeType(string value, Type destinationType) { return this.ChangeType(value, destinationType, null); } 485public override object ChangeType(object value, Type destinationType) { return this.ChangeType(value, destinationType, null); } 537protected Type DefaultClrType 545protected static bool IsDerivedFrom(Type derivedType, Type baseType) 561protected Exception CreateInvalidClrMappingException(Type sourceType, Type destinationType) 598protected virtual object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 1022Type sourceType = value.GetType(); 1068Type sourceType = value.GetType(); 1107Type sourceType = value.GetType(); 1153Type sourceType = value.GetType(); 1169public override object ChangeType(decimal value, Type destinationType) 1184public override object ChangeType(int value, Type destinationType) 1199public override object ChangeType(long value, Type destinationType) 1214public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver nsResolver) 1230public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 1235Type sourceType = value.GetType(); 1279private object ChangeTypeWildcardDestination(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 1281Type sourceType = value.GetType(); 1292private object ChangeTypeWildcardSource(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 1363Type sourceType = value.GetType(); 1411Type sourceType = value.GetType(); 1446Type sourceType = value.GetType(); 1461public override object ChangeType(double value, Type destinationType) 1475public override object ChangeType(float value, Type destinationType) 1489public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver nsResolver) 1504public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 1509Type sourceType = value.GetType(); 1589Type sourceType = value.GetType(); 1634Type sourceType = value.GetType(); 1723Type sourceType = value.GetType(); 1738public override object ChangeType(DateTime value, Type destinationType) 1752public override object ChangeType(DateTimeOffset value, Type destinationType) 1766public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver nsResolver) 1781public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 1786Type sourceType = value.GetType(); 1843Type sourceType = value.GetType(); 1913Type sourceType = value.GetType(); 1927public override object ChangeType(bool value, Type destinationType) 1940public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver nsResolver) 1954public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 1959Type sourceType = value.GetType(); 2058Type sourceType = value.GetType(); 2096public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver nsResolver) 2134public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 2139Type sourceType = value.GetType(); 2253private object ChangeTypeWildcardDestination(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 2255Type sourceType = value.GetType(); 2261private object ChangeTypeWildcardSource(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 2346Type sourceType = value.GetType(); 2359public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver nsResolver) 2372public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 2377Type sourceType = value.GetType(); 2430Type sourceType = value.GetType(); 2452Type sourceType = value.GetType(); 2474Type sourceType = value.GetType(); 2495Type sourceType = value.GetType(); 2517Type sourceType = value.GetType(); 2539Type sourceType = value.GetType(); 2561Type sourceType = value.GetType(); 2583Type sourceType = value.GetType(); 2637Type sourceType = value.GetType(); 2668public override object ChangeType(bool value, Type destinationType) 2678public override object ChangeType(DateTime value, Type destinationType) 2688public override object ChangeType(DateTimeOffset value, Type destinationType) 2698public override object ChangeType(decimal value, Type destinationType) 2708public override object ChangeType(double value, Type destinationType) 2718public override object ChangeType(int value, Type destinationType) 2728public override object ChangeType(long value, Type destinationType) 2738public override object ChangeType(float value, Type destinationType) 2748public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver nsResolver) 2779public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 2784Type sourceType = value.GetType(); 2882private object ChangeTypeWildcardDestination(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 2884Type sourceType = value.GetType(); 2890private object ChangeTypeWildcardSource(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 2904protected override object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 2906Type sourceType = value.GetType(); 2924private bool SupportsType(Type clrType) 3019public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 3024Type sourceType = value.GetType(); 3060Type sourceType = value.GetType(); 3076Type sourceType = value.GetType(); 3091Type sourceType = value.GetType(); 3107Type sourceType = value.GetType(); 3123Type sourceType = value.GetType(); 3139Type sourceType = value.GetType(); 3155Type sourceType = value.GetType(); 3171Type sourceType = value.GetType(); 3190public override object ChangeType(bool value, Type destinationType) 3200public override object ChangeType(DateTime value, Type destinationType) 3210public override object ChangeType(DateTimeOffset value, Type destinationType) 3220public override object ChangeType(decimal value, Type destinationType) 3230public override object ChangeType(double value, Type destinationType) 3240public override object ChangeType(int value, Type destinationType) 3250public override object ChangeType(long value, Type destinationType) 3260public override object ChangeType(float value, Type destinationType) 3270public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver nsResolver) 3281public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 3286Type sourceType = value.GetType(); 3364private object ChangeTypeWildcardDestination(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 3366Type sourceType = value.GetType(); 3372private object ChangeTypeWildcardSource(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 3406public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 3431protected XmlListConverter(XmlBaseConverter atomicConverter, Type clrTypeDefault) : base(atomicConverter, clrTypeDefault) 3462public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 3475protected override object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 3477Type sourceType = value.GetType(); 3504Type itemTypeDst = destinationType.GetElementType(); 3554private bool IsListType(Type type) 3657private new Exception CreateInvalidClrMappingException(Type sourceType, Type destinationType) 3704public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver) 3709Type sourceType = value.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\Advanced\SchemaImporterExtension.cs (1)
71public int Add(string name, Type type)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeExporter.cs (7)
120internal static CodeAttributeDeclaration FindAttributeDeclaration(Type type, CodeAttributeDeclarationCollection metadata) 180internal void ExportRoot(StructMapping mapping, Type includeType) 239internal CodeTypeDeclaration ExportEnum(EnumMapping mapping, Type type) 265internal void AddTypeMetadata(CodeAttributeDeclarationCollection metadata, Type type, string defaultName, string name, string ns, bool includeInSchema) 293internal static void AddIncludeMetadata(CodeAttributeDeclarationCollection metadata, StructMapping mapping, Type type) 306internal static void ExportConstant(CodeTypeDeclaration codeClass, ConstantMapping constant, Type type, bool init, long enumValue) 321internal static object PromoteType(Type type, object value)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (81)
31internal static Type[] EmptyTypeArray = new Type[] { }; 41private Dictionary<Tuple<Type, string>, Queue<LocalBuilder>> _freeLocals; 51internal static bool IsNullableGenericType(Type type) 56internal static void AssertHasInterface(Type type, Type iType) 61internal void BeginMethod(Type returnType, string methodName, Type[] argTypes, string[] argNames, MethodAttributes methodAttributes) 68internal void BeginMethod(Type returnType, MethodBuilderInfo methodBuilderInfo, Type[] argTypes, string[] argNames, MethodAttributes methodAttributes) 78private void InitILGeneration(Type[] argTypes, string[] argNames, bool isStatic) 85_freeLocals = new Dictionary<Tuple<Type, string>, Queue<LocalBuilder>>(); 155private Dictionary<Type, LocalBuilder> _tmpLocals = new Dictionary<Type, LocalBuilder>(); 156internal LocalBuilder GetTempLocal(Type type) 167internal Type GetVariableType(object var) 231private bool TryDequeueLocal(Type type, string name, out LocalBuilder local) 238Tuple<Type, string> key = new Tuple<Type, string>(type, name); 255internal LocalBuilder DeclareLocal(Type type, string name) 267internal LocalBuilder DeclareOrGetLocal(Type type, string name) 324Type varType = GetVariableType(forState.End); 540internal void BeginCatchBlock(Type exception) 663internal void InitObj(Type valueType) 668internal void NewArray(Type elementType, object len) 683Type objType = GetVariableType(obj).GetElementType(); 697Type arrayType = GetVariableType(obj); 701Call(typeof(Array).GetMethod("SetValue", new Type[] { typeof(object), typeof(int) })); 705Type objType = arrayType.GetElementType(); 719private static bool IsStruct(Type objType) 725internal Type LoadMember(object obj, MemberInfo memberInfo) 738Type currentType = propertyInfo.DeclaringType.GetTypeInfo().BaseType; 772internal Type LoadMember(MemberInfo memberInfo) 774Type memberType = null; 810internal Type LoadMemberAddress(MemberInfo memberInfo) 812Type memberType = null; 979internal void ConvertAddress(Type source, Type target) 984internal void ConvertValue(Type source, Type target) 989internal void Castclass(Type target) 994internal void Box(Type type) 999internal void Unbox(Type type) 1064internal void Ldobj(Type type) 1066OpCode opCode = GetLdindOpCode(Type.GetTypeCode(type)); 1077internal void Stobj(Type type) 1116internal void Ldtoken(Type t) 1123Type valueType = o.GetType(); 1124if (o is Type) 1126Ldtoken((Type)o); 1127Call(typeof(Type).GetMethod("GetTypeFromHandle", BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(RuntimeTypeHandle) }, null)); 1135switch (Type.GetTypeCode(valueType)) 1172new Type[] { typeof(Int32), typeof(Int32), typeof(Int32), typeof(Boolean), typeof(Byte) } 1184ConstructorInfo DateTime_ctor = typeof(DateTime).GetConstructor(new Type[] { typeof(Int64) }); 1293internal void Stloc(Type type, string name) 1309internal void Ldloc(Type type, string name) 1520internal void Ldelem(Type arrayElementType) 1528OpCode opCode = GetLdelemOpCode(Type.GetTypeCode(arrayElementType)); 1535internal void Ldelema(Type arrayElementType) 1602internal void Stelem(Type arrayElementType) 1608OpCode opCode = GetStelemOpCode(Type.GetTypeCode(arrayElementType)); 1787private void InternalConvert(Type source, Type target, bool isAddress) 1797OpCode opCode = GetConvOpCode(Type.GetTypeCode(target)); 1857static internal TypeBuilder CreateTypeBuilder(ModuleBuilder moduleBuilder, string name, TypeAttributes attributes, Type parent, Type[] interfaces) 2195internal void IsInst(Type type) 2552internal Type ArgType; 2553internal ArgBuilder(string name, int index, Type argType) 2706public void AddToFreeLocals(Dictionary<Tuple<Type, string>, Queue<LocalBuilder>> freeLocals) 2710Tuple<Type, string> key = new Tuple<Type, string>(item.Value.LocalType, item.Key); 2868public readonly Type[] ParameterTypes; 2869public MethodBuilderInfo(MethodBuilder methodBuilder, Type[] parameterTypes) 2875public void Validate(Type returnType, Type[] parameterTypes, MethodAttributes attributes) 2891private Type _sourceType; 2892private Type _targetType; 2896public CodeGeneratorConversionException(Type sourceType, Type targetType, bool isAddress, string reason)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeIdentifier.cs (5)
174private static int GetCSharpName(Type t, Type[] parameters, int index, StringBuilder sb) 209internal static string GetCSharpName(Type t) 231Type[] arguments = info.IsGenericType || info.ContainsGenericParameters ? t.GetGenericArguments() : new Type[0];
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeIdentifiers.cs (1)
183public object ToArray(Type type)
FrameworkFork\Microsoft.Xml\Xml\Serialization\Compilation.cs (5)
48internal TempAssembly(XmlMapping[] xmlMappings, Type[] types, string defaultNamespace, string location) 96internal static Assembly LoadGeneratedAssembly(Type type, string defaultNamespace, out XmlSerializerImplementation contract) 105private static MethodInfo GetMethodFromType(Type type, string methodName, Assembly assembly) 119internal static Type GetTypeFromAssembly(Assembly assembly, string typeName) 122Type type = assembly.GetType(typeName);
FrameworkFork\Microsoft.Xml\Xml\Serialization\ImportContext.cs (1)
335Type t = item.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\Mappings.cs (2)
1109private Type _type; 1224internal Type Type
FrameworkFork\Microsoft.Xml\Xml\Serialization\Models.cs (18)
33internal TypeModel GetTypeModel(Type type) 38internal TypeModel GetTypeModel(Type type, bool directReference) 72internal ArrayModel GetArrayModel(Type type) 92private Type _type; 95protected TypeModel(Type type, TypeDesc typeDesc, ModelScope scope) 102internal Type Type 120internal ArrayModel(Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } 130internal PrimitiveModel(Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } 135internal SpecialModel(Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } 140internal StructModel(Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } 185private void CheckSupportedMember(TypeDesc typeDesc, MemberInfo member, Type type) 258private Type _fieldType; 262internal FieldModel(string name, Type fieldType, TypeDesc fieldTypeDesc, bool checkSpecified, bool checkShouldPersist) : 266internal FieldModel(string name, Type fieldType, TypeDesc fieldTypeDesc, bool checkSpecified, bool checkShouldPersist, bool readOnly) 276internal FieldModel(MemberInfo memberInfo, Type fieldType, TypeDesc fieldTypeDesc) 282_checkShouldPersistMethodInfo = memberInfo.DeclaringType.GetMethod("ShouldSerialize" + memberInfo.Name, new Type[0]); 327internal Type FieldType 402internal EnumModel(Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { }
FrameworkFork\Microsoft.Xml\Xml\Serialization\NameTable.cs (1)
93internal Array ToArray(Type type)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SchemaImporter.cs (1)
150internal void MakeDerived(StructMapping structMapping, Type baseType, bool baseTypeCanBeIndirect)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SchemaObjectWriter.cs (7)
337System.Type t = o.GetType(); 972System.Type t = o.GetType(); 1034System.Type t = o.GetType(); 1057System.Type t = o.GetType(); 1089System.Type t = o.GetType(); 1115System.Type t = o.GetType(); 1137System.Type t = o.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapAttributeOverrides.cs (4)
26public void Add(Type type, SoapAttributes attributes) 35public void Add(Type type, string member, SoapAttributes attributes) 54public SoapAttributes this[Type type] 66public SoapAttributes this[Type type, string member]
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapIncludeAttribute.cs (3)
16private Type _type; 22public SoapIncludeAttribute(Type type) 31public Type Type
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapReflectionImporter.cs (14)
72public void IncludeTypes(Type provider) 76private void IncludeTypes(Type provider, RecursionLimiter limiter) 88public void IncludeType(Type type) 93private void IncludeType(Type type, RecursionLimiter limiter) 102public XmlTypeMapping ImportTypeMapping(Type type) 111public XmlTypeMapping ImportTypeMapping(Type type, string defaultNamespace) 177private SoapAttributes GetAttributes(Type type) 288private NullableMapping CreateNullableMapping(TypeMapping baseMapping, Type type) 711Type accessorType = model.FieldType; 786internal string XsdTypeName(Type type) 794internal string XsdTypeName(Type type, SoapAttributes a, string name) 802Type genType = type.GetGenericTypeDefinition(); 803Type[] names = genType.GetGenericArguments(); 804Type[] types = type.GetGenericArguments();
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapSchemaImporter.cs (2)
57public XmlTypeMapping ImportDerivedTypeMapping(XmlQualifiedName name, Type baseType, bool baseTypeCanBeIndirect) 125public XmlMembersMapping ImportMembersMapping(string name, string ns, SoapSchemaMember[] members, bool hasWrapperElement, Type baseType, bool baseTypeCanBeIndirect)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (16)
29new Type[] { typeof(Int32) }, 37public readonly Type Type; 40public SourceInfo(string source, string arg, MemberInfo memberInfo, Type type, CodeGenerator ilg) 54public void LoadAddress(Type elementType) 59public void Load(Type elementType) 64private void InternalLoad(Type elementType, bool asAddress = false) 70Type varType = ILG.GetVariableType(varA); 76Type eType = varType.GetElementType(); 106new Type[] { typeof(Int32) }, 117Type eType = get_Item.ReturnType; 142Type varType; 174Type memberType = (MemberInfo is FieldInfo) ? 205private void Convert(Type sourceType, Type targetType, bool asAddress) 216private void ConvertNullableValue(Type nullableType, Type targetType)
FrameworkFork\Microsoft.Xml\Xml\Serialization\TypeExtensions.cs (2)
15public static bool TryConvertTo(this Type targetType, object data, out object returnValue) 29Type sourceType = data.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (44)
82private Type _type; 118internal TypeDesc(Type type, bool isXsdType, XmlSchemaType dataType, string formatterName, TypeFlags flags) 124internal TypeDesc(Type type, string name, string fullName, TypeKind kind, TypeDesc baseTypeDesc, TypeFlags flags, TypeDesc arrayElementTypeDesc) 183internal Type Type 365internal TypeDesc GetNullableTypeDesc(Type type) 574internal static bool IsKnownType(Type type) 580switch (Type.GetTypeCode(type)) 653private static void AddPrimitive(Type type, string dataTypeName, string formatterName, TypeFlags flags) 664private static void AddNonXsdPrimitive(Type type, string dataTypeName, string ns, string formatterName, XmlQualifiedName baseTypeName, XmlSchemaFacet[] facets, TypeFlags flags) 682private static void AddSoapEncodedPrimitive(Type type, string dataTypeName, string ns, string formatterName, XmlQualifiedName baseTypeName, TypeFlags flags) 710internal TypeDesc GetTypeDesc(Type type) 715internal TypeDesc GetTypeDesc(Type type, MemberInfo source) 720internal TypeDesc GetTypeDesc(Type type, MemberInfo source, bool directReference) 725internal TypeDesc GetTypeDesc(Type type, MemberInfo source, bool directReference, bool throwOnError) 747internal TypeDesc GetArrayTypeDesc(Type type) 771internal Type GetTypeFromTypeDesc(TypeDesc typeDesc) 778return de.Key as Type; 783private TypeDesc ImportTypeDesc(Type type, MemberInfo memberInfo, bool directReference) 787Type arrayElementType = null; 788Type baseType = null; 990Type t = type.DeclaringType; 997private static bool IsArraySegment(Type t) 1002internal static bool IsOptionalValue(Type type) 1021internal static string TypeName(Type t) 1039Type[] arguments = t.GetGenericArguments(); 1057internal static Type GetArrayElementType(Type type, string memberInfo) 1209private static bool ShouldBeReplaced(MemberInfo memberInfoToBeReplaced, Type derivedType, out MemberInfo replacedInfo) 1212Type currentType = derivedType; 1213Type typeToBeReplaced = memberInfoToBeReplaced.DeclaringType; 1254private static TypeFlags GetConstructorFlags(Type type, ref Exception exception) 1256ConstructorInfo ctor = type.GetConstructor(new Type[0]); 1277private static Type GetEnumeratorElementType(Type type, ref TypeFlags flags) 1281MethodInfo enumerator = type.GetMethod("GetEnumerator", new Type[0]); 1305enumerator = type.GetMethod("System.Collections.IEnumerable.GetEnumerator", BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[0], null); 1319Type currentType = (p == null ? typeof(object) : p.PropertyType); 1321MethodInfo addMethod = type.GetMethod("Add", new Type[] { currentType }); 1326addMethod = type.GetMethod("Add", new Type[] { currentType }); 1340internal static PropertyInfo GetDefaultIndexer(Type type, string memberInfo) 1358for (Type t = type; t != null; t = t.GetTypeInfo().BaseType) 1383MethodInfo addMethod = type.GetMethod("Add", new Type[] { indexer.PropertyType }); 1390private static Type GetCollectionElementType(Type type, string memberInfo)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlArrayItemAttribute.cs (4)
18private Type _type; 47public XmlArrayItemAttribute(Type type) 56public XmlArrayItemAttribute(string elementName, Type type) 66public Type Type
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlAttributeAttribute.cs (4)
18private Type _type; 44public XmlAttributeAttribute(Type type) 53public XmlAttributeAttribute(string attributeName, Type type) 63public Type Type
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlAttributeOverrides.cs (4)
26public void Add(Type type, XmlAttributes attributes) 35public void Add(Type type, string member, XmlAttributes attributes) 54public XmlAttributes this[Type type] 66public XmlAttributes this[Type type, string member]
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlAttributes.cs (2)
48private static volatile Type s_ignoreAttributeType; 80private static Type IgnoreAttribute
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlCodeExporter.cs (4)
218Type type = value.GetType(); 400Type formatter = typeof(XmlConvert); 402MethodInfo format = formatter.GetMethod("To" + pm.TypeDesc.FormatterName, new Type[] { typeof(string) }); 891private void ExportMetadata(CodeAttributeDeclarationCollection metadata, Type attributeType, string name, string ns, TypeDesc typeDesc, TypeDesc dataTypeDesc, object isNullable, XmlSchemaForm form, int nestingLevel, int sequenceId)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlCountingReader.cs (4)
53public override Type ValueType { get { return _innerReader.ValueType; } } 147public override object ReadContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver) 222public override object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver) 227public override object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver, string localName, string namespaceURI)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlCustomFormatter.cs (1)
24Type type = value.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlElementAttribute.cs (4)
18private Type _type; 47public XmlElementAttribute(Type type) 56public XmlElementAttribute(string elementName, Type type) 66public Type Type
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlIncludeAttribute.cs (3)
16private Type _type; 22public XmlIncludeAttribute(Type type) 31public Type Type
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlMapping.cs (1)
122internal static string GenerateKey(Type type, XmlRootAttribute root, string ns)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionImporter.cs (45)
94public void IncludeTypes(Type provider) 99private void IncludeTypes(Type provider, RecursionLimiter limiter) 103Type type = attrib.Type; 112public void IncludeType(Type type) 117private void IncludeType(Type type, RecursionLimiter limiter) 141public XmlTypeMapping ImportTypeMapping(Type type) 150public XmlTypeMapping ImportTypeMapping(Type type, string defaultNamespace) 159public XmlTypeMapping ImportTypeMapping(Type type, XmlRootAttribute root) 168public XmlTypeMapping ImportTypeMapping(Type type, XmlRootAttribute root, string defaultNamespace) 240private XmlAttributes GetAttributes(Type type, bool canBeSimpleType) 477internal static MethodInfo GetMethodFromSchemaProvider(XmlSchemaProviderAttribute provider, Type type) 491MethodInfo getMethod = getMethod = type.GetMethod(provider.MethodName, /* BindingFlags.DeclaredOnly | */ BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(XmlSchemaSet) }, null); 501private SpecialMapping ImportSpecialMapping(Type type, TypeDesc typeDesc, string ns, ImportContext context, RecursionLimiter limiter) 626private static Exception InvalidAttributeUseException(Type type) 648private NullableMapping CreateNullableMapping(TypeMapping baseMapping, Type type) 712private TypeMapping GetTypeMapping(string typeName, string ns, TypeDesc typeDesc, NameTable typeLib, Type type) 953internal string XsdTypeName(Type type) 962internal string XsdTypeName(Type type, XmlAttributes a, string name) 970Type genType = type.GetGenericTypeDefinition(); 971Type[] names = genType.GetGenericArguments(); 972Type[] types = type.GetGenericArguments(); 999private void SetArrayMappingType(ArrayMapping mapping, string defaultNs, Type type) 1380Type choiceIdentifierType = null; 1409Type choiceIdentifierType = null; 1418private Type CheckChoiceIdentifierType(Type type, bool isArrayLike, string identifierName, string memberName) 1443private Type GetChoiceIdentifierType(XmlChoiceIdentifierAttribute choice, XmlReflectionMember[] xmlReflectionMembers, bool isArrayLike, string accessorName) 1456private Type GetChoiceIdentifierType(XmlChoiceIdentifierAttribute choice, StructModel structModel, bool isArrayLike, string accessorName) 1486Type enumType = member.FieldType; 1491private void CreateArrayElementsFromAttributes(ArrayMapping arrayMapping, XmlArrayItemAttributes attributes, Type arrayElementType, string arrayElementNs, RecursionLimiter limiter) 1500Type targetType = xmlArrayItem.Type != null ? xmlArrayItem.Type : arrayElementType; 1515private void ImportAccessorMapping(MemberMapping accessor, FieldModel model, XmlAttributes a, string ns, Type choiceIdentifierType, bool rpc, bool openModel, RecursionLimiter limiter) 1525Type accessorType = model.FieldType; 1557Type arrayElementType = TypeScope.GetArrayElementType(accessorType, model.FieldTypeDesc.FullName + "." + model.Name); 1584Type targetType = a.XmlAttribute.Type == null ? arrayElementType : a.XmlAttribute.Type; 1615Type targetType = a.XmlText.Type == null ? arrayElementType : a.XmlText.Type; 1630Type targetType = xmlElement.Type == null ? arrayElementType : xmlElement.Type; 1671Type targetType = typeof(IXmlSerializable).IsAssignableFrom(arrayElementType) ? arrayElementType : typeof(XmlNode).IsAssignableFrom(arrayElementType) ? arrayElementType : typeof(XmlElement); 1874Type targetType = xmlElement.Type == null ? accessorType : xmlElement.Type; 1914Type targetType = typeof(IXmlSerializable).IsAssignableFrom(accessorType) ? accessorType : typeof(XmlNode).IsAssignableFrom(accessorType) ? accessorType : typeof(XmlElement); 2065private void CheckAmbiguousChoice(XmlAttributes a, Type accessorType, string accessorName) 2074Type type = elements[i].Type == null ? accessorType : elements[i].Type; 2099Type type = items[i].Type == null ? accessorType : items[i].Type; 2133private object GetDefaultValue(TypeDesc fieldTypeDesc, Type t, XmlAttributes a) 2247internal static XmlTypeMapping GetTopLevelMapping(Type type, string defaultNamespace)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionMember.cs (2)
17private Type _type; 27public Type MemberType
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemaExporter.cs (2)
966Type formatter = typeof(XmlConvert); 967System.Reflection.MethodInfo format = formatter.GetMethod("ToString", new Type[] { pm.TypeDesc.Type });
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemaImporter.cs (18)
68public XmlTypeMapping ImportDerivedTypeMapping(XmlQualifiedName name, Type baseType) 91public XmlTypeMapping ImportDerivedTypeMapping(XmlQualifiedName name, Type baseType, bool baseTypeCanBeIndirect) 130public XmlTypeMapping ImportSchemaType(XmlQualifiedName typeName, Type baseType) 139public XmlTypeMapping ImportSchemaType(XmlQualifiedName typeName, Type baseType, bool baseTypeCanBeIndirect) 247public XmlMembersMapping ImportMembersMapping(XmlQualifiedName[] names, Type baseType, bool baseTypeCanBeIndirect) 298private ElementAccessor ImportElement(XmlQualifiedName name, Type desiredMappingType, Type baseType) 313private ElementAccessor ImportElement(XmlSchemaElement element, string identifier, Type desiredMappingType, Type baseType, string ns, bool topLevelElement) 371private TypeMapping ImportElementType(XmlSchemaElement element, string identifier, Type desiredMappingType, Type baseType, string ns) 526private TypeMapping ImportType(XmlQualifiedName name, Type desiredMappingType, Type baseType, TypeFlags flags, bool addref) 553private TypeMapping ImportType(XmlSchemaComplexType type, string typeNs, string identifier, Type desiredMappingType, Type baseType, TypeFlags flags) 600private StructMapping ImportStructType(XmlSchemaType type, string typeNs, string identifier, Type baseType, bool arrayLike) 709private StructMapping ImportStructDataType(XmlSchemaSimpleType dataType, string typeNs, string identifier, Type baseType) 1765private TypeMapping ImportDataType(XmlSchemaSimpleType dataType, string typeNs, string identifier, Type baseType, TypeFlags flags, bool isList)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemas.cs (3)
313public object Find(XmlQualifiedName name, Type type) 317internal object Find(XmlQualifiedName name, Type type, bool checkCache) 709Type type = o.GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationGeneratedCode.cs (3)
179internal void GenerateSupportedTypes(Type[] types) 184_writer.Write(typeof(Type).FullName); 190Type type = types[i];
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (24)
21internal Dictionary<string, Type> CreatedTypes = new Dictionary<string, Type>(); 83MethodAttributes attributes, Type returnType, Type[] parameterTypes) 208new Type[] { typeof(Object), typeof(Object) }, 225internal void GenerateSupportedTypes(Type[] types, TypeBuilder serializerContractTypeBuilder) 231new Type[] { typeof(Type) }, 237Type type = types[i]; 298Type baseSerializerType = baseSerializerTypeBuilder.CreateTypeInfo().AsType(); 321new Type[] { typeof(XmlReader) }, 338new Type[] { typeof(String), typeof(String) }, 358new Type[] { typeof(object), typeof(XmlSerializationWriter) }, 365new Type[] { (mapping is XmlMembersMapping) ? typeof(object[]) : typeof(object) }, 384new Type[] { typeof(XmlSerializationReader) }, 400Type typedSerializerType = typedSerializerTypeBuilder.CreateTypeInfo().AsType(); 414new Type[] { typeof(Object), typeof(Object) }, 438new Type[] { typeof(Type) }, 446Type type = xmlMappings[i].Accessor.Mapping.TypeDesc.Type; 476internal void GenerateSerializerContract(string className, XmlMapping[] xmlMappings, Type[] types, string readerType, string[] readMethods, string writerType, string[] writerMethods, Hashtable serializers) 554Type serializerContractType = serializerContractTypeBuilder.CreateTypeInfo().AsType(); 568internal void ILGenLoad(string source, Type type) 577Type memType = memInfo is FieldInfo ? ((FieldInfo)memInfo).FieldType : ((PropertyInfo)memInfo).PropertyType;
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationReader.cs (14)
295private Type GetPrimitiveType(XmlQualifiedName typeName, bool throwOnUnknown) 1399protected Exception CreateUnknownConstantException(string value, Type enumType) 1405protected Exception CreateInvalidCastException(Type type, object value) 1411protected Exception CreateInvalidCastException(Type type, object value, string id) 1435protected Array EnsureArrayIndex(Array a, int index, Type elementType) 1445protected Array ShrinkArray(Array a, int length, Type elementType, bool isNullable) 1657Type fallbackElementType = null; 1662Type arrayType = (Type)_types[new XmlQualifiedName(typeName, typeNs)]; 1687Type elementType = null; 1692elementType = (Type)_types[qname]; 1821Type itemType = null; 1827Type currItemType = currItem.GetType(); 1954protected void AddReadCallback(string name, string ns, Type type, XmlSerializationReadCallback read)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (46)
189private XmlQualifiedName GetPrimitiveTypeName(Type type) 194private XmlQualifiedName GetPrimitiveTypeName(Type type, bool throwIfUnknown) 202internal static XmlQualifiedName GetPrimitiveTypeNameInternal(Type type) 207switch (Type.GetTypeCode(type)) 254Type t = o.GetType(); 257switch (Type.GetTypeCode(t)) 814protected Exception CreateUnknownTypeException(Type type) 861protected Exception CreateInvalidAnyTypeException(Type type) 1211protected void AddWriteCallback(Type type, string typeName, string typeNs, XmlSerializationWriteCallback callback) 1221private void WriteArray(string name, string ns, object o, Type type) 1223Type elementType = TypeScope.GetArrayElementType(type, null); 1260Type elementBaseType = elementType.GetTypeInfo().BaseType; 1352protected void WritePotentiallyReferencingElement(string n, string ns, object o, Type ambientType) 1358protected void WritePotentiallyReferencingElement(string n, string ns, object o, Type ambientType, bool suppressReference) 1364protected void WritePotentiallyReferencingElement(string n, string ns, object o, Type ambientType, bool suppressReference, bool isNullable) 1371Type t = o.GetType(); 1413private void WriteReferencedElement(object o, Type ambientType) 1418private void WriteReferencedElement(string name, string ns, object o, Type ambientType) 1421Type t = o.GetType(); 1438private TypeEntry GetTypeEntry(Type t) 1512internal Type type; 2379Writer.Write(typeof(Type).FullName); 3445private void WriteElementCall(string func, Type cast, string source, string name, string ns, bool isNullable, bool isAny) 3524Type type = value.GetType(); 3526switch (Type.GetTypeCode(type)) 3718internal static bool IsTypeDynamic(Type type) 3734Type[] parameterTypes = type.GetGenericArguments(); 3739Type parameterType = parameterTypes[i]; 3756internal static bool IsTypeDynamic(Type[] arguments) 3758foreach (Type t in arguments) 3834foreach (Type type in scope.Types) 3842private string WriteTypeInfo(TypeScope scope, TypeDesc typeDesc, Type type) 3857_writer.WriteLine("static " + typeof(Type).FullName + " " + typeVariable + " = " + elementTypeVariable + ".MakeArrayType();"); 3862_writer.Write("static " + typeof(Type).FullName + " " + typeVariable + " = " + assemblyVariable + ".GetType("); 3871Type parameterType = Nullable.GetUnderlyingType(type); 3875_writer.WriteLine("static " + typeof(Type).FullName + " " + typeVariable + " = typeof(System.Nullable<>).MakeGenericType(new " + typeof(Type).FullName + "[] {" + parameterTypeVariable + "});"); 3880_writer.Write("static " + typeof(Type).FullName + " " + typeVariable + " = " + assemblyVariable + ".GetType("); 3907"object", "string", typeof(Type).FullName, 3915private void WriteMappingInfo(TypeMapping mapping, string typeVariable, Type type) 3951private void WriteCollectionInfo(string typeVariable, TypeDesc typeDesc, Type type) 3974private string WriteAssemblyInfo(Type type) 3993private string WriteMemberInfo(Type type, string escapedName, string typeVariable, string memberName) 4043_writer.Write("new " + typeof(Type).FullName + "[] { "); 4055private string WriteDefaultIndexerInit(Type type, string escapedName, bool collectionUseReflection, bool elementUseReflection) 4069_writer.Write(typeof(Type[]).FullName);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (91)
61internal Type GenerateEnd() 99List<Type> argTypes = new List<Type>(); 126private void WriteEnumValue(EnumMapping mapping, SourceInfo source, out Type returnType) 141new Type[] { mapping.TypeDesc.Type }); 148private void WritePrimitiveValue(TypeDesc typeDesc, SourceInfo source, out Type returnType) 159Type argType = typeDesc.Type; 164new Type[] { argType }, 184new Type[] { typeDesc.Type }, 233List<Type> argTypes = new List<Type>(); 242Type argType; 258ConstructorInfo XmlQualifiedName_ctor = typeof(XmlQualifiedName).GetConstructor(new Type[] { typeof(String), typeof(String) }); 286new Type[] { typeof(String), typeof(String) }, 301new Type[] { typeof(string), typeof(string), typeof(object), typeof(Boolean) }, 335new Type[] { typeof(Object) }, 366new Type[] { typeof(object[]) }, 563new Type[] { typeof(object) }, 615List<Type> argTypes = new List<Type>(); 700new Type[] { typeof(Int64), typeof(String[]), typeof(Int64[]), typeof(String) }, 729new Type[] { typeof(IFormatProvider) }, 736new Type[] { typeof(object), typeof(string) }, 775List<Type> argTypes = new List<Type>(); 782Type oType = ilg.GetVariableType(oVar); 836new Type[] { typeof(String), typeof(String) }, 848new Type[] { typeof(String), typeof(String) }, 859new Type[] { mapping.TypeDesc.Type } 865new Type[] { typeof(String) }, 912new Type[] { typeof(String), typeof(String) }, 924new Type[] { typeof(String), typeof(String) }, 956List<Type> argTypes = new List<Type>(5); 986new Type[] { typeof(String), typeof(String) }, 1001LocalBuilder tLoc = ilg.DeclareLocal(typeof(Type), "t"); 1027new Type[] { typeof(String), typeof(String), typeof(Object), typeof(Boolean) }, 1044new Type[] { typeof(Object) }, 1064new Type[] { typeof(Boolean) }, 1101new Type[] { typeof(String), typeof(String), typeof(Object), typeof(Boolean), typeof(XmlSerializerNamespaces) }, 1113new Type[] { typeof(String), typeof(String) }, 1240new Type[] { typeof(String), typeof(String), typeof(String) }, 1282Type methodType; 1283Type argType = typeof(string); 1301new Type[] { typeof(String) }, 1319new Type[] { typeof(string) }, 1342new Type[] { argType }, 1394List<Type> argTypes = new List<Type>(); 1449new Type[] { typeof(XmlNode), typeof(Object) }, 1469private static object GetConvertedDefaultValue(Type targetType, object rawDefaultValue) 1538new Type[] { typeof(String), typeof(String) }, 1582Type typeIEnumerable = arrayTypeDesc.IsGenericInterface ? typeof(IEnumerable<>).MakeGenericType(arrayElementTypeDesc.Type) : typeof(IEnumerable); 1818new Type[] { typeof(string), typeof(string) }, 1843new Type[] { typeof(String), typeof(String), typeof(String), typeof(String) }, 1872new Type[] { typeof(String), typeof(String) }, 1937new Type[] { typeof(Object) }, 1958Type argType; 1972new Type[] { argType }, 1987new Type[] { typeof(XmlWriter) }, 2113List<Type> argTypes = new List<Type>(); 2171new Type[] { typeof(Object) }, 2188private void WriteElementCall(string func, Type cast, SourceInfo source, string name, string ns, bool isNullable, bool isAny) 2194new Type[] { cast, typeof(String), typeof(String), typeof(Boolean), typeof(Boolean) }, 2262Type valueType = value.GetType(); 2269new Type[] { valueType, valueType }, 2301new Type[] { typeof(String), typeof(String), typeof(String) }, 2331new Type[] { typeof(XmlSerializerNamespaces) }, 2351private void WriteLocalDecl(string variableName, string initValue, Type type) 2360private void WriteTypeCompare(string variable, Type type) 2364private void WriteInstanceOf(SourceInfo source, Type type) 2368private void WriteArrayTypeCompare(string variable, Type arrayType) 2446foreach (Type type in scope.Types) 2492internal void ILGenForEnumMember(CodeGenerator ilg, Type type, string memberName) 2506internal void ILGenForCreateInstance(CodeGenerator ilg, Type type, bool ctorInaccessible, bool cast) 2527internal void ILGenForCreateInstance(CodeGenerator ilg, Type type, Type cast, bool nonPublic) 2541Type xName = type.GetTypeInfo().Assembly.GetType("System.Xml.Linq.XName"); 2548new Type[] { typeof(String) }, 2551ConstructorInfo XElement_ctor = type.GetConstructor(new Type[] { xName }); 2573new Type[] { typeof(Type), typeof(BindingFlags), typeof(Binder), typeof(Object[]), typeof(CultureInfo) }, 2588Type localType = initValue.Type; 2627internal void WriteCreateInstance(string source, bool ctorInaccessible, Type type, CodeGenerator ilg) 2633internal void WriteInstanceOf(SourceInfo source, Type type, CodeGenerator ilg) 2647Type localType = (typeName == arrayTypeDesc.CSharpName) ? arrayTypeDesc.Type : arrayTypeDesc.Type.MakeArrayType(); 2656internal void WriteTypeCompare(string variable, Type type, CodeGenerator ilg) 2660ilg.Ldloc(typeof(Type), variable); 2664internal void WriteArrayTypeCompare(string variable, Type arrayType, CodeGenerator ilg) 2669ilg.Ldloc(typeof(Type), variable);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializer.cs (30)
107public virtual bool CanSerialize(Type type) { throw new NotSupportedException(); } 109public virtual XmlSerializer GetSerializer(Type type) { throw new NotSupportedException(); } 120private Type _primitiveType; 156public XmlSerializer(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, string defaultNamespace) : 165public XmlSerializer(Type type, XmlRootAttribute root) : this(type, null, new Type[0], root, null, null) 173public XmlSerializer(Type type, Type[] extraTypes) : this(type, null, extraTypes, null, null, null) 181public XmlSerializer(Type type, XmlAttributeOverrides overrides) : this(type, overrides, new Type[0], null, null, null) 199public XmlSerializer(Type type) : this(type, (string)null) 207public XmlSerializer(Type type, string defaultNamespace) 255internal XmlSerializer(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, string defaultNamespace, string location) 284internal static TempAssembly GenerateTempAssembly(XmlMapping xmlMapping, Type type, string defaultNamespace) 288return new TempAssembly(new XmlMapping[] { xmlMapping }, new Type[] { type }, defaultNamespace, null); 291internal static TempAssembly GenerateTempAssembly(XmlMapping xmlMapping, Type type, string defaultNamespace, string location) 293return new TempAssembly(new XmlMapping[] { xmlMapping }, new Type[] { type }, defaultNamespace, location); 531return FromMappings(mappings, (Type)null); 539public static XmlSerializer[] FromMappings(XmlMapping[] mappings, Type type) 555tempAssembly = new TempAssembly(mappings, new Type[] { type }, null, null); 584private static XmlSerializer[] GetSerializersFromCache(XmlMapping[] mappings, Type type) 621TempAssembly tempAssembly = new TempAssembly(pendingMappings, new Type[] { type }, null, null); 642public static XmlSerializer[] FromTypes(Type[] types) 661public static string GetXmlSerializerAssemblyName(Type type) 671public static string GetXmlSerializerAssemblyName(Type type, string defaultNamespace) 758private static XmlTypeMapping GetKnownMapping(Type type, string ns) 776switch (Type.GetTypeCode(_primitiveType)) 850switch (Type.GetTypeCode(_primitiveType))
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializerFactory.cs (12)
34public XmlSerializer CreateSerializer(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, string defaultNamespace) 43public XmlSerializer CreateSerializer(Type type, XmlRootAttribute root) 45return CreateSerializer(type, null, new Type[0], root, null, null); 52public XmlSerializer CreateSerializer(Type type, Type[] extraTypes) 61public XmlSerializer CreateSerializer(Type type, XmlAttributeOverrides overrides) 63return CreateSerializer(type, overrides, new Type[0], null, null, null); 80public XmlSerializer CreateSerializer(Type type) 89public XmlSerializer CreateSerializer(Type type, string defaultNamespace) 126public XmlSerializer CreateSerializer(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, string defaultNamespace, string location)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializerVersionAttribute.cs (3)
21private Type _type; 35public XmlSerializerVersionAttribute(Type type) 75public Type Type
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlTextAttribute.cs (3)
16private Type _type; 31public XmlTextAttribute(Type type) 40public Type Type
FrameworkFork\Microsoft.Xml\Xml\XmlNullResolver.cs (1)
18public override Object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn)
FrameworkFork\Microsoft.Xml\Xml\XmlResolver.cs (2)
32Type ofObjectToReturn); 78public virtual bool SupportsType(Uri absoluteUri, Type type)
FrameworkFork\Microsoft.Xml\Xml\XmlResolverAsync.cs (1)
16Type ofObjectToReturn)
FrameworkFork\Microsoft.Xml\Xml\XmlUrlResolver.cs (1)
45public override Object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn)
FrameworkFork\Microsoft.Xml\Xml\XmlXapResolver.cs (1)
25public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn)
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathItem.cs (3)
34public abstract Type ValueType { get; } 40public virtual object ValueAs(Type returnType) { return ValueAs(returnType, null); } 41public abstract object ValueAs(Type returnType, IXmlNamespaceResolver nsResolver);
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathNavigator.cs (2)
157public override Type ValueType 389public override object ValueAs(Type returnType, IXmlNamespaceResolver nsResolver)
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathNavigatorReader.cs (1)
193public override System.Type ValueType
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (31)
76internal ClassDataContract(Type type) : base(new ClassDataContractCriticalHelper(type)) 86private ClassDataContract(Type type, XmlDictionaryString ns, string[] memberNames) : base(new ClassDataContractCriticalHelper(type, ns, memberNames)) 264internal Type[] KeyValuePairGenericArguments 353internal static ClassDataContract CreateClassDataContractForKeyValue(Type type, XmlDictionaryString ns, string[] memberNames) 370Type declaringType = memberContract.MemberInfo.DeclaringType; 383internal static XmlDictionaryString GetChildNamespaceToDeclare(DataContract dataContract, Type childType, XmlDictionary dictionary) 396private static bool IsArraySegment(Type t) 408static internal bool IsNonAttributedTypeValidForSerialization(Type type) 428Type[] interfaceTypes = type.GetInterfaces(); 432foreach (Type interfaceType in interfaceTypes) 449type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Array.Empty<Type>()) != null); 473internal static bool IsKnownSerializableType(Type type) 782internal ClassDataContractCriticalHelper(Type type) : base(type) 796Type baseType = type.GetTypeInfo().BaseType; 854internal ClassDataContractCriticalHelper(Type type, XmlDictionaryString ns, string[] memberNames) : base(type) 873private void EnsureIsReferenceImported(Type type) 927Type type = this.UnderlyingType; 1170private XmlQualifiedName GetStableNameAndSetHasDataContract(Type type) 1182private void SetIsNonAttributedType(Type type) 1200Type type = this.UnderlyingType; 1205Type prevAttributeType = null; 1225private static bool IsValidCallback(MethodInfo method, ParameterInfo[] parameters, Type attributeType, MethodInfo currentCallback, ref Type prevAttributeType) 1348private void SetKeyValuePairAdapterFlags(Type type) 1354_keyValuePairCtorInfo = type.GetConstructor(Globals.ScanAllMembers, new Type[] { Globals.TypeOfKeyValuePair.MakeGenericType(_keyValuePairGenericArguments) }); 1360private Type[] _keyValuePairGenericArguments; 1374internal Type[] KeyValuePairGenericArguments 1394Type type = UnderlyingType; 1399ConstructorInfo ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Array.Empty<Type>()); 1509internal Type ObjectType 1513Type type = UnderlyingType;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (11)
228private bool TryGetReferencedType(XmlQualifiedName stableName, DataContract dataContract, out Type type) 358private CodeTypeReference GetCodeTypeReference(Type type) 533Type type = null; 582type = (Type)typeReference.UserData[s_codeUserDataActualTypeKey]; 638Type type; 660Type type; 676Type type = DataContractSurrogateCaller.GetReferencedTypeOnImport( 698Type type; 843Type actualType = (Type)baseContractCodeDomInfo.TypeReference.UserData[s_codeUserDataActualTypeKey]; 1052private void ThrowIfReferencedBaseTypeSealed(Type baseType, DataContract dataContract)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (51)
38s_getTypeFromHandle = typeof(Type).GetMethod("GetTypeFromHandle"); 85s_arraySetValue = typeof(Array).GetMethod("SetValue", new Type[] { typeof(object), typeof(int) }); 102s_objectToString = typeof(object).GetMethod("ToString", Array.Empty<Type>()); 117s_stringFormat = typeof(string).GetMethod("Format", new Type[] { typeof(string), typeof(object[]) }); 125private Type _delegateType; 180internal void BeginMethod(DynamicMethod dynamicMethod, Type delegateType, string methodName, Type[] argTypes, bool allowPrivateMemberAccess) 190internal void BeginMethod(string methodName, Type delegateType, bool allowPrivateMemberAccess) 194Type[] paramTypes = new Type[parameters.Length]; 202private void BeginMethod(Type returnType, string methodName, Type[] argTypes, bool allowPrivateMemberAccess) 219private void InitILGeneration(string methodName, Type[] argTypes) 272internal Type GetVariableType(object var) 282internal LocalBuilder DeclareLocal(Type type, string name, object initialValue) 290internal LocalBuilder DeclareLocal(Type type, string name) 295internal LocalBuilder DeclareLocal(Type type, string name, bool isPinned) 382internal void ForEach(LocalBuilder local, Type elementType, Type enumeratorType, 417Type type = GetVariableType(value); 629internal void InitObj(Type valueType) 636internal void NewArray(Type elementType, object len) 646Type objType = GetVariableType(obj).GetElementType(); 660Type arrayType = GetVariableType(obj); 667Type objType = arrayType.GetElementType(); 681private static bool IsStruct(Type objType) 686internal Type LoadMember(MemberInfo memberInfo) 688Type memberType = null; 766internal void LoadDefaultValue(Type type) 856internal void ConvertAddress(Type source, Type target) 861internal void ConvertValue(Type source, Type target) 867internal void Castclass(Type target) 874internal void Box(Type type) 881internal void Unbox(Type type) 923internal void Ldobj(Type type) 940internal void Stobj(Type type) 962internal void Ldtoken(Type t) 971Type valueType = o.GetType(); 972if (o is Type) 974Ldtoken((Type)o); 1266internal void Ldelem(Type arrayElementType) 1283internal void Ldelema(Type arrayElementType) 1330internal void Stelem(Type arrayElementType) 1504private void InternalConvert(Type source, Type target, bool isAddress) 1595internal void EmitStackTop(Type stackTopType) 1703internal void ToString(Type type) 1721internal Type ArgType; 1722internal ArgBuilder(int index, Type argType)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (73)
162internal CollectionDataContract(Type type) : base(new CollectionDataContractCriticalHelper(type)) 172private CollectionDataContract(Type type, CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, MethodInfo addMethod, ConstructorInfo constructor) 183private CollectionDataContract(Type type, CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, MethodInfo addMethod, ConstructorInfo constructor, bool isConstructorCheckRequired) 194private CollectionDataContract(Type type, string invalidCollectionInSharedContractMessage) : base(new CollectionDataContractCriticalHelper(type, invalidCollectionInSharedContractMessage)) 214private static Type[] KnownInterfaces 236public Type ItemType 571private static Type[] s_knownInterfaces; 573private Type _itemType; 594internal static Type[] KnownInterfaces 601s_knownInterfaces = new Type[] 617private void Init(CollectionKind kind, Type itemType, CollectionDataContractAttribute collectionContractAttribute) 677internal CollectionDataContractCriticalHelper(Type type) : base(type) 688internal CollectionDataContractCriticalHelper(Type type, CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, MethodInfo addMethod, ConstructorInfo constructor) : base(type) 707internal CollectionDataContractCriticalHelper(Type type, CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, MethodInfo addMethod, ConstructorInfo constructor, bool isConstructorCheckRequired) 713internal CollectionDataContractCriticalHelper(Type type, string invalidCollectionInSharedContractMessage) : base(type) 724internal Type ItemType 885private DataContract GetSharedTypeContract(Type type) 898internal static bool IsCollectionInterface(Type type) 902return ((IList<Type>)KnownInterfaces).Contains(type); 905internal static bool IsCollection(Type type) 907Type itemType; 911internal static bool IsCollection(Type type, out Type itemType) 916internal static bool IsCollection(Type type, bool constructorRequired) 918Type itemType; 922private static bool IsCollectionHelper(Type type, out Type itemType, bool constructorRequired) 933internal static bool TryCreate(Type type, out DataContract dataContract) 935Type itemType; 939internal static bool CreateGetOnlyCollectionDataContract(Type type, out DataContract dataContract) 941Type itemType; 953internal static bool TryCreateGetOnlyCollectionDataContract(Type type, out DataContract dataContract) 956Type itemType; 980internal static MethodInfo GetTargetMethodWithName(string name, Type type, Type interfaceType) 982Type t = type.GetInterfaces().Where(it => it.Equals(interfaceType)).FirstOrDefault(); 988private static bool IsArraySegment(Type t) 993private static bool IsCollectionOrTryCreate(Type type, bool tryCreate, out DataContract dataContract, out Type itemType, bool constructorRequired) 1005Type baseType = type.GetTypeInfo().BaseType; 1027Type interfaceTypeToCheck = type.GetTypeInfo().IsGenericType ? type.GetGenericTypeDefinition() : type; 1028Type[] knownInterfaces = KnownInterfaces; 1036Type[] genericArgs = type.GetGenericArguments(); 1048var collectionType = Globals.TypeOfICollectionGeneric.MakeGenericType(itemType); 1086defaultCtor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, Array.Empty<Type>()); 1094Type knownInterfaceType = null; 1097Type[] interfaceTypes = type.GetInterfaces(); 1098foreach (Type interfaceType in interfaceTypes) 1100Type interfaceTypeToCheck = interfaceType.GetTypeInfo().IsGenericType ? interfaceType.GetGenericTypeDefinition() : interfaceType; 1101Type[] knownInterfaces = KnownInterfaces; 1131GetCollectionMethods(type, knownInterfaceType, new Type[] { itemType }, 1149Type[] addMethodTypeArray = null; 1159addMethodTypeArray = new Type[] { Globals.TypeOfObject, Globals.TypeOfObject }; 1169addMethodTypeArray = new Type[] { itemType }; 1189internal static bool IsCollectionDataContract(Type type) 1194private static bool HandleIfInvalidCollection(Type type, bool tryCreate, bool hasCollectionDataContract, bool createContractWithException, string message, string param, ref DataContract dataContract) 1218private static void FindCollectionMethodsOnInterface(Type type, Type interfaceType, ref MethodInfo addMethod, ref MethodInfo getEnumeratorMethod) 1220Type t = type.GetInterfaces().Where(it => it.Equals(interfaceType)).FirstOrDefault(); 1228private static void GetCollectionMethods(Type type, Type interfaceType, Type[] addMethodTypeArray, bool addMethodOnInterface, out MethodInfo getEnumeratorMethod, out MethodInfo addMethod) 1240Type[] parentInterfaceTypes = interfaceType.GetInterfaces(); 1241foreach (Type parentInterfaceType in parentInterfaceTypes) 1265getEnumeratorMethod = type.GetMethod(Globals.GetEnumeratorMethodName, BindingFlags.Instance | BindingFlags.Public, Array.Empty<Type>()); 1268Type ienumerableInterface = interfaceType.GetInterfaces().Where(t => t.FullName.StartsWith("System.Collections.Generic.IEnumerable")).FirstOrDefault(); 1276private static bool IsKnownInterface(Type type) 1278Type typeToCheck = type.GetTypeInfo().IsGenericType ? type.GetGenericTypeDefinition() : type; 1279foreach (Type knownInterfaceType in KnownInterfaces)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (96)
109internal static DataContract GetDataContract(Type type) 114internal static DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type) 119internal static DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type, SerializationMode mode) 137internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 142internal static DataContract GetGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type type, SerializationMode mode) 158internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 198public static DataContract GetBuiltInDataContract(Type type) 238internal static void ThrowInvalidDataContractException(string message, Type type) 259public Type UnderlyingType 271public Type OriginalUnderlyingType { get; set; } 285internal Type TypeForInitialization 529private static Dictionary<Type, DataContract> s_typeToBuiltInContract; 542private Type _underlyingType; 558private Type _typeForInitialization; 567internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 588internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type type) 677private static DataContract CreateDataContract(int id, RuntimeTypeHandle typeHandle, Type type) 688type = Type.GetTypeFromHandle(typeHandle); 692var originalType = type; 755private static bool IsTypeSerializable(Type type) 760private static DataContract CreateGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type type) 769type = Type.GetTypeFromHandle(typeHandle); 781internal static Type GetDataContractAdapterType(Type type) 808public static DataContract GetBuiltInDataContract(Type type) 816s_typeToBuiltInContract = new Dictionary<Type, DataContract>(); 846static public bool TryCreateBuiltInDataContract(Type type, out DataContract dataContract) 1085internal static void ThrowInvalidDataContractException(string message, Type type) 1114internal DataContractCriticalHelper(Type type) 1121internal Type UnderlyingType 1135internal Type TypeForInitialization 1146private void SetTypeForInitialization(Type classType) 1238MethodInfo method = UnderlyingType.GetMethod(Globals.ParseMethodName, BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(string) }); 1281static internal bool IsTypeSerializable(Type type) 1283return IsTypeSerializable(type, new HashSet<Type>()); 1286private static bool IsTypeSerializable(Type type, HashSet<Type> previousCollectionTypes) 1288Type itemType; 1313private static void ValidatePreviousCollectionTypes(Type collectionType, Type itemType, HashSet<Type> previousCollectionTypes) 1326internal static Type UnwrapRedundantNullableType(Type type) 1328Type nullableType = type; 1337internal static Type UnwrapNullableType(Type type) 1401internal static XmlQualifiedName GetStableName(Type type) 1407internal static XmlQualifiedName GetStableName(Type type, out bool hasDataContract) 1409return GetStableName(type, new HashSet<Type>(), out hasDataContract); 1419internal static XmlQualifiedName GetStableName(Type type, HashSet<Type> previousCollectionTypes, out bool hasDataContract) 1445private static XmlQualifiedName GetDCTypeStableName(Type type, DataContractAttribute dataContractAttribute) 1473private static XmlQualifiedName GetNonDCTypeStableName(Type type, HashSet<Type> previousCollectionTypes) 1477Type itemType; 1498private static bool TryGetBuiltInXmlAndArrayTypeStableName(Type type, HashSet<Type> previousCollectionTypes, out XmlQualifiedName stableName) 1517Type itemType = type.GetElementType(); 1530internal static bool TryGetDCAttribute(Type type, out DataContractAttribute dataContractAttribute) 1572internal static XmlQualifiedName GetCollectionStableName(Type type, Type itemType, out CollectionDataContractAttribute collectionContractAttribute) 1574return GetCollectionStableName(type, itemType, new HashSet<Type>(), out collectionContractAttribute); 1577internal static XmlQualifiedName GetCollectionStableName(Type type, Type itemType, HashSet<Type> previousCollectionTypes, out CollectionDataContractAttribute collectionContractAttribute) 1621private static string GetArrayPrefix(ref Type itemType) 1656internal static XmlQualifiedName GetDefaultStableName(Type type) 1661private static string GetDefaultStableLocalName(Type type) 1690Type[] genParams = type.GetGenericArguments(); 1693Type genParam = genParams[i]; 1718private static string GetDefaultDataContractNamespace(Type type) 1773internal static string GetDefaultStableNamespace(Type type) 1791private static void CheckExplicitDataContractNamespaceUri(string dataContractNs, Type type) 1811internal static string GetClrTypeFullName(Type type) 2000private static string ExpandGenericParameters(string format, Type type) 2051static internal bool IsTypeNullable(Type type) 2060internal static DataContractDictionary ImportKnownTypeAttributes(Type type) 2063Dictionary<Type, Type> typesChecked = new Dictionary<Type, Type>(); 2068private static void ImportKnownTypeAttributes(Type type, Dictionary<Type, Type> typesChecked, ref DataContractDictionary knownDataContracts) 2110MethodInfo method = type.GetMethod(methodName, BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public, Array.Empty<Type>()); 2123foreach (Type ty in (IEnumerable<Type>)types) 2168internal static void CheckAndAdd(Type type, Dictionary<Type, Type> typesChecked, ref DataContractDictionary nameToDataContractTable) 2216static internal bool IsTypeVisible(Type t) 2221foreach (Type genericType in t.GetGenericArguments()) 2268private static bool IsTypeVisibleInSerializationModule(Type type) 2346internal GenericNameProvider(Type type) 2412Type paramType = o as Type;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractResolver.cs (4)
12public abstract bool TryResolveType(Type type, Type declaredType, DataContractResolver knownTypeResolver, out XmlDictionaryString typeName, out XmlDictionaryString typeNamespace); 13public abstract Type ResolveName(string typeName, string typeNamespace, Type declaredType, DataContractResolver knownTypeResolver);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSerializer.cs (38)
22private Type _rootType; 30private ReadOnlyCollection<Type> _knownTypeCollection; 31internal IList<Type> knownTypeList; 37public DataContractSerializer(Type type) 38: this(type, (IEnumerable<Type>)null) 42public DataContractSerializer(Type type, IEnumerable<Type> knownTypes) 48public DataContractSerializer(Type type, string rootName, string rootNamespace) 53public DataContractSerializer(Type type, string rootName, string rootNamespace, IEnumerable<Type> knownTypes) 60public DataContractSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace) 65public DataContractSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace, IEnumerable<Type> knownTypes) 73internal DataContractSerializer(Type type, IEnumerable<Type> knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences) 79public DataContractSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace, 80IEnumerable<Type> knownTypes, 89public DataContractSerializer(Type type, DataContractSerializerSettings settings) 99private void Initialize(Type type, 100IEnumerable<Type> knownTypes, 112this.knownTypeList = new List<Type>(); 113foreach (Type knownType in knownTypes) 129private void Initialize(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace, 130IEnumerable<Type> knownTypes, 144public ReadOnlyCollection<Type> KnownTypes 152_knownTypeCollection = new ReadOnlyCollection<Type>(knownTypeList); 156_knownTypeCollection = new ReadOnlyCollection<Type>(Array.Empty<Type>()); 311Type declaredType = contract.UnderlyingType; 312Type graphType = (graph == null) ? declaredType : graph.GetType(); 365internal static DataContract GetDataContract(DataContract declaredTypeContract, Type declaredType, Type objectType) 451internal override Type GetSerializeType(object graph) 456internal override Type GetDeserializeType() 461internal static object SurrogateToDataContractType(ISerializationSurrogateProvider serializationSurrogateProvider, object oldObj, Type surrogatedDeclaredType, ref Type objType) 471internal static Type GetSurrogatedType(ISerializationSurrogateProvider serializationSurrogateProvider, Type type)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSerializerSettings.cs (1)
31public IEnumerable<Type> KnownTypes { get; set; }
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSet.cs (30)
22private ICollection<Type> _referencedTypes; 23private ICollection<Type> _referencedCollectionTypes; 27internal DataContractSet(IDataContractSurrogate dataContractSurrogate, ICollection<Type> referencedTypes, ICollection<Type> referencedCollectionTypes) 97internal void Add(Type type) 104internal static void EnsureTypeNotGeneric(Type type) 219internal XmlQualifiedName GetStableName(Type clrType) 223Type dcType = DataContractSurrogateCaller.GetDataContractType(_dataContractSurrogate, clrType); 232internal DataContract GetDataContract(Type clrType) 239Type dcType = DataContractSurrogateCaller.GetDataContractType(_dataContractSurrogate, clrType); 257Type dataMemberType = dataMember.MemberType; 262Type dcType = DataContractSurrogateCaller.GetDataContractType(_dataContractSurrogate, dataMemberType); 358foreach (Type type in _referencedTypes) 377foreach (Type type in _referencedCollectionTypes) 391private void AddReferencedType(Dictionary<XmlQualifiedName, object> referencedTypes, Type type) 414Type referencedType = value as Type; 420List<Type> types = new List<Type>(); 428List<Type> types = (List<Type>)value; 438internal bool TryGetReferencedType(XmlQualifiedName stableName, DataContract dataContract, out Type type) 443internal bool TryGetReferencedCollectionType(XmlQualifiedName stableName, DataContract dataContract, out Type type) 448private bool TryGetReferencedType(XmlQualifiedName stableName, DataContract dataContract, bool useReferencedCollectionTypes, out Type type) 454type = value as Type; 460List<Type> types = (List<Type>)value; 465Type conflictingType = types[i]; 495private static bool IsTypeReferenceable(Type type) 497Type itemType;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSurrogateCaller.cs (14)
14internal static Type GetDataContractType(IDataContractSurrogate surrogate, Type type) 18Type dcType = surrogate.GetDataContractType(type); 24internal static Type GetDataContractType(ISerializationSurrogateProvider surrogateProvider, Type type) 31internal static object GetObjectToSerialize(ISerializationSurrogateProvider surrogateProvider, object obj, Type objType, Type membertype) 40internal static object GetDeserializedObject(ISerializationSurrogateProvider surrogateProvider, object obj, Type objType, Type memberType) 49internal static object GetCustomDataToExport(IDataContractSurrogate surrogate, MemberInfo memberInfo, Type dataContractType) 54internal static object GetCustomDataToExport(IDataContractSurrogate surrogate, Type clrType, Type dataContractType) 61internal static void GetKnownCustomDataTypes(IDataContractSurrogate surrogate, Collection<Type> customDataTypes) 66internal static Type GetReferencedTypeOnImport(IDataContractSurrogate surrogate, string typeName, string typeNamespace, object customData)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataMember.cs (2)
138internal Type MemberType 256internal Type MemberType
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\EnumDataContract.cs (14)
48static internal Type GetBaseType(XmlQualifiedName baseContractName) 71internal EnumDataContract(Type type) : base(new EnumDataContractCriticalHelper(type)) 147private static Dictionary<Type, XmlQualifiedName> s_typeToName; 148private static Dictionary<XmlQualifiedName, Type> s_nameToType; 160s_typeToName = new Dictionary<Type, XmlQualifiedName>(); 161s_nameToType = new Dictionary<XmlQualifiedName, Type>(); 172static internal void Add(Type type, string localName) 179static internal Type GetBaseType(XmlQualifiedName baseContractName) 181Type retVal = null; 191internal EnumDataContractCriticalHelper(Type type) : base(type) 194Type baseType = Enum.GetUnderlyingType(type); 229Type baseType = GetBaseType(_baseContractName); 266private void ImportBaseType(Type baseType) 273Type type = this.UnderlyingType;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (13)
54public ExceptionDataContract(Type type) : base(new ExceptionDataContractCriticalHelper(type)) 149public ExceptionDataContractCriticalHelper(Type type) 153Type baseType = Globals.TypeOfException; 253Type type = this.UnderlyingType; 305Type type = this.UnderlyingType; 362Type type = value.GetType(); 401Type fieldType; 453Type declaringType = memberContract.MemberInfo.DeclaringType; 470Type exceptionType = Globals.TypeOfException; 474DynamicMethod baseMessageImpl = new DynamicMethod("NonVirtual_Message", typeof(string), new Type[] { Globals.TypeOfException }, Globals.TypeOfException); 507Type type = obj.GetType(); 541private bool TryWritePrimitive(Type type, object value, XmlWriterDelegator writer, XmlObjectSerializerWriteContext context) 554private static bool TryCheckIfNoCountIDictionary(Type type, object value)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExtensionDataObject.cs (3)
76Type DataType { get; } 93protected Type dataType; 114public Type DataType
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\GenericParameterDataContract.cs (2)
17internal GenericParameterDataContract(Type type) 42internal GenericParameterDataContractCriticalHelper(Type type)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (142)
60private static Type s_typeOfObject; 61internal static Type TypeOfObject 73private static Type s_typeOfValueType; 74internal static Type TypeOfValueType 86private static Type s_typeOfArray; 87internal static Type TypeOfArray 99private static Type s_typeOfException; 100internal static Type TypeOfException 112private static Type s_typeOfString; 113internal static Type TypeOfString 125private static Type s_typeOfInt; 126internal static Type TypeOfInt 138private static Type s_typeOfULong; 139internal static Type TypeOfULong 151private static Type s_typeOfVoid; 152internal static Type TypeOfVoid 164private static Type s_typeOfByteArray; 165internal static Type TypeOfByteArray 177private static Type s_typeOfTimeSpan; 178internal static Type TypeOfTimeSpan 190private static Type s_typeOfGuid; 191internal static Type TypeOfGuid 203private static Type s_typeOfDateTimeOffset; 204internal static Type TypeOfDateTimeOffset 216private static Type s_typeOfDateTimeOffsetAdapter; 217internal static Type TypeOfDateTimeOffsetAdapter 229private static Type s_typeOfUri; 230internal static Type TypeOfUri 242private static Type s_typeOfTypeEnumerable; 243internal static Type TypeOfTypeEnumerable 249s_typeOfTypeEnumerable = typeof(IEnumerable<Type>); 255private static Type s_typeOfStreamingContext; 256internal static Type TypeOfStreamingContext 268private static Type s_typeOfXmlFormatClassWriterDelegate; 269internal static Type TypeOfXmlFormatClassWriterDelegate 281private static Type s_typeOfXmlFormatCollectionWriterDelegate; 282internal static Type TypeOfXmlFormatCollectionWriterDelegate 294private static Type s_typeOfXmlFormatClassReaderDelegate; 295internal static Type TypeOfXmlFormatClassReaderDelegate 307private static Type s_typeOfXmlFormatCollectionReaderDelegate; 308internal static Type TypeOfXmlFormatCollectionReaderDelegate 320private static Type s_typeOfXmlFormatGetOnlyCollectionReaderDelegate; 321internal static Type TypeOfXmlFormatGetOnlyCollectionReaderDelegate 333private static Type s_typeOfKnownTypeAttribute; 334internal static Type TypeOfKnownTypeAttribute 349private static Type s_typeOfDataContractAttribute; 350internal static Type TypeOfDataContractAttribute 366private static Type s_typeOfContractNamespaceAttribute; 367internal static Type TypeOfContractNamespaceAttribute 379private static Type s_typeOfDataMemberAttribute; 380internal static Type TypeOfDataMemberAttribute 392private static Type s_typeOfEnumMemberAttribute; 393internal static Type TypeOfEnumMemberAttribute 405private static Type s_typeOfCollectionDataContractAttribute; 406internal static Type TypeOfCollectionDataContractAttribute 418private static Type s_typeOfObjectArray; 419internal static Type TypeOfObjectArray 431private static Type s_typeOfOnSerializingAttribute; 432internal static Type TypeOfOnSerializingAttribute 444private static Type s_typeOfOnSerializedAttribute; 445internal static Type TypeOfOnSerializedAttribute 457private static Type s_typeOfOnDeserializingAttribute; 458internal static Type TypeOfOnDeserializingAttribute 470private static Type s_typeOfOnDeserializedAttribute; 471internal static Type TypeOfOnDeserializedAttribute 484private static Type s_typeOfFlagsAttribute; 485internal static Type TypeOfFlagsAttribute 497private static Type s_typeOfIXmlSerializable; 498internal static Type TypeOfIXmlSerializable 510private static Type s_typeOfXmlSchemaProviderAttribute; 511internal static Type TypeOfXmlSchemaProviderAttribute 523private static Type s_typeOfXmlRootAttribute; 524internal static Type TypeOfXmlRootAttribute 536private static Type s_typeOfXmlQualifiedName; 537internal static Type TypeOfXmlQualifiedName 606private static Type s_typeOfIPropertyChange; 607internal static Type TypeOfIPropertyChange 619private static Type s_typeOfIExtensibleDataObject; 620internal static Type TypeOfIExtensibleDataObject 632private static Type s_typeOfExtensionDataObject; 633internal static Type TypeOfExtensionDataObject 645private static Type s_typeOfNullable; 646internal static Type TypeOfNullable 658private static Type s_typeOfIDictionaryGeneric; 659internal static Type TypeOfIDictionaryGeneric 671private static Type s_typeOfIDictionary; 672internal static Type TypeOfIDictionary 684private static Type s_typeOfIListGeneric; 685internal static Type TypeOfIListGeneric 697private static Type s_typeOfIList; 698internal static Type TypeOfIList 710private static Type s_typeOfICollectionGeneric; 711internal static Type TypeOfICollectionGeneric 723private static Type s_typeOfICollection; 724internal static Type TypeOfICollection 736private static Type s_typeOfIEnumerableGeneric; 737internal static Type TypeOfIEnumerableGeneric 749private static Type s_typeOfIEnumerable; 750internal static Type TypeOfIEnumerable 762private static Type s_typeOfIEnumeratorGeneric; 763internal static Type TypeOfIEnumeratorGeneric 775private static Type s_typeOfIEnumerator; 776internal static Type TypeOfIEnumerator 788private static Type s_typeOfKeyValuePair; 789internal static Type TypeOfKeyValuePair 801private static Type s_typeOfKeyValuePairAdapter; 802internal static Type TypeOfKeyValuePairAdapter 814private static Type s_typeOfKeyValue; 815internal static Type TypeOfKeyValue 827private static Type s_typeOfIDictionaryEnumerator; 828internal static Type TypeOfIDictionaryEnumerator 840private static Type s_typeOfDictionaryEnumerator; 841internal static Type TypeOfDictionaryEnumerator 853private static Type s_typeOfGenericDictionaryEnumerator; 854internal static Type TypeOfGenericDictionaryEnumerator 866private static Type s_typeOfDictionaryGeneric; 867internal static Type TypeOfDictionaryGeneric 879private static Type s_typeOfHashtable; 880internal static Type TypeOfHashtable 892private static Type s_typeOfListGeneric; 893internal static Type TypeOfListGeneric 905private static Type s_typeOfXmlElement; 906internal static Type TypeOfXmlElement 918private static Type s_typeOfXmlSerializableServices; 919internal static Type TypeOfXmlSerializableServices 931private static Type s_typeOfXmlNodeArray; 932internal static Type TypeOfXmlNodeArray 944private static Type s_typeOfXmlSchemaSet; 945internal static Type TypeOfXmlSchemaSet 959private static Type s_typeOfDBNull; 960internal static Type TypeOfDBNull 967s_typeOfDBNull = Type.GetType("System.DBNull, System.Data.Common, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", false); 1007private static bool TypeSequenceEqual(Type[] seq1, Type[] seq2) 1019private static MethodBase FilterMethodBases(MethodBase[] methodBases, Type[] parameterTypes, string methodName) 1029internal static ConstructorInfo GetConstructor(this Type type, BindingFlags bindingFlags, Type[] parameterTypes) 1036internal static MethodInfo GetMethod(this Type type, string methodName, BindingFlags bindingFlags, Type[] parameterTypes) 1045private static Type s_typeOfScriptObject; 1055internal static bool TypeOfScriptObject_IsAssignableFrom(Type type) 1060internal static void SetScriptObjectJsonSerializer(Type typeOfScriptObject, Func<object, string> serializeFunc, Func<string, object> deserializeFunc)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\IDataContractSurrogate.cs (9)
14Type GetDataContractType(Type type); 15object GetObjectToSerialize(object obj, Type targetType); 16object GetDeserializedObject(object obj, Type targetType); 17object GetCustomDataToExport(MemberInfo memberInfo, Type dataContractType); 18object GetCustomDataToExport(Type clrType, Type dataContractType); 19void GetKnownCustomDataTypes(Collection<Type> customDataTypes); 20Type GetReferencedTypeOnImport(string typeName, string typeNamespace, object customData);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ImportOptions.cs (6)
17private ICollection<Type> _referencedTypes; 18private ICollection<Type> _referencedCollectionTypes; 47public ICollection<Type> ReferencedTypes 53_referencedTypes = new List<Type>(); 59public ICollection<Type> ReferencedCollectionTypes 65_referencedCollectionTypes = new List<Type>();
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\KnownTypeAttribute.cs (3)
11private Type _type; 18public KnownTypeAttribute(Type type) 33public Type Type
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\KnownTypeDataContractResolver.cs (4)
24public override bool TryResolveType(Type type, Type declaredType, DataContractResolver knownTypeResolver, out XmlDictionaryString typeName, out XmlDictionaryString typeNamespace) 54public override Type ResolveName(string typeName, string typeNamespace, Type declaredType, DataContractResolver knownTypeResolver)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Primitive\ISerializationSurrogateProvider.cs (4)
9Type GetSurrogateType(Type type); 10object GetObjectToSerialize(object obj, Type targetType); 11object GetDeserializedObject(object obj, Type targetType);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\PrimitiveDataContract.cs (7)
35protected PrimitiveDataContract(Type type, XmlDictionaryString name, XmlDictionaryString ns) : base(new PrimitiveDataContractCriticalHelper(type, name, ns)) 40static internal PrimitiveDataContract GetPrimitiveDataContract(Type type) 100_helper.XmlFormatWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) }); 102_helper.XmlFormatWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) }); 120_helper.XmlFormatContentWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { UnderlyingType }); 122_helper.XmlFormatContentWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), UnderlyingType }); 180internal PrimitiveDataContractCriticalHelper(Type type, XmlDictionaryString name, XmlDictionaryString ns) : base(type)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaExporter.cs (4)
17internal static void GetXmlTypeInfo(Type type, out XmlQualifiedName stableName, out XmlSchemaType xsdType, out bool hasRoot) 32private static bool InvokeSchemaProviderMethod(Type clrType, XmlSchemaSet schemas, out XmlQualifiedName stableName, out XmlSchemaType xsdType, out bool hasRoot) 58MethodInfo getMethod = clrType.GetMethod(methodName, /*BindingFlags.DeclaredOnly |*/ BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public, new Type[] { typeof(XmlSchemaSet) }); 113internal static bool IsSpecialXmlType(Type type, out XmlQualifiedName typeName, out XmlSchemaType xsdType, out bool hasRoot)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaImporter.cs (6)
188Dictionary<Type, object> previousCollectionTypes = new Dictionary<Type, object>(); 508Type referencedType; 753Type referencedType; 1343Collection<Type> knownTypes = new Collection<Type>();
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SerializationExtensionMethods.cs (1)
17public static bool IsAttributeDefined(this TypeInfo type, Type attributeType)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SpecialTypeDataContract.cs (2)
27public SpecialTypeDataContract(Type type, XmlDictionaryString name, XmlDictionaryString ns) : base(new SpecialTypeDataContractCriticalHelper(type, name, ns)) 47internal SpecialTypeDataContractCriticalHelper(Type type, XmlDictionaryString name, XmlDictionaryString ns) : base(type)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\TypeCode.cs (1)
9public static TypeCode GetTypeCode(this Type type)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlDataContract.cs (8)
49internal XmlDataContract(Type type) : base(new XmlDataContractCriticalHelper(type)) 232internal XmlDataContractCriticalHelper(Type type) : base(type) 357Type type = UnderlyingType; 362ConstructorInfo ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Array.Empty<Type>()); 390Type type = this.UnderlyingType; 422Type xName = type.GetTypeInfo().Assembly.GetType("System.Xml.Linq.XName"); 428new Type[] { typeof(String) } 432new Type[] { xName }
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (23)
33s_writeStartElementMethod2 = typeof(XmlWriterDelegator).GetMethod("WriteStartElement", Globals.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) }); 49s_writeStartElementMethod3 = typeof(XmlWriterDelegator).GetMethod("WriteStartElement", Globals.ScanAllMembers, new Type[] { typeof(string), typeof(XmlDictionaryString), typeof(XmlDictionaryString) }); 65s_writeEndElementMethod = typeof(XmlWriterDelegator).GetMethod("WriteEndElement", Globals.ScanAllMembers, Array.Empty<Type>()); 81s_writeNamespaceDeclMethod = typeof(XmlWriterDelegator).GetMethod("WriteNamespaceDecl", Globals.ScanAllMembers, new Type[] { typeof(XmlDictionaryString) }); 97s_dictionaryEnumeratorCtor = Globals.TypeOfDictionaryEnumerator.GetConstructor(Globals.ScanAllMembers, new Type[] { Globals.TypeOfIDictionaryEnumerator }); 159s_isStartElementMethod2 = typeof(XmlReaderDelegator).GetMethod("IsStartElement", Globals.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) }); 175s_isStartElementMethod0 = typeof(XmlReaderDelegator).GetMethod("IsStartElement", Globals.ScanAllMembers, Array.Empty<Type>()); 191s_getUninitializedObjectMethod = typeof(XmlFormatReaderGenerator).GetMethod("UnsafeGetUninitializedObject", Globals.ScanAllMembers, new Type[] { typeof(int) }); 222s_hashtableCtor = Globals.TypeOfHashtable.GetConstructor(Globals.ScanAllMembers, Array.Empty<Type>()); 268s_storeCollectionMemberInfoMethod = typeof(XmlObjectSerializerReadContext).GetMethod("StoreCollectionMemberInfo", Globals.ScanAllMembers, new Type[] { typeof(object) }); 348s_internalDeserializeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("InternalDeserialize", Globals.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator), typeof(int), typeof(RuntimeTypeHandle), typeof(string), typeof(string) }); 444s_readIfNullOrRefMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ReadIfNullOrRef", Globals.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator), typeof(Type), typeof(bool) }); 637s_createSerializationExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("CreateSerializationException", Globals.ScanAllMembers, new Type[] { typeof(string) }); 653s_createUnexpectedStateExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("CreateUnexpectedStateException", Globals.ScanAllMembers, new Type[] { typeof(XmlNodeType), typeof(XmlReaderDelegator) }); 701s_writeNullMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("WriteNull", Globals.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), typeof(Type), typeof(bool) }); 733s_incrementCollectionCountMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("IncrementCollectionCount", Globals.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), typeof(ICollection) }); 831s_isMemberTypeSameAsMemberValue = typeof(XmlObjectSerializerWriteContext).GetMethod("IsMemberTypeSameAsMemberValue", Globals.ScanAllMembers, new Type[] { typeof(object), typeof(Type) }); 1006s_getTypeHandleMethod = typeof(Type).GetMethod("get_TypeHandle"); 1036s_throwInvalidDataContractExceptionMethod = typeof(DataContract).GetMethod("ThrowInvalidDataContractException", Globals.ScanAllMembers, new Type[] { typeof(string), typeof(Type) });
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatReaderGenerator.cs (22)
82private Type _objectType; 203Type type = _objectType = classContract.UnderlyingType; 308Type memberType = dataMember.MemberType; 379private LocalBuilder ReadValue(Type type, string name, string ns) 469private void InternalDeserialize(LocalBuilder value, Type type, string name, string ns) 473Type declaredType = type; 486Type innerType = innerValue.LocalType, outerType = outerValue.LocalType; 491Type type = Globals.TypeOfNullable.MakeGenericType(innerType); 492_ilg.New(type.GetConstructor(new Type[] { innerType })); 495_ilg.Call(outerType.GetConstructor(new Type[] { innerType })); 500Type type = collectionContract.UnderlyingType; 501Type itemType = collectionContract.ItemType; 512constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public, Array.Empty<Type>()); 639Type type = collectionContract.UnderlyingType; 640Type itemType = collectionContract.ItemType; 699private bool TryReadPrimitiveArray(Type type, Type itemType, LocalBuilder size) 746private LocalBuilder ReadCollectionItem(CollectionDataContract collectionContract, Type itemType, string itemName, string itemNs) 853static internal object UnsafeGetUninitializedObject(Type type) 870var type = DataContract.GetDataContractForInitialization(id).TypeForInitialization; 874static internal object TryGetUninitializedObjectWithFormatterServices(Type type) 877var formatterServiceType = typeof(string).GetTypeInfo().Assembly.GetType("System.Runtime.Serialization.FormatterServices");
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatWriterGenerator.cs (24)
128private void InitArgs(Type objType) 242Type memberType = member.MemberType; 316Type itemType = collectionContract.ItemType; 360Type enumeratorType = null; 361Type[] keyValueTypes = null; 371keyValueTypes = new Type[] { Globals.TypeOfObject, Globals.TypeOfObject }; 378MethodInfo moveNextMethod = enumeratorType.GetMethod(Globals.MoveNextMethodName, BindingFlags.Instance | BindingFlags.Public, Array.Empty<Type>()); 379MethodInfo getCurrentMethod = enumeratorType.GetMethod(Globals.GetCurrentMethodName, BindingFlags.Instance | BindingFlags.Public, Array.Empty<Type>()); 391Type ienumeratorInterface = Globals.TypeOfIEnumerator; 395Type[] interfaceTypes = enumeratorType.GetInterfaces(); 396foreach (Type interfaceType in interfaceTypes) 413Type elementType = getCurrentMethod.ReturnType; 425Type ctorParam = Globals.TypeOfIEnumeratorGeneric.MakeGenericType(Globals.TypeOfKeyValuePair.MakeGenericType(keyValueTypes)); 426ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(Globals.ScanAllMembers, new Type[] { ctorParam }); 460private bool TryWritePrimitive(Type type, LocalBuilder value, MemberInfo memberInfo, LocalBuilder arrayItemIndex, LocalBuilder ns, LocalBuilder name, int nameIndex) 506private bool TryWritePrimitiveArray(Type type, Type itemType, LocalBuilder value, LocalBuilder itemName, LocalBuilder itemNamespace) 545_ilg.Call(typeof(XmlWriterDelegator).GetMethod(writeArrayMethod, Globals.ScanAllMembers, new Type[] { type, typeof(XmlDictionaryString), typeof(XmlDictionaryString) })); 553Type memberType = memberValue.LocalType; 617private void InternalSerialize(MethodInfo methodInfo, LocalBuilder memberValue, Type memberType, bool writeXsiType) 636Type memberType = memberValue.LocalType; 642Type innerType = memberType.GetGenericArguments()[0]; 662private bool NeedsPrefix(Type type, XmlDictionaryString ns) 667private void WriteStartElement(Type type, XmlDictionaryString ns, LocalBuilder namespaceLocal, LocalBuilder nameLocal, int nameIndex)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializer.cs (3)
381internal static string GetTypeInfoError(string errorMessage, Type type, Exception innerException) 388internal virtual Type GetSerializeType(object graph) 393internal virtual Type GetDeserializeType()
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerContext.cs (17)
26protected IList<Type> serializerKnownTypeList; 125internal DataContract GetDataContract(Type type) 130internal virtual DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type type) 142internal virtual DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type type) 167internal virtual void CheckIfTypeSerializable(Type memberType, bool isMemberTypeSerializable) 173internal virtual Type GetSurrogatedType(Type type) 200internal static DataContractDictionary GetDataContractsForKnownTypes(IList<Type> knownTypeList) 204Dictionary<Type, Type> typesChecked = new Dictionary<Type, Type>(); 207Type knownType = knownTypeList[i]; 216internal bool IsKnownType(DataContract dataContract, DataContractDictionary knownDataContracts, Type declaredType) 234internal bool IsKnownType(DataContract dataContract, Type declaredType) 240internal Type ResolveNameFromKnownTypes(XmlQualifiedName typeName) 276Type dataContractType = _dataContractResolver.ResolveName(typeName, typeNs, null, KnownTypeResolver);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (7)
69internal static void ThrowNullValueReturnedForGetOnlyCollectionException(Type type) 78internal static void ThrowArrayExceededSizeException(int arraySize, Type type) 113internal virtual object InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, string name, string ns) 119internal virtual object InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, string name, string ns) 126protected bool TryHandleNullOrRef(XmlReaderDelegator reader, Type declaredType, string name, string ns, ref object retObj) 333internal string ReadIfNullOrRef(XmlReaderDelegator xmlReader, Type memberType, bool isMemberTypeSerializable) 432internal object GetExistingObject(string id, Type type, string name, string ns)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (14)
44return InternalDeserializeWithSurrogate(xmlReader, Type.GetTypeFromHandle(declaredTypeHandle), null /*surrogateDataContract*/, name, ns); 48return InternalDeserializeInSharedTypeMode(xmlReader, declaredTypeID, Type.GetTypeFromHandle(declaredTypeHandle), name, ns); 52internal override object InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, string name, string ns) 67internal override object InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, string name, string ns) 82private object InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, int declaredTypeID, Type declaredType, string name, string ns) 94Type type; 120private object InternalDeserializeWithSurrogate(XmlReaderDelegator xmlReader, Type declaredType, DataContract surrogateDataContract, string name, string ns) 137private Type ResolveDataContractTypeInSharedTypeMode(string assemblyName, string typeName, out Assembly assembly) 142private DataContract ResolveDataContractInSharedTypeMode(string assemblyName, string typeName, out Assembly assembly, out Type type) 164Type type; 171internal override void CheckIfTypeSerializable(Type memberType, bool isMemberTypeSerializable) 186internal override Type GetSurrogatedType(Type type) 195Type surrogateType = DataContractSerializer.GetSurrogatedType(_serializationSurrogateProvider, type);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (17)
117Type declaredType = Globals.TypeOfObject; 137SerializeWithXsiType(xmlWriter, obj, objTypeHandle, null /*type*/, declaredTypeID, declaredTypeHandle, Type.GetTypeFromHandle(declaredTypeHandle)); 158internal virtual void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 161Type declaredType = rootTypeDataContract.UnderlyingType; 177protected virtual void SerializeWithXsiType(XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 204objectType = Type.GetTypeFromHandle(objectTypeHandle); 256protected void SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, bool verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 296internal virtual bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, Type dataContractType, string clrTypeName, string clrAssemblyName) 441internal void WriteNull(XmlWriterDelegator xmlWriter, Type memberType, bool isMemberTypeSerializable) 448internal void WriteNull(XmlWriterDelegator xmlWriter, Type memberType, bool isMemberTypeSerializable, XmlDictionaryString name, XmlDictionaryString ns) 495internal static bool IsMemberTypeSameAsMemberValue(object obj, Type memberType) 526internal static void ThrowRequiredMemberMustBeEmitted(string memberName, Type type) 589private void WriteResolvedTypeInfo(XmlWriterDelegator writer, Type objectType, Type declaredType) 598private bool ResolveType(Type objectType, Type declaredType, out XmlDictionaryString typeName, out XmlDictionaryString typeNamespace)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (9)
51internal override bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, Type dataContractType, string clrTypeName, string clrAssemblyName) 214internal override void CheckIfTypeSerializable(Type memberType, bool isMemberTypeSerializable) 229internal override Type GetSurrogatedType(Type type) 238Type surrogateType = DataContractSerializer.GetSurrogatedType(_serializationSurrogateProvider, type); 256Type objType = Type.GetTypeFromHandle(objTypeHandle); 257Type declaredType = GetSurrogatedType(Type.GetTypeFromHandle(declaredTypeHandle));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlReaderDelegator.cs (1)
910internal Type ValueType { get { return reader.ValueType; } }
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlSerializableReader.cs (2)
85public override Type ValueType { get { return InnerReader.ValueType; } } 122public override object ReadContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver) { return InnerReader.ReadContentAs(returnType, namespaceResolver); }
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlWriterDelegator.cs (2)
287private Exception CreateInvalidPrimitiveTypeException(Type type) 297internal void WriteAnyType(object value, Type valueType)
FrameworkFork\System.Runtime.Serialization\System\Xml\ValueHandle.cs (1)
170public Type ToType()
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseReader.cs (3)
1631public override object ReadContentAs(Type type, IXmlNamespaceResolver namespaceResolver) 1711public override Type ValueType 1717Type type = _node.Value.ToType();
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryReader.cs (1)
1138public override bool IsStartArray(out Type type)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryWriter.cs (1)
1140Type type = reader.ValueType;
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryReader.cs (4)
480public override object ReadContentAs(Type type, IXmlNamespaceResolver namespaceResolver) 905public virtual bool IsStartArray(out Type type) 1514public override Type ValueType 1674public override object ReadContentAs(Type type, IXmlNamespaceResolver namespaceResolver)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryWriter.cs (4)
256private void WriteArrayNode(XmlDictionaryReader reader, string prefix, string localName, string namespaceUri, Type type) 285private void WriteArrayNode(XmlDictionaryReader reader, string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Type type) 314private void WriteArrayNode(XmlDictionaryReader reader, Type type) 358Type type;
FrameworkFork\System.ServiceModel\Extensions\ReflectionExtensions.cs (34)
14public static Assembly Assembly(this Type type) 18public static Type BaseType(this Type type) 22public static bool ContainsGenericParameters(this Type type) 26public static ConstructorInfo GetConstructor(this Type type, BindingFlags bindingAttr, object binder, Type[] types, object[] modifiers) 30public static PropertyInfo GetProperty(this Type type, string name, BindingFlags bindingAttr) 34public static Type[] GetGenericArguments(this Type type) 38public static Type[] GetInterfaces(this Type type) 42public static bool IsAbstract(this Type type) 46public static bool IsAssignableFrom(this Type type, Type otherType) 50public static bool IsClass(this Type type) 54public static bool IsDefined(this Type type, Type attributeType, bool inherit) 58public static bool IsEnum(this Type type) 62public static bool IsGenericType(this Type type) 66public static bool IsInterface(this Type type) 70public static bool IsInstanceOfType(this Type type, object o) 74public static bool IsMarshalByRef(this Type type) 78public static bool IsNotPublic(this Type type) 82public static bool IsSealed(this Type type) 86public static bool IsValueType(this Type type) 90public static InterfaceMapping GetInterfaceMap(this Type type, Type interfaceType) 94public static MemberInfo[] GetMember(this Type type, string name, BindingFlags bindingAttr) 98public static MemberInfo[] GetMembers(this Type type, BindingFlags bindingAttr) 102public static MethodInfo GetMethod(this Type type, string name) 107public static MethodInfo GetMethod(this Type type, string name, Type[] types) 114public static TypeCode GetTypeCode(this Type type) 191public static Type ReflectedType(this MethodInfo mi)
FrameworkFork\System.ServiceModel\Framework\System\ComponentModel\InvalidEnumArgumentException.cs (1)
45public InvalidEnumArgumentException(string argumentName, int invalidValue, Type enumClass)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Fx.cs (16)
28private static Type[] s_breakOnExceptionTypesCache; 235internal static Type[] BreakOnExceptionTypes 248List<Type> types = new List<Type>(typeNames.Length); 251types.Add(Type.GetType(typeNames[i], false)); 566private readonly Type _elementType; 569public CacheAttribute(Type elementType, CacheAttrition cacheAttrition) 584public Type ElementType 609private readonly Type _elementType; 611public QueueAttribute(Type elementType) 624public Type ElementType 772public Type CancelDeclaringType { get; set; } 807private readonly Type _exceptionType; 810public ThrowsAttribute(Type exceptionType, string diagnosis) 825public Type ExceptionType 850public Type FromDeclaringType { get; set; }
FrameworkFork\System.ServiceModel\System\IdentityModel\Security\WSTrust.cs (2)
58protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(BinarySecretSecurityToken) }; }
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\SecurityTokenSerializer.cs (7)
178public abstract Type GetTokenType(SecurityKeyIdentifierClause clause); 212private Type[] _tokenTypes = null; 216public Type TokenType { get { return GetTokenTypes()[0]; } } 220public bool SupportsCore(Type tokenType) 222Type[] tokenTypes = GetTokenTypes(); 231protected abstract Type[] GetTokenTypesCore(); 233public Type[] GetTokenTypes()
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\KeyInfoSerializer.cs (2)
336internal Type[] GetTokenTypes(string tokenTypeUri) 353protected internal virtual string GetTokenTypeUri(Type tokenType)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\LocalIdKeyIdentifierClause.cs (12)
13private readonly Type[] _ownerTypes; 16: this(localId, (Type[])null) 20public LocalIdKeyIdentifierClause(string localId, Type ownerType) 21: this(localId, ownerType == null ? (Type[])null : new Type[] { ownerType }) 25public LocalIdKeyIdentifierClause(string localId, byte[] derivationNonce, int derivationLength, Type ownerType) 26: this(null, derivationNonce, derivationLength, ownerType == null ? (Type[])null : new Type[] { ownerType }) 30internal LocalIdKeyIdentifierClause(string localId, Type[] ownerTypes) 35internal LocalIdKeyIdentifierClause(string localId, byte[] derivationNonce, int derivationLength, Type[] ownerTypes) 55public Type OwnerType 66public bool Matches(string localId, Type ownerType)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\WSSecurityJan2004.cs (24)
122protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(GenericXmlSecurityToken) }; } 134protected override Type[] GetTokenTypesCore() 144protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(SamlSecurityToken) }; } 153protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(UserNameSecurityToken) }; } 162protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(WrappedKeySecurityToken) }; } 176protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(X509SecurityToken), typeof(X509WindowsSecurityToken) }; } 258protected abstract Type ClauseType { get; } 260public abstract Type TokenType { get; } 281public override Type GetTokenType(SecurityKeyIdentifierClause clause) 327protected override Type ClauseType { get { throw new NotImplementedException(); } } 329public override Type TokenType { get { return typeof(KerberosRequestorSecurityToken); } } 354protected override Type ClauseType { get { throw new NotImplementedException(); } } 356public override Type TokenType { get { return typeof(X509SecurityToken); } } 385public override Type GetTokenType(SecurityKeyIdentifierClause clause) 393Type tokenType = GetTokenType(clause); 418Type[] tokenTypes = null; 479public override Type GetTokenType(SecurityKeyIdentifierClause clause) 531public override Type GetTokenType(SecurityKeyIdentifierClause clause) 558public override Type GetTokenType(SecurityKeyIdentifierClause clause)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\WSSecurityXXX2005.cs (5)
132protected override Type ClauseType { get { throw new NotImplementedException(); } } 134public override Type TokenType { get { return typeof(WrappedKeySecurityToken); } } 165protected override Type ClauseType { get { throw new NotImplementedException(); } } 167public override Type TokenType { get { return typeof(X509SecurityToken); } } 196public override Type GetTokenType(SecurityKeyIdentifierClause clause)
FrameworkFork\System.ServiceModel\System\ServiceModel\ChannelFactory.cs (5)
392private Type _channelType; 394private Type _callbackType; 397protected ChannelFactory(Type channelType) 507internal Type CallbackType 601Type implementationType = implementation.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\AddressHeader.cs (2)
35Type type = GetObjectType(value); 63private static Type GetObjectType(object value)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BindingElementCollection.cs (1)
61public bool Contains(Type bindingElementType)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelManagerBase.cs (1)
46internal Exception CreateChannelTypeNotSupportedException(Type type)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelRequirements.cs (28)
60public static Type[] ComputeRequiredChannels(ref ChannelRequirements requirements) 67return new Type[] { 73return new Type[] { 78return new Type[] { 88return new Type[] { 96return new Type[] { 102return new Type[] { 112return new Type[] { 122return new Type[] { 129return new Type[] { 141return new Type[] { 149return new Type[] { 155return new Type[] { 166return new Type[] { 176return new Type[] { 183return new Type[] { 193public static bool IsSessionful(Type channelType) 202public static bool IsOneWay(Type channelType) 210public static bool IsRequestReply(Type channelType) 218public static bool IsDuplex(Type channelType) 224public static Exception CantCreateListenerException(IEnumerable<Type> supportedChannels, IEnumerable<Type> requiredChannels, string bindingName) 242public static Exception CantCreateChannelException(IEnumerable<Type> supportedChannels, IEnumerable<Type> requiredChannels, string bindingName) 259public static Exception BindingContractMismatchException(IEnumerable<Type> supportedChannels, IEnumerable<Type> requiredChannels, 269foreach (Type channelType in requiredChannels) 312foreach (Type channelType in supportedChannels)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CommunicationObject.cs (1)
580protected virtual Type GetCommunicationObjectType()
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
440Type channelType = typeof(TChannel);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (6)
22private static readonly Type s_delegatingHandlerType = typeof(DelegatingHandler); 24private Type[] _httpMessageHandlers; 39public HttpMessageHandlerFactory(params Type[] handlers) 54Type handler = handlers[cnt]; 69ConstructorInfo ctorInfo = handler.GetConstructor(Array.Empty<Type>()); 164instances[cnt] = (DelegatingHandler)_handlerCtors[cnt].Invoke(Array.Empty<Type>());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Message.cs (1)
108private static Type GetObjectType(object value)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageEncodingBindingElementImporter.cs (1)
39Type elementType = messageEncodingBindingElement.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\RequestReplyCorrelator.cs (4)
25Type stateType = typeof(T); 45Type stateType = typeof(T); 225internal Type StateType; 227internal Key(UniqueId messageId, Type stateType)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannel.cs (1)
420internal bool CanCastTo(Type t)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelFactory.cs (7)
123Type[] requiredChannels = ChannelRequirements.ComputeRequiredChannels(ref requirements); 130foreach (Type type in requiredChannels) 177foreach (Type type in requiredChannels) 200Dictionary<Type, byte> supportedChannels = new Dictionary<Type, byte>(); 365internal static object CreateProxy(Type interfaceType, Type proxiedType, MessageDirection direction, ServiceChannel serviceChannel)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelProxy.cs (13)
21private Type _proxiedType; 64Type declaringType = method.DeclaringType; 257public TaskCompletionSourceProxy(Type resultType) 283private static ConcurrentDictionary<Type, TaskCompletionSourceInfo> s_cache = new ConcurrentDictionary<Type, TaskCompletionSourceInfo>(); 285public TaskCompletionSourceInfo(Type resultType) 288Type tcsType = typeof(TaskCompletionSource<>); 289GenericType = tcsType.MakeGenericType(new Type[] { resultType }); 292TrySetExceptionMethod = GenericType.GetRuntimeMethod("TrySetException", new Type[] { typeof(Exception) }); 293TrySetCanceledMethod = GenericType.GetRuntimeMethod("TrySetCanceled", Array.Empty<Type>()); 296public Type ResultType { get; private set; } 297public Type GenericType { get; private set; } 303public static TaskCompletionSourceInfo GetTaskCompletionSourceInfo(Type resultType)
FrameworkFork\System.ServiceModel\System\ServiceModel\Configuration\BindingElementExtensionElement.cs (1)
24public abstract Type BindingElementType
FrameworkFork\System.ServiceModel\System\ServiceModel\Configuration\SecurityElementBase.cs (1)
33public override Type BindingElementType
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ClientClassGenerator.cs (28)
34private static Type s_clientBaseType = typeof(ClientBase<>); 35private static Type s_duplexClientBaseType = typeof(DuplexClientBase<>); 36private static Type s_instanceContextType = typeof(InstanceContext); 37private static Type s_objectType = typeof(object); 38private static Type s_objectArrayType = typeof(object[]); 39private static Type s_exceptionType = typeof(Exception); 40private static Type s_boolType = typeof(bool); 41private static Type s_stringType = typeof(string); 42private static Type s_endpointAddressType = typeof(EndpointAddress); 43private static Type s_uriType = typeof(Uri); 44private static Type s_bindingType = typeof(Binding); 45private static Type s_sendOrPostCallbackType = typeof(SendOrPostCallback); 46private static Type s_asyncCompletedEventArgsType = typeof(AsyncCompletedEventArgs); 47private static Type s_eventHandlerType = typeof(EventHandler<>); 48private static Type s_voidType = typeof(void); 49private static Type s_asyncResultType = typeof(IAsyncResult); 50private static Type s_asyncCallbackType = typeof(AsyncCallback); 66private static Type[][] s_clientCtorParamTypes = new Type[][] 68new Type[] { }, 69new Type[] { s_stringType, }, 70new Type[] { s_stringType, s_stringType, }, 71new Type[] { s_stringType, s_endpointAddressType, }, 72new Type[] { s_bindingType, s_endpointAddressType, }, 84private static Type[] s_eventArgsCtorParamTypes = new Type[] 121Type[] duplexCtorTypes1 = DebugCheckTable_InsertAtStart(s_clientCtorParamTypes[i], s_objectType); 122Type[] duplexCtorTypes2 = DebugCheckTable_InsertAtStart(s_clientCtorParamTypes[i], s_instanceContextType);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ContractDescription.cs (10)
18private Type _callbackContractType; 20private Type _contractType; 57public Type ContractType 63public Type CallbackContractType 141public KeyedCollection<Type, IContractBehavior> ContractBehaviors 152public static ContractDescription GetContract(Type contractType) 161public static ContractDescription GetContract(Type contractType, Type serviceType) 174public static ContractDescription GetContract(Type contractType, object serviceImplementation) 183Type serviceType = serviceImplementation.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\CustomAttributeProvider.cs (6)
28if (attrProvider is Type) 30this.Type = (Type)attrProvider; 55internal Type Type { get; private set; } 77public object[] GetCustomAttributes(Type attributeType, bool inherit) 96public bool IsDefined(Type attributeType, bool inherit) 128public static implicit operator CustomAttributeProvider(Type attrProvider)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\DataContractSerializerOperationBehavior.cs (4)
92public virtual XmlObjectSerializer CreateSerializer(Type type, string name, string ns, IList<Type> knownTypes) 97public virtual XmlObjectSerializer CreateSerializer(Type type, XmlDictionaryString name, XmlDictionaryString ns, IList<Type> knownTypes)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\FaultDescription.cs (2)
16private Type _detailType; 40public Type DetailType
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MessageContractImporter.cs (8)
50static internal void ImportMessageBinding(WsdlImporter importer, WsdlEndpointConversionContext endpointContext, Type schemaImporterType) 1226private static bool CheckAndAddPart(XmlQualifiedName typeNameFound, XmlQualifiedName typeNameRequired, string name, string ns, Type type, MessageDescription description, bool isReply) 1627Type type = typeof(DataContractSerializerSchemaImporter); 1680internal static bool TryGetFailedReferenceType(Exception ex, out Type failedReferenceType) 1687failedReferenceType = ex.Data[FailedReferenceTypeExceptionKey] as Type; 1702Type failedReferenceType; 1946_xmlImporter.Extensions.Add(extTypeName, Type.GetType(extTypeName, true /*throwOnError*/)); 1984Type type = typeof(XmlSerializerSchemaImporter);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MessageDescription.cs (4)
17private static Type s_typeOfUntypedMessage; 22private Type _messageType; 121internal static Type TypeOfUntypedMessage 142public Type MessageType
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MessagePartDescription.cs (2)
19private Type _type; 94public Type Type
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExchangeClient.cs (2)
447internal static void TraceReceiveReply(string sourceUrl, Type metadataType) 647Type metadataType = null;
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataSet.cs (5)
264System.Type t = o.GetType(); 319System.Type t = o.GetType(); 401System.Type t = o.GetType(); 1047public override System.Boolean CanSerialize(System.Type type) 1052public override Microsoft.Xml.Serialization.XmlSerializer GetSerializer(System.Type type)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\OperationDescription.cs (5)
27private Collection<Type> _knownTypes; 59_knownTypes = new Collection<Type>(); 68public KeyedCollection<Type, IOperationBehavior> OperationBehaviors 195public Collection<Type> KnownTypes 223internal Type TaskTResult
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\OperationGenerator.cs (2)
983Type attributeType = attribute.GetType(); 1023Type type = val.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceContractGenerator.cs (5)
28private Dictionary<ContractDescription, Type> _referencedTypes; 48_referencedTypes = new Dictionary<ContractDescription, Type>(); 51internal CodeTypeReference GetCodeTypeReference(Type type) 85public Dictionary<ContractDescription, Type> ReferencedTypes 122Type existingType;
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceEndpoint.cs (1)
51public KeyedCollection<Type, IEndpointBehavior> EndpointBehaviors
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceEndpointCollection.cs (3)
16public ServiceEndpoint Find(Type contractType) 52public ServiceEndpoint Find(Type contractType, XmlQualifiedName bindingName) 119public Collection<ServiceEndpoint> FindAll(Type contractType)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (48)
49internal static string TypeName(Type t) 51Type[] args = null; 83internal static XmlQualifiedName GetContractName(Type contractType, string name, string ns) 348internal static readonly Type VoidType = typeof(void); 350internal static readonly Type taskType = typeof(Task); 351internal static readonly Type taskTResultType = typeof(Task<>); 352internal static readonly Type CancellationTokenType = typeof(CancellationToken); 353internal static readonly Type IProgressType = typeof(IProgress<>); 354private static readonly Type s_asyncCallbackType = typeof(AsyncCallback); 355private static readonly Type s_asyncResultType = typeof(IAsyncResult); 356private static readonly Type s_objectType = typeof(object); 357private static readonly Type s_OperationContractAttributeType = typeof(OperationContractAttribute); 359static internal Type GetOperationContractProviderType(MethodInfo method) 374static internal List<Type> GetInterfaces(Type service) 376List<Type> types = new List<Type>(); 385Type t = GetAncestorImplicitContractClass(service); 392Type operationContractProviderType = GetOperationContractProviderType(method); 399foreach (Type t in service.GetInterfaces()) 414private static Type GetAncestorImplicitContractClass(Type service) 426static internal List<Type> GetInheritedContractTypes(Type service) 428List<Type> types = new List<Type>(); 429foreach (Type t in service.GetInterfaces()) 446static internal object[] GetCustomAttributes(CustomAttributeProvider attrProvider, Type attrType) 451static internal object[] GetCustomAttributes(CustomAttributeProvider attrProvider, Type attrType, bool inherit) 481Type type = attrProvider.Type; 514Type attrType = typeof(T); 529Type attrType = typeof(T); 554static internal T GetSingleAttribute<T>(CustomAttributeProvider attrProvider, Type[] attrTypeGroup) 560Type attrType = typeof(T); 561foreach (Type otherType in attrTypeGroup) 576static internal T GetRequiredSingleAttribute<T>(CustomAttributeProvider attrProvider, Type[] attrTypeGroup) 586static internal Type GetContractType(Type interfaceType) 592static internal Type GetContractTypeAndAttribute(Type interfaceType, out ServiceContractAttribute contractAttribute) 600List<Type> types = new List<Type>(GetInheritedContractTypes(interfaceType)); 607foreach (Type potentialContractRoot in types) 610foreach (Type t in types) 627private static List<MethodInfo> GetMethodsInternal(Type interfaceType) 862static internal bool IsTask(MethodInfo method, out Type taskTResult) 865Type methodReturnType = method.ReturnType; 957static internal bool IsParameterDisposable(Type type)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\TypeLoader.cs (86)
22private static Type[] s_messageContractMemberAttributes = { 27private static Type[] s_formatterAttributes = { 32private static Type[] s_knownTypesMethodParamType = new Type[] { typeof(CustomAttributeProvider) }; 37private static readonly Type s_OperationContractAttributeType = typeof(OperationContractAttribute); 45private readonly Dictionary<Type, ContractDescription> _contracts; 46private readonly Dictionary<Type, MessageDescriptionItems> _messages; 51_contracts = new Dictionary<Type, ContractDescription>(); 52_messages = new Dictionary<Type, MessageDescriptionItems>(); 56private ContractDescription LoadContractDescriptionHelper(Type contractType, Type serviceType, object serviceImplementation) 70Type actualContractType = ServiceReflector.GetContractTypeAndAttribute(contractType, out actualContractAttribute); 102private void EnsureNoInheritanceWithContractClasses(Type actualContractType) 107for (Type service = actualContractType.BaseType(); service != null; service = service.BaseType()) 118private void EnsureNoOperationContractsOnNonServiceContractTypes(Type actualContractType) 120foreach (Type t in actualContractType.GetInterfaces()) 124for (Type u = actualContractType.BaseType(); u != null; u = u.BaseType()) 130private void EnsureNoOperationContractsOnNonServiceContractTypes_Helper(Type aParentType) 138Type operationContractProviderType = ServiceReflector.GetOperationContractProviderType(methodInfo); 156public ContractDescription LoadContractDescription(Type contractType) 163public ContractDescription LoadContractDescription(Type contractType, Type serviceType) 171public ContractDescription LoadContractDescription(Type contractType, Type serviceType, object serviceImplementation) 182Type channelType = typeof(IOutputChannel); 197Type channelType = typeof(IRequestChannel); 212private void AddBehaviors(ContractDescription contractDesc, Type implType, bool implIsCallback, ContractReflectionInfo reflectionInfo) 230Type targetIface = implIsCallback ? opDesc.DeclaringContract.CallbackContractType : opDesc.DeclaringContract.ContractType; 246delegate (Type currentType, KeyedByTypeCollection<IOperationBehavior> behaviors) 260delegate (Type currentType, KeyedByTypeCollection<IOperationBehavior> behaviors) 273Type targetInterface = implIsCallback ? reflectionInfo.callbackiface : reflectionInfo.iface; 305private void GetIContractBehaviorsFromInterfaceType(Type interfaceType, KeyedByTypeCollection<IContractBehavior> behaviors) 315private static void UpdateContractDescriptionWithAttributesFromServiceType(ContractDescription description, Type serviceType) 319delegate (Type currentType, KeyedByTypeCollection<IContractBehavior> behaviors) 331IEnumerable<Type> knownTypes = GetKnownTypes(customAttributes, reflectionInfo.iface); 332foreach (Type knownType in knownTypes) 345foreach (Type knownType in knownTypes) 356private IEnumerable<Type> GetKnownTypes(object[] knownTypeAttributes, CustomAttributeProvider provider) 363Type type = knownTypeAttribute.DeclaringType; 374if (!typeof(IEnumerable<Type>).IsAssignableFrom(method.ReturnType)) 377return (IEnumerable<Type>)method.Invoke(null, new object[] { provider }); 381List<Type> knownTypes = new List<Type>(); 392private KeyedByTypeCollection<IOperationBehavior> GetIOperationBehaviorAttributesFromType(OperationDescription opDesc, Type targetIface, Type implType) 427Type ifaceType, Type implType, bool useImplAttrs) 502private static MethodInfo GetCorrespondingMethodFromType(Type type, MethodInfo methodInfo) 581internal void AddBehaviorsSFx(ServiceEndpoint serviceEndpoint, Type contractType) 593internal void AddBehaviorsFromImplementationType(ServiceEndpoint serviceEndpoint, Type implementationType) 610Type targetIface = serviceEndpoint.Contract.CallbackContractType; 618delegate (Type currentType, KeyedByTypeCollection<IOperationBehavior> behaviors) 631Type t = behavior.GetType(); 673Type contractToGetMethodsFrom, 701internal static void EnsureCallbackType(Type callbackType) 710internal static void EnsureSubcontract(ServiceContractAttribute svcContractAttr, Type contractType) 712Type callbackType = svcContractAttr.CallbackContract; 714List<Type> types = ServiceReflector.GetInheritedContractTypes(contractType); 717Type inheritedContractType = types[i]; 738private ContractDescription CreateContractDescription(ServiceContractAttribute contractAttr, Type contractType, Type serviceType, out ContractReflectionInfo reflectionInfo, object serviceImplementation) 750Type callbackType = contractAttr.CallbackContract; 765List<Type> types = ServiceReflector.GetInheritedContractTypes(contractType); 766List<Type> inheritedCallbackTypes = new List<Type>(); 769Type inheritedContractType = types[i]; 863Type taskTResult; 988IEnumerable<Type> knownTypes = GetKnownTypes(methodAttributes, methodInfo); 989foreach (Type knownType in knownTypes) 1118Type taskTResult, 1157Type responseType = isTask ? taskTResult : methodInfo.ReturnType; 1202Type returnType, 1252private static MessagePartDescription CreateParameterPartDescription(XmlName defaultName, string defaultNS, int index, CustomAttributeProvider attrProvider, Type type) 1266internal MessageDescription CreateTypedMessageDescription(Type typedMessageType, 1293for (Type baseType = typedMessageType; baseType != null && baseType != typeof(object) && baseType != typeof(ValueType); baseType = baseType.BaseType()) 1358Type memberType; 1413private MessagePartDescription CreateMessagePartDescription(Type bodyType, 1449private MessageHeaderDescription CreateMessageHeaderDescription(Type headerParameterType, 1520internal static Type GetParameterType(ParameterInfo parameterInfo) 1522Type parameterType = parameterInfo.ParameterType; 1958internal Type iface; 1959internal Type callbackiface; 1975Type serviceType, 1983for (Type currentType = serviceType; currentType != null; currentType = currentType.BaseType()) 1989public delegate void ServiceInheritanceCallback<IBehavior, TBehaviorCollection>(Type currentType, KeyedByTypeCollection<IBehavior> behaviors); 2001Type type,
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\XmlSerializerOperationBehavior.cs (11)
178internal Reflector(string defaultNs, Type type) 198Type contractType = operation.DeclaringContract != null ? operation.DeclaringContract.ContractType : null; 341foreach (Type knownType in Operation.KnownTypes) 589internal XmlTypeMapping ImportTypeMapping(Type type) 594internal void IncludeType(Type knownType) 604private Type _type; 607internal SerializerGenerationContext(Type type) 675private XmlSerializer[] CreateSerializersFromMappings(XmlMapping[] mappings, Type type) 825static internal XmlReflectionMember GetXmlReflectionMember(XmlName memberName, XmlName elementName, string ns, Type type, MemberInfo additionalAttributesProvider, bool isMultiple, bool isWrapped) 844Type invalidAttributeType = null; 924public static XmlSerializer[] FromMappings(XmlMapping[] mappings, Type type)
FrameworkFork\System.ServiceModel\System\ServiceModel\Diagnostics\SecurityTraceRecordHelper.cs (4)
27internal static void TraceIdentityVerificationSuccess(EventTraceActivity eventTraceActivity, EndpointIdentity identity, Claim claim, Type identityVerifier) 31internal static void TraceIdentityVerificationFailure(EndpointIdentity identity, AuthorizationContext authContext, Type identityVerifier) 35internal static void TraceIdentityDeterminationSuccess(EndpointAddress epr, EndpointIdentity identity, Type identityVerifier) 39internal static void TraceIdentityDeterminationFailure(EndpointAddress epr, Type identityVerifier)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ChannelHandler.cs (2)
481Type contractType = clientRuntime.ContractClientType; 482Type callbackType = clientRuntime.CallbackClientType;
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ClientOperation.cs (2)
48private Type _taskTResult; 261public Type TaskTResult
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ClientRuntime.cs (4)
51private Type _callbackProxyType; 55private Type _contractProxyType; 120public Type CallbackClientType 148public Type ContractClientType
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DataContractSerializerFaultFormatter.cs (1)
11internal DataContractSerializerFaultFormatter(Type[] detailTypes)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (27)
20internal static DataContractSerializer CreateSerializer(Type type, int maxItems) 25internal static DataContractSerializer CreateSerializer(Type type, IList<Type> knownTypes, int maxItems) 32internal static DataContractSerializer CreateSerializer(Type type, string rootName, string rootNs, int maxItems) 37internal static DataContractSerializer CreateSerializer(Type type, IList<Type> knownTypes, string rootName, string rootNs, int maxItems) 46internal static DataContractSerializer CreateSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNs, int maxItems) 51internal static DataContractSerializer CreateSerializer(Type type, IList<Type> knownTypes, XmlDictionaryString rootName, XmlDictionaryString rootNs, int maxItems) 63private static Type s_typeOfIQueryable = typeof(IQueryable); 64private static Type s_typeOfIQueryableGeneric = typeof(IQueryable<>); 65private static Type s_typeOfIEnumerable = typeof(IEnumerable); 66private static Type s_typeOfIEnumerableGeneric = typeof(IEnumerable<>); 70private IList<Type> _knownTypes; 81foreach (Type type in description.KnownTypes) 84_knownTypes = new List<Type>(); 132private void ValidateDataContractType(Type type) 250KeyValuePair<Type, ArrayList>[] multipleHeaderValues = null; 282multipleHeaderValues = new KeyValuePair<Type, ArrayList>[parameters.Length]; 285multipleHeaderValues[headerDescription.Index] = new KeyValuePair<System.Type, System.Collections.ArrayList>(headerDescription.TypedHeader ? TypedHeaderManager.GetMessageHeaderType(headerDescription.Type) : headerDescription.Type, new ArrayList()); 327Type dataContractType = DataContractSerializerOperationFormatter.GetSubstituteDataContractType(headerDescription.Type, out isQueryable); 451internal static Type GetSubstituteDataContractType(Type type, out bool isQueryable) 509private IList<Type> _knownTypes; 511private Type _contractType; 515IList<Type> knownTypes, DataContractSerializerOperationBehavior behavior) 527public Type ContractType
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DispatchRuntime.cs (2)
33private Type _type; 193public Type Type
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\FaultContractInfo.cs (7)
14private Type _detail; 17private IList<Type> _knownTypes; 20public FaultContractInfo(string action, Type detail) 24internal FaultContractInfo(string action, Type detail, XmlName elementName, string ns, IList<Type> knownTypes) 45public Type Detail { get { return _detail; } } 51internal IList<Type> KnownTypes { get { return _knownTypes; } }
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\FaultFormatter.cs (10)
17internal FaultFormatter(Type[] detailTypes) 40Type detailType = null; 43Type faultExceptionOfT = null; 44for (Type faultType = faultException.GetType(); faultType != typeof(FaultException); faultType = faultType.BaseType()) 68protected virtual XmlObjectSerializer GetSerializer(Type detailType, string faultExceptionAction, out string action) 110Type detailType = null; 137object detailObj, Type detailType, XmlDictionaryReader detailReader) 156Type knownFaultType = typeof(FaultException<>).MakeGenericType(detailType); 181private static MessageFault CreateMessageFault(XmlObjectSerializer serializer, FaultException faultException, Type detailType) 191Type operationFaultType = typeof(OperationFault<>).MakeGenericType(detailType);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\OperationFormatter.cs (1)
158private static object CreateTypedMessageInstance(Type messageContractType)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\PrimitiveOperationFormatter.cs (4)
205private static string GetArrayItemName(Type type) 230Type type = part.Type; 295Type type = bodyDescription.Type; 327private static bool IsArrayTypeSupported(Type type)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ProxyOperationRuntime.cs (2)
138internal Type TaskTResult 264internal static object GetDefaultParameterValue(Type parameterType)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (2)
25public TaskMethodInvoker(MethodInfo taskMethod, Type taskType) 119returnVal = _taskTResultGetMethod.Invoke(task, Type.EmptyTypes);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\XmlSerializerFaultFormatter.cs (3)
22internal XmlSerializerFaultFormatter(Type[] detailTypes, 45protected override XmlObjectSerializer GetSerializer(Type detailType, string faultExceptionAction, out string action) 89Type detailType = null;
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\XmlSerializerObjectSerializer.cs (4)
18private Type _rootType; 23internal XmlSerializerObjectSerializer(Type type) 28internal XmlSerializerObjectSerializer(Type type, XmlQualifiedName qualifiedName, XmlSerializer xmlSerializer) 37private void Initialize(Type type, string rootName, string rootNamespace, XmlSerializer xmlSerializer)
FrameworkFork\System.ServiceModel\System\ServiceModel\DuplexChannelFactory.cs (11)
14public DuplexChannelFactory(Type callbackInstanceType) 17public DuplexChannelFactory(Type callbackInstanceType, Binding binding, String remoteAddress) 20public DuplexChannelFactory(Type callbackInstanceType, Binding binding, EndpointAddress remoteAddress) 23public DuplexChannelFactory(Type callbackInstanceType, Binding binding) 26public DuplexChannelFactory(Type callbackInstanceType, string endpointConfigurationName, EndpointAddress remoteAddress) 29public DuplexChannelFactory(Type callbackInstanceType, string endpointConfigurationName) 32public DuplexChannelFactory(Type callbackInstanceType, ServiceEndpoint endpoint) 173if (callbackInstance is Type) 175this.CallbackType = (Type)callbackInstance; 233Type userObjectType = callbackInstance.UserObject.GetType(); 234Type callbackType = this.Endpoint.Contract.CallbackContractType;
FrameworkFork\System.ServiceModel\System\ServiceModel\FaultContractAttribute.cs (3)
17private Type _type; 21public FaultContractAttribute(Type detailType) 29public Type DetailType
FrameworkFork\System.ServiceModel\System\ServiceModel\FaultException.cs (2)
156public static FaultException CreateFault(MessageFault messageFault, params Type[] faultDetailTypes) 161public static FaultException CreateFault(MessageFault messageFault, string action, params Type[] faultDetailTypes)
FrameworkFork\System.ServiceModel\System\ServiceModel\KeyedByTypeCollection.cs (2)
10public class KeyedByTypeCollection<TItem> : KeyedCollection<Type, TItem> 88protected override Type GetKeyForItem(TItem item)
FrameworkFork\System.ServiceModel\System\ServiceModel\MessageHeaderT.cs (13)
61internal Type GetGenericArgument() 81private static Dictionary<Type, TypedHeaderManager> s_cache = new Dictionary<Type, TypedHeaderManager>(); 83private static Type s_GenericAdapterType = typeof(GenericAdapter<>); 85internal static object Create(Type t, object content, bool mustUnderstand, bool relay, string actor) 90internal static object GetContent(Type t, object typedHeaderInstance, out bool mustUnderstand, out bool relay, out string actor) 95internal static Type GetMessageHeaderType(Type contentType) 99internal static Type GetHeaderType(Type headerParameterType) 107private static TypedHeaderManager GetTypedHeaderManager(Type t) 149protected abstract Type GetMessageHeaderType(); 180protected override Type GetMessageHeaderType()
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\RequestSecurityToken.cs (2)
39private Type _appliesToType; 378internal Type AppliesToType
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\RequestSecurityTokenResponse.cs (2)
40private Type _appliesToType; 397internal Type AppliesToType
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityProtocolFactory.cs (2)
740Type authenticatorType = spec.TokenAuthenticator.GetType(); 744Type spec2AuthenticatorType = spec2.TokenAuthenticator.GetType();
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\Tokens\SecurityContextCookieSerializer.cs (3)
24private IList<Type> _knownTypes; 26public SecurityContextCookieSerializer(SecurityStateEncoder securityStateEncoder, IList<Type> knownTypes) 33_knownTypes = knownTypes ?? new List<Type>();
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WrapperSecurityCommunicationObject.cs (1)
27protected override Type GetCommunicationObjectType()
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSKeyInfoSerializer.cs (7)
106public override Type GetTokenType(SecurityKeyIdentifierClause clause) 188private Type[] _tokenTypes; 202protected override Type[] GetTokenTypesCore() 205_tokenTypes = new Type[] { typeof(SecurityContextSecurityToken) }; 218private Type[] _tokenTypes; 231protected override Type[] GetTokenTypesCore() 234_tokenTypes = new Type[] { typeof(DerivedKeySecurityToken) };
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecureConversation.cs (5)
97protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(DerivedKeySecurityToken) }; } 309public SecurityContextTokenEntry(WSSecureConversation parent, SecurityStateEncoder securityStateEncoder, IList<Type> knownClaimTypes) 322protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(SecurityContextSecurityToken) }; }
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecureConversationDec2005.cs (5)
34private IList<Type> _knownClaimTypes; 36public WSSecureConversationDec2005(WSSecurityTokenSerializer tokenSerializer, SecurityStateEncoder securityStateEncoder, IEnumerable<Type> knownTypes, 49_knownClaimTypes = new List<Type>(); 53foreach (Type knownType in knownTypes) 81public SecurityContextTokenEntryDec2005(WSSecureConversationDec2005 parent, SecurityStateEncoder securityStateEncoder, IList<Type> knownClaimTypes)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecureConversationFeb2005.cs (5)
34private IList<Type> _knownClaimTypes; 36public WSSecureConversationFeb2005(WSSecurityTokenSerializer tokenSerializer, SecurityStateEncoder securityStateEncoder, IEnumerable<Type> knownTypes, 49_knownClaimTypes = new List<Type>(); 53foreach (Type knownType in knownTypes) 73public SecurityContextTokenEntryFeb2005(WSSecureConversationFeb2005 parent, SecurityStateEncoder securityStateEncoder, IList<Type> knownClaimTypes)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityJan2004.cs (10)
157protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(GenericXmlSecurityToken) }; } 200protected override Type[] GetTokenTypesCore() 242protected override Type[] GetTokenTypesCore() 277protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(UserNameSecurityToken) }; } 421protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(WrappedKeySecurityToken) }; } 476protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(X509SecurityToken), typeof(X509WindowsSecurityToken) }; }
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityTokenSerializer.cs (13)
60public WSSecurityTokenSerializer(SecurityVersion securityVersion, bool emitBspRequiredAttributes, SamlSerializer samlSerializer, SecurityStateEncoder securityStateEncoder, IEnumerable<Type> knownTypes) 65public WSSecurityTokenSerializer(SecurityVersion securityVersion, TrustVersion trustVersion, SecureConversationVersion secureConversationVersion, bool emitBspRequiredAttributes, SamlSerializer samlSerializer, SecurityStateEncoder securityStateEncoder, IEnumerable<Type> knownTypes) 70public WSSecurityTokenSerializer(SecurityVersion securityVersion, bool emitBspRequiredAttributes, SamlSerializer samlSerializer, SecurityStateEncoder securityStateEncoder, IEnumerable<Type> knownTypes, 76public WSSecurityTokenSerializer(SecurityVersion securityVersion, TrustVersion trustVersion, SecureConversationVersion secureConversationVersion, bool emitBspRequiredAttributes, SamlSerializer samlSerializer, SecurityStateEncoder securityStateEncoder, IEnumerable<Type> knownTypes, 359internal Type[] GetTokenTypes(string tokenTypeUri) 376protected internal virtual string GetTokenTypeUri(Type tokenType) 445private Type[] _tokenTypes = null; 455public Type TokenType { get { return GetTokenTypes()[0]; } } 459protected abstract Type[] GetTokenTypesCore(); 461public Type[] GetTokenTypes() 468public bool SupportsCore(Type tokenType) 470Type[] tokenTypes = GetTokenTypes(); 484protected static SecurityKeyIdentifierClause CreateDirectReference(XmlElement issuedTokenXml, string idAttributeLocalName, string idAttributeNamespace, Type tokenType)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSTrust.cs (2)
88protected override Type[] GetTokenTypesCore() { return new Type[] { typeof(BinarySecretSecurityToken) }; }
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceContractAttribute.cs (2)
14private Type _callbackContract = null; 103public Type CallbackContract
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceKnownTypeAttribute.cs (6)
10private Type _declaringType; 12private Type _type; 19public ServiceKnownTypeAttribute(Type type) 29public ServiceKnownTypeAttribute(string methodName, Type declaringType) 35public Type DeclaringType 45public Type Type
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedReadOnlyCollection.cs (1)
267Type type = (value == null) ? typeof(Object) : value.GetType();
FrameworkFork\System.Web.Services\Configuration\WebServicesSection.cs (8)
30internal static void LoadXmlFormatExtensions(Type[] extensionTypes, XmlAttributeOverrides overrides, XmlSerializerNamespaces namespaces) 51foreach (Type extensionType in extensionTypes) 64foreach (Type extensionPointType in extensionAttr.ExtensionPoints) 91foreach (Type extensionPointType in table.Keys) 103internal Type[] GetAllFormatExtensionTypes() 109private static XmlFormatExtensionPointAttribute GetExtensionPointAttribute(Type type) 117private Type[] _defaultFormatTypes = new Type[] {
FrameworkFork\System.Web.Services\Services\Description\ServiceDescription.cs (3)
1637public object Find(Type type) 1655public object[] FindAll(Type type) 3211private static string GetDuplicateMessage(Type type, string elemName)
FrameworkFork\System.Web.Services\Services\Description\ServiceDescriptionSerializer.cs (88)
30System.Type t = o.GetType(); 142System.Type t = o.GetType(); 212System.Type t = o.GetType(); 299System.Type t = o.GetType(); 327System.Type t = o.GetType(); 355System.Type t = o.GetType(); 383System.Type t = o.GetType(); 480System.Type t = o.GetType(); 578System.Type t = o.GetType(); 660System.Type t = o.GetType(); 709System.Type t = o.GetType(); 758System.Type t = o.GetType(); 864System.Type t = o.GetType(); 901System.Type t = o.GetType(); 979System.Type t = o.GetType(); 1016System.Type t = o.GetType(); 1065System.Type t = o.GetType(); 1093System.Type t = o.GetType(); 1122System.Type t = o.GetType(); 1162System.Type t = o.GetType(); 1202System.Type t = o.GetType(); 1244System.Type t = o.GetType(); 1285System.Type t = o.GetType(); 1327System.Type t = o.GetType(); 1368System.Type t = o.GetType(); 1482System.Type t = o.GetType(); 1509System.Type t = o.GetType(); 1536System.Type t = o.GetType(); 1580System.Type t = o.GetType(); 1608System.Type t = o.GetType(); 1656System.Type t = o.GetType(); 1688System.Type t = o.GetType(); 1716System.Type t = o.GetType(); 1748System.Type t = o.GetType(); 1818System.Type t = o.GetType(); 1919System.Type t = o.GetType(); 1980System.Type t = o.GetType(); 2041System.Type t = o.GetType(); 2102System.Type t = o.GetType(); 2172System.Type t = o.GetType(); 2234System.Type t = o.GetType(); 2303System.Type t = o.GetType(); 2439System.Type t = o.GetType(); 2502System.Type t = o.GetType(); 2563System.Type t = o.GetType(); 2623System.Type t = o.GetType(); 2682System.Type t = o.GetType(); 2760System.Type t = o.GetType(); 2817System.Type t = o.GetType(); 2933System.Type t = o.GetType(); 2982System.Type t = o.GetType(); 3023System.Type t = o.GetType(); 3072System.Type t = o.GetType(); 3122System.Type t = o.GetType(); 3185System.Type t = o.GetType(); 3224System.Type t = o.GetType(); 3330System.Type t = o.GetType(); 3372System.Type t = o.GetType(); 3414System.Type t = o.GetType(); 3456System.Type t = o.GetType(); 3498System.Type t = o.GetType(); 3540System.Type t = o.GetType(); 3582System.Type t = o.GetType(); 3624System.Type t = o.GetType(); 3666System.Type t = o.GetType(); 3708System.Type t = o.GetType(); 3750System.Type t = o.GetType(); 3792System.Type t = o.GetType(); 3834System.Type t = o.GetType(); 3928System.Type t = o.GetType(); 4052System.Type t = o.GetType(); 4094System.Type t = o.GetType(); 4170System.Type t = o.GetType(); 4208System.Type t = o.GetType(); 4248System.Type t = o.GetType(); 4297System.Type t = o.GetType(); 4375System.Type t = o.GetType(); 4430System.Type t = o.GetType(); 4521System.Type t = o.GetType(); 4612System.Type t = o.GetType(); 4666System.Type t = o.GetType(); 4800System.Type t = o.GetType(); 4866System.Type t = o.GetType(); 4906System.Type t = o.GetType(); 4972System.Type t = o.GetType(); 5010System.Type t = o.GetType(); 5049System.Type t = o.GetType(); 5125System.Type t = o.GetType();
FrameworkFork\System.Web.Services\Services\Description\WebReferenceOptions.cs (1)
231System.Type t = o.GetType();
FrameworkFork\System.Web.Services\Services\Description\XmlFormatExtensionAttribute.cs (18)
16private Type[] _types; 29public XmlFormatExtensionAttribute(string elementName, string ns, Type extensionPoint1) : this(elementName, ns, new Type[] { extensionPoint1 }) 33public XmlFormatExtensionAttribute(string elementName, string ns, Type extensionPoint1, Type extensionPoint2) : this(elementName, ns, new Type[] { extensionPoint1, extensionPoint2 }) 37public XmlFormatExtensionAttribute(string elementName, string ns, Type extensionPoint1, Type extensionPoint2, Type extensionPoint3) : this(elementName, ns, new Type[] { extensionPoint1, extensionPoint2, extensionPoint3 }) 41public XmlFormatExtensionAttribute(string elementName, string ns, Type extensionPoint1, Type extensionPoint2, Type extensionPoint3, Type extensionPoint4) : this(elementName, ns, new Type[] { extensionPoint1, extensionPoint2, extensionPoint3, extensionPoint4 }) 49public XmlFormatExtensionAttribute(string elementName, string ns, Type[] extensionPoints) 60public Type[] ExtensionPoints 62get { return _types == null ? new Type[0] : _types; }
ImportModule.cs (5)
169var importer1 = ServiceDescriptor.DefaultUseMessageFormat ? typeof(DataContractSerializerMessageContractImporter) : typeof(XmlSerializerMessageContractImporter); 170var importer2 = ServiceDescriptor.DefaultUseMessageFormat ? typeof(XmlSerializerMessageContractImporter) : typeof(DataContractSerializerMessageContractImporter); 319foreach (Type referencedType in options.ReferencedTypes) 321foreach (Type referencedCollectionType in options.ReferencedCollectionTypes) 364private static void RemoveExtension(Type extensionType, Collection<IWsdlImportExtension> wsdlImportExtensions)
Metadata\ServiceDescriptor.cs (4)
116Type type = assembly.GetType("Microsoft.Tools.ServiceModel.Svcutil.NamedPipeMetadataImporter"); 267Type wsdlImporterType = typeof(WsdlImporter); 269Type importerQuotasType = smAssembly.GetType("System.ServiceModel.Description.MetadataImporterQuotas", throwOnError: false, ignoreCase: true); 276new Type[4]
Shared\Options\OptionsSerializer.cs (2)
33public override bool CanConvert(Type objectType) 39public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Shared\Options\OptionValueParser.cs (4)
26var valueType = typeof(TValue); 94var valueType = value.GetType(); 178var valueType = value.GetType(); 225Type thisType = typeof(TValue);
Shared\ProjectPropertyResolver.cs (1)
52var projType = msbuildAssembly.GetType("Microsoft.Build.Evaluation.Project", true, false);
TypeLoader.cs (10)
38static public Type[] LoadTypes(Assembly assembly, Verbosity verbosity) 40List<Type> listType = new List<Type>(); 49listType.AddRange(Array.FindAll<Type>(rtle.Types, delegate (Type t) 94static private List<Type> GetUnAvailableTypes(List<Type> types) 96List<Type> unavailableTypes = new List<Type>(); 97foreach (Type type in types)
FormatterWebSite (4)
IModelConverter.cs (2)
11public override bool CanConvert(Type objectType) 16public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Models\InfinitelyRecursiveModel.cs (2)
15public override bool CanConvert(Type objectType) => objectType == typeof(RecursiveIdentifier); 17public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
GetDocument.Insider (15)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-alpha.1.24619.8\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (4)
97var programType = assembly?.EntryPoint?.DeclaringType; 191var hostType = host.GetType(); 353Type? publicHostAbortedExceptionType = Type.GetType("Microsoft.Extensions.Hosting.HostAbortedException, Microsoft.Extensions.Hosting.Abstractions", throwOnError: false);
Commands\GetDocumentCommandWorker.cs (11)
38private static readonly Type[] _getDocumentsParameterTypes = Type.EmptyTypes; 39private static readonly Type _getDocumentsReturnType = typeof(IEnumerable<string>); 42private static readonly Type[] _generateMethodParameterTypes = [typeof(string), typeof(TextWriter)]; 43private static readonly Type[] _generateWithVersionMethodParameterTypes = [typeof(string), typeof(TextWriter), typeof(OpenApiSpecVersion)]; 44private static readonly Type _generateMethodReturnType = typeof(Task); 59var entryPointType = assembly.EntryPoint?.DeclaringType; 193Type serviceType = null; 426private MethodInfo GetMethod(string methodName, Type type, Type[] parameterTypes, Type returnType)
HealthChecksSample (3)
Program.cs (3)
8private static readonly Dictionary<string, Type> _scenarios; 12_scenarios = new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase) 39if (!_scenarios.TryGetValue(scenario, out var startupType))
IIS.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
illink (124)
ILLink.RoslynAnalyzer (103)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (103)
14 /// <see cref="System.Reflection.IntrospectionExtensions.GetTypeInfo(System.Type)"/> 18 /// <see cref="System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"/> 22 /// <see cref="System.Type.TypeHandle"/> 57 /// <see cref="System.Array.CreateInstance(System.Type, int)"/> 61 /// <see cref="System.Type.MakeGenericType(System.Type[])"/> 66 /// <item><see cref="System.Type.GetType(string)"/></item> 67 /// <item><see cref= "System.Type.GetType(string, bool)" /></item> 68 /// <item><see cref="System.Type.GetType(string, bool, bool)"/></item> 69 /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?)"/></item> 70 /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?, bool)"/></item> 71 /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?, bool, bool)"/></item> 76 /// <item><see cref="System.Type.GetConstructor(System.Type[])"/></item> 77 /// <item><see cref="System.Type.GetConstructor(System.Reflection.BindingFlags, System.Type[])"/></item> 78 /// <item><see cref="System.Type.GetConstructor(System.Reflection.BindingFlags, System.Reflection.Binder?, System.Type[], System.Reflection.ParameterModifier[]?)"/></item> 79 /// <item><see cref="System.Type.GetConstructor(System.Reflection.BindingFlags, System.Reflection.Binder?, System.Reflection.CallingConventions, System.Type[], System.Reflection.ParameterModifier[]?)"/></item> 84 /// <see cref="System.Type.GetConstructors(System.Reflection.BindingFlags)"/> 88 /// <item><see cref="System.Type.GetMethod(string)"/></item> 89 /// <item><see cref="System.Type.GetMethod(string, System.Reflection.BindingFlags)"/></item> 90 /// <item><see cref="System.Type.GetMethod(string, System.Type[])"/></item> 91 /// <item><see cref="System.Type.GetMethod(string, System.Type[], System.Reflection.ParameterModifier[]?)"/></item> 92 /// <item><see cref="System.Type.GetMethod(string, System.Reflection.BindingFlags, System.Type[])"/></item> 93 /// <item><see cref="System.Type.GetMethod(string, System.Reflection.BindingFlags, System.Reflection.Binder, System.Type[], System.Reflection.ParameterModifier[]?)"/></item> 94 /// <item><see cref="System.Type.GetMethod(string, System.Reflection.BindingFlags, System.Reflection.Binder, System.Reflection.CallingConventions, System.Type[], System.Reflection.ParameterModifier[]?)"/></item> 95 /// <item><see cref="System.Type.GetMethod(string, int, System.Type[])"/></item> 96 /// <item><see cref="System.Type.GetMethod(string, int, System.Type[], System.Reflection.ParameterModifier[]?)"/></item> 97 /// <item><see cref="System.Type.GetMethod(string, int, System.Reflection.BindingFlags, System.Reflection.Binder?, System.Type[], System.Reflection.ParameterModifier[]?)"/></item> 98 /// <item><see cref="System.Type.GetMethod(string, int, System.Reflection.BindingFlags, System.Reflection.Binder?, System.Reflection.CallingConventions, System.Type[], System.Reflection.ParameterModifier[]?)"/></item> 103 /// <see cref="System.Type.GetMethod(System.Reflection.BindingFlags)"/> 108 /// <item><see cref="System.Type.GetField(string)"/></item> 109 /// <item><see cref="System.Type.GetField(string, System.Reflection.BindingFlags)"/></item> 114 /// <see cref="System.Type.GetFields(System.Reflection.BindingFlags)"/> 119 /// <item><see cref="System.Type.GetProperty(string)"/></item> 120 /// <item><see cref="System.Type.GetProperty(string, System.Reflection.BindingFlags)"/></item> 121 /// <item><see cref="System.Type.GetProperty(string, System.Type?)"/></item> 122 /// <item><see cref="System.Type.GetProperty(string, System.Type[])"/></item> 123 /// <item><see cref="System.Type.GetProperty(string, System.Type?, System.Type[])"/></item> 124 /// <item><see cref="System.Type.GetProperty(string, System.Type?, System.Type[], System.Reflection.ParameterModifier[])"/></item> 125 /// <item><see cref="System.Type.GetProperty(string, System.Reflection.BindingFlags, System.Reflection.Binder?, System.Type?, System.Type[], System.Reflection.ParameterModifier[]?)"/></item> 130 /// <see cref="System.Type.GetProperties(System.Reflection.BindingFlags)"/> 135 /// <item><see cref="System.Type.GetEvent(string)"/></item> 136 /// <item><see cref="System.Type.GetEvent(string, System.Reflection.BindingFlags)"/></item> 141 /// <see cref="System.Type.GetEvents(System.Reflection.BindingFlags)"/> 146 /// <item><see cref="System.Type.GetNestedType(string)"/></item> 147 /// <item><see cref="System.Type.GetNestedType(string, System.Reflection.BindingFlags)"/></item> 152 /// <see cref="System.Type.GetNestedTypes(System.Reflection.BindingFlags)"/> 157 /// <item><see cref="System.Type.GetMember(string)"/></item> 158 /// <item><see cref="System.Type.GetMember(string, System.Reflection.BindingFlags)"/></item> 159 /// <item><see cref="System.Type.GetMember(string, System.Reflection.MemberTypes, System.Reflection.BindingFlags)"/></item> 164 /// <see cref="System.Type.GetMembers(System.Reflection.BindingFlags)"/> 169 /// <item><see cref="System.Type.GetInterface(string)"/></item> 170 /// <item><see cref="System.Type.GetInterface(string, bool)"/></item> 175 /// <see cref="System.Type.AssemblyQualifiedName"/> 179 /// <see cref="System.Type.UnderlyingSystemType"/> 183 /// <see cref="System.Type.BaseType"/> 187 /// <see cref="System.Linq.Expressions.Expression.Call(System.Type, string, System.Type[]?, System.Linq.Expressions.Expression[]?))"/> 191 /// <see cref="System.Linq.Expressions.Expression.Field(System.Linq.Expressions.Expression?, System.Type, string)"/> 197 /// <item><see cref="System.Linq.Expressions.Expression.Property(System.Linq.Expressions.Expression?, System.Type, string)"/></item> 202 /// <see cref="System.Linq.Expressions.Expression.New(System.Type)"/> 206 /// <see cref="System.Enum.GetValues(System.Type)"/> 210 /// <see cref="System.Runtime.InteropServices.Marshal.SizeOf(System.Type)"/> 214 /// <see cref="System.Runtime.InteropServices.Marshal.OffsetOf(System.Type, string)"/> 218 /// <see cref="System.Runtime.InteropServices.Marshal.PtrToStructure(nint, System.Type)"/> 222 /// <see cref="System.Runtime.InteropServices.Marshal.DestroyStructure(nint, System.Type)"/> 226 /// <see cref="System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(nint, System.Type)"/> 230 /// <item><see cref="System.Activator.CreateInstance(System.Type)"/></item> 231 /// <item><see cref="System.Activator.CreateInstance(System.Type, bool)"/></item> 232 /// <item><see cref="System.Activator.CreateInstance(System.Type, object[])"/></item> 233 /// <item><see cref="System.Activator.CreateInstance(System.Type, object[], object[])"/></item> 234 /// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo)"/></item> 235 /// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item> 320 /// <see cref="System.Reflection.RuntimeReflectionExtensions.GetRuntimeEvent(System.Type, string)"/> 324 /// <see cref="System.Reflection.RuntimeReflectionExtensions.GetRuntimeField(System.Type, string)"/> 328 /// <see cref="System.Reflection.RuntimeReflectionExtensions.GetRuntimeMethod(System.Type, string, System.Type[])"/> 332 /// <see cref="System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty(System.Type, string)"/> 340 /// <see cref="System.Reflection.MethodInfo.MakeGenericMethod(System.Type[])"/> 344 /// <see cref="System.Nullable.GetUnderlyingType(System.Type)"/>
Infrastructure.Common (3)
xunit\ConditionAttribute.cs (3)
43Type testMethodDeclaringType = testMethodInfo.DeclaringType; 58Type declaringType = testMethodDeclaringType; 105internal static MethodInfo LookupConditionalMethod(Type t, string name)
InMemory.FunctionalTests (38)
Http3\Http3TestBase.cs (1)
137public void AssertExpectedErrorMessages(Type exceptionType, string[] expectedErrorMessage)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
144internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, long? expectedLastStreamId, Http3ErrorCode expectedErrorCode, Action<Type, string[]> matchExpectedErrorMessage = null, params string[] expectedErrorMessage) 177private void AssertConnectionError<TException>(Http3ErrorCode expectedErrorCode, Action<Type, string[]> matchExpectedErrorMessage = null, params string[] expectedErrorMessage) where TException : Exception
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
23public List<Type> IgnoredExceptions { get; } = new List<Type>();
src\Servers\Kestrel\shared\test\TestApplicationErrorLoggerLoggedTest.cs (1)
32public List<Type> IgnoredCriticalLogExceptions => TestApplicationErrorLogger.IgnoredExceptions;
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (23)
42private List<KeyValuePair<Type, object>>? MaybeExtra; 70private object? ExtraFeatureGet(Type key) 87private void ExtraFeatureSet(Type key, object? value) 108MaybeExtra = new List<KeyValuePair<Type, object>>(2); 114MaybeExtra[i] = new KeyValuePair<Type, object>(key, value); 118MaybeExtra.Add(new KeyValuePair<Type, object>(key, value)); 126object? IFeatureCollection.this[Type key] 391private IEnumerable<KeyValuePair<Type, object>> FastEnumerable() 395yield return new KeyValuePair<Type, object>(typeof(IConnectionIdFeature), _currentIConnectionIdFeature); 399yield return new KeyValuePair<Type, object>(typeof(IConnectionTransportFeature), _currentIConnectionTransportFeature); 403yield return new KeyValuePair<Type, object>(typeof(IConnectionItemsFeature), _currentIConnectionItemsFeature); 407yield return new KeyValuePair<Type, object>(typeof(IPersistentStateFeature), _currentIPersistentStateFeature); 411yield return new KeyValuePair<Type, object>(typeof(IMemoryPoolFeature), _currentIMemoryPoolFeature); 415yield return new KeyValuePair<Type, object>(typeof(IConnectionLifetimeFeature), _currentIConnectionLifetimeFeature); 419yield return new KeyValuePair<Type, object>(typeof(IConnectionSocketFeature), _currentIConnectionSocketFeature); 423yield return new KeyValuePair<Type, object>(typeof(IProtocolErrorCodeFeature), _currentIProtocolErrorCodeFeature); 427yield return new KeyValuePair<Type, object>(typeof(IStreamDirectionFeature), _currentIStreamDirectionFeature); 431yield return new KeyValuePair<Type, object>(typeof(IStreamIdFeature), _currentIStreamIdFeature); 435yield return new KeyValuePair<Type, object>(typeof(IStreamAbortFeature), _currentIStreamAbortFeature); 439yield return new KeyValuePair<Type, object>(typeof(IStreamClosedFeature), _currentIStreamClosedFeature); 443yield return new KeyValuePair<Type, object>(typeof(IConnectionMetricsTagsFeature), _currentIConnectionMetricsTagsFeature); 455IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() => FastEnumerable().GetEnumerator();
src\Shared\TypeNameHelper\TypeNameHelper.cs (9)
17private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 46/// <param name="type">The <see cref="Type"/>.</param> 52public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 59private static void ProcessType(StringBuilder builder, Type type, in DisplayNameOptions options) 93private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 95var innerType = type; 112private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
InProcessWebSite (1)
src\Servers\IIS\IIS\test\testassets\shared\WebSockets\TestStartup.cs (1)
19var type = startup.GetType();
KeyManagementSimulator (3)
Program.cs (3)
269object IActivator.CreateInstance(Type type, string _friendlyName) => type switch 271Type t when t == typeof(IXmlDecryptor) => decryptor, 272Type t when t == typeof(IAuthenticatedEncryptorDescriptorDeserializer) => descriptorDeserializer,
Microsoft.Analyzers.Extra (1)
Utilities\SyntaxNodeExtensions.cs (1)
106ICollection<Type> typesToStopTraversing)
Microsoft.Analyzers.Extra.Tests (3)
SyntaxNodeExtensionsTests.cs (3)
24Assert.Null(node.FindNodeInTreeUpToSpecifiedParentByMethodName(new Mock<SemanticModel>().Object, emptyList, new List<Type>())); 56Assert.Equal("a.AddA()", methodInvocSyntax?.FindNodeInTreeUpToSpecifiedParentByMethodName(model, new[] { parentToFind }, Array.Empty<Type>())?.ToString()); 88var typesToStopTraversing = new HashSet<Type>
Microsoft.Arcade.Common (1)
MSBuildTaskBase.cs (1)
68public Type[] GetExecuteParameterTypes()
Microsoft.Arcade.Test.Common (2)
AssertEx.cs (2)
29var type = typeof(T); 376var type = ex.GetType();
Microsoft.AspNetCore (1)
ConfigureWebHostBuilder.cs (1)
176IWebHostBuilder ISupportsStartup.UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType)
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticProject.cs (2)
31public static Project Create(Assembly testAssembly, string[] sources, Func<Workspace> workspaceFactory = null, Type[] analyzerReferences = null) 55foreach (var analyzerReference in analyzerReferences)
Microsoft.AspNetCore.App.Analyzers.Test (3)
RouteEmbeddedLanguage\Infrastructure\ExportProviderExtensions.cs (3)
61private (Type exportType, Type metadataType) GetContractType(Type contractType, bool importMany)
Microsoft.AspNetCore.Authentication (1)
AuthenticationSchemeOptions.cs (1)
38public Type? EventsType { get; set; }
Microsoft.AspNetCore.Authentication.Abstractions (3)
AuthenticationScheme.cs (2)
20public AuthenticationScheme(string name, string? displayName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type handlerType) 48public Type HandlerType { get; }
AuthenticationSchemeBuilder.cs (1)
36public Type? HandlerType { get; set; }
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
LoggingExtensions.cs (1)
181public static partial void InvalidSecurityTokenTypeFromHandler(this ILogger logger, Type? securityTokenType);
Microsoft.AspNetCore.Authentication.Test (24)
BearerTokenTests.cs (1)
12protected override Type HandlerType
CookieTests.cs (1)
28protected override Type HandlerType => typeof(CookieAuthenticationHandler);
FacebookTests.cs (1)
25protected override Type HandlerType => typeof(FacebookHandler);
GoogleTests.cs (1)
25protected override Type HandlerType => typeof(GoogleHandler);
JwtBearerTests.cs (8)
30protected override Type HandlerType => typeof(JwtBearerHandler); 306public async Task ExceptionReportedInHeaderForAuthenticationFailures(Type errorType, string message) 330public async Task ExceptionReportedInHeaderWithDetailsForAuthenticationFailures(Type errorType, string message) 350public async Task ExceptionNotReportedInHeaderForOtherFailures(Type errorType) 1020public InvalidTokenValidator(Type exceptionType) 1025public Type ExceptionType { get; set; } 1052public DetailedInvalidTokenValidator(Type exceptionType) 1057public Type ExceptionType { get; set; }
JwtBearerTests_Handler.cs (8)
30protected override Type HandlerType => typeof(JwtBearerHandler); 289public async Task ExceptionReportedInHeaderForAuthenticationFailures(Type errorType, string message) 310public async Task ExceptionReportedInHeaderWithDetailsForAuthenticationFailures(Type errorType, string message) 327public async Task ExceptionNotReportedInHeaderForOtherFailures(Type errorType) 1103public InvalidTokenValidator(Type exceptionType) 1108public Type ExceptionType { get; set; } 1130public DetailedInvalidTokenValidator(Type exceptionType) 1135public Type ExceptionType { get; set; }
MicrosoftAccountTests.cs (1)
26protected override Type HandlerType => typeof(MicrosoftAccountHandler);
OAuthTests.cs (1)
21protected override Type HandlerType => typeof(OAuthHandler<OAuthOptions>);
SharedAuthenticationTests.cs (1)
19protected abstract Type HandlerType { get; }
TwitterTests.cs (1)
24protected override Type HandlerType => typeof(TwitterHandler);
Microsoft.AspNetCore.Components (124)
BindConverter.cs (8)
1668private static readonly ConcurrentDictionary<Type, Delegate> _cache = new ConcurrentDictionary<Type, Delegate>(); 1782else if (typeof(T).IsEnum || Nullable.GetUnderlyingType(typeof(T)) is Type { IsEnum: true } innerType) 1789var elementType = typeof(T).GetElementType()!; 1857private static readonly ConcurrentDictionary<Type, Delegate> _cache = new ConcurrentDictionary<Type, Delegate>(); 1987else if (Nullable.GetUnderlyingType(typeof(T)) is Type innerType && innerType.IsEnum) 1996var elementType = typeof(T).GetElementType()!;
CascadingParameterInfo.cs (2)
24public Type PropertyType { get; } 26internal CascadingParameterInfo(CascadingParameterAttributeBase attribute, string propertyName, Type propertyType)
CascadingParameterState.cs (4)
17private static readonly ConcurrentDictionary<Type, CascadingParameterInfo[]> _cachedInfos = new(); 30var componentType = componentState.Component.GetType(); 105[DynamicallyAccessedMembers(Component)] Type componentType) 117[DynamicallyAccessedMembers(Component)] Type componentType)
ChangeDetection.cs (6)
11private static readonly ConcurrentDictionary<Type, bool> _immutableObjectTypesCache = new(); 31var oldValueType = oldValue!.GetType(); 32var newValueType = newValue!.GetType(); 51private static bool IsKnownImmutableType(Type type) 52=> Type.GetTypeCode(type) != TypeCode.Object 55private static bool IsImmutableObjectTypeCore(Type type)
ComponentFactory.cs (5)
19private static readonly ConcurrentDictionary<Type, ComponentTypeInfoCacheEntry> _cachedComponentTypeInfo = new(); 32private static ComponentTypeInfoCacheEntry GetComponentTypeInfo([DynamicallyAccessedMembers(Component)] Type componentType) 49public IComponent InstantiateComponent(IServiceProvider serviceProvider, [DynamicallyAccessedMembers(Component)] Type componentType, IComponentRenderMode? callerSpecifiedRenderMode, int? parentComponentId) 100private static Action<IServiceProvider, IComponent> CreatePropertyInjector([DynamicallyAccessedMembers(Component)] Type type) 103List<(string name, Type propertyType, PropertySetter setter, object? serviceKey)>? injectables = null;
DefaultComponentActivator.cs (4)
12private static readonly ConcurrentDictionary<Type, ObjectFactory> _cachedComponentTypeInfo = new(); 17public IComponent CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type componentType) 29private static ObjectFactory GetObjectFactory([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type componentType) 36factory = ActivatorUtilities.CreateFactory(componentType, Type.EmptyTypes);
DynamicComponent.cs (2)
33public Type Type { get; set; } = default!; 71Type = (Type)entry.Value;
EventHandlerAttribute.cs (3)
17public EventHandlerAttribute(string attributeName, Type eventArgsType) : this(attributeName, eventArgsType, false, false) 28public EventHandlerAttribute(string attributeName, Type eventArgsType, bool enableStopPropagation, bool enablePreventDefault) 47public Type EventArgsType { get; }
IComponentActivator.cs (1)
20IComponent CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type componentType);
LayoutAttribute.cs (2)
19public LayoutAttribute([DynamicallyAccessedMembers(Component)] Type layoutType) 39public Type LayoutType { get; private set; }
LayoutView.cs (5)
33public Type Layout { get; set; } = default!; 57var layoutType = Layout; 67private static RenderFragment WrapInLayout([DynamicallyAccessedMembers(Component)] Type layoutType, RenderFragment bodyParam) 79private static Type? GetParentLayoutType(Type type)
NavigationManagerExtensions.cs (5)
26private static readonly Dictionary<Type, QueryParameterFormatter<object>> _queryParameterFormatters = new() 222var valueType = value.GetType(); 227var elementType = valueType.GetElementType()!; 717private static QueryParameterFormatter<object> GetFormatterFromParameterValueType(Type parameterValueType) 719var underlyingParameterValueType = Nullable.GetUnderlyingType(parameterValueType) ?? parameterValueType;
Reflection\ComponentProperties.cs (11)
19private static readonly ConcurrentDictionary<Type, WritersForType> _cachedWritersByType 20= new ConcurrentDictionary<Type, WritersForType>(); 28var targetType = target.GetType(); 178internal static IEnumerable<PropertyInfo> GetCandidateBindableProperties([DynamicallyAccessedMembers(Component)] Type targetType) 182private static void ThrowForUnknownIncomingParameterName([DynamicallyAccessedMembers(Component)] Type targetType, 213private static void ThrowForSettingCascadingParameterWithNonCascadingValue(Type targetType, string parameterName) 221private static void ThrowForSettingParameterWithCascadingValue(Type targetType, string parameterName) 229private static void ThrowForCaptureUnmatchedValuesConflict(Type targetType, string parameterName, Dictionary<string, object> unmatched) 238private static void ThrowForMultipleCaptureUnmatchedValuesParameters([DynamicallyAccessedMembers(Component)] Type targetType) 259private static void ThrowForInvalidCaptureUnmatchedValuesParameterType(Type targetType, PropertyInfo propertyInfo) 273public WritersForType([DynamicallyAccessedMembers(Component)] Type targetType)
Reflection\MemberAssignment.cs (2)
14[DynamicallyAccessedMembers(Component)] Type type, 19Type? currentType = type;
Reflection\PropertySetter.cs (1)
21public PropertySetter(Type targetType, PropertyInfo property)
Rendering\RenderTreeBuilder.cs (2)
498public void OpenComponent(int sequence, [DynamicallyAccessedMembers(Component)] Type componentType) 554private void OpenComponentUnchecked(int sequence, [DynamicallyAccessedMembers(Component)] Type componentType)
RenderTree\EventArgsTypeCache.cs (4)
11private static readonly ConcurrentDictionary<MethodInfo, Type> Cache = new ConcurrentDictionary<MethodInfo, Type>(); 13public static Type GetEventArgsType(MethodInfo methodInfo) 28var declaredType = parameterInfos[0].ParameterType;
RenderTree\Renderer.cs (4)
201protected IComponent InstantiateComponent([DynamicallyAccessedMembers(Component)] Type componentType) 319internal Type GetRootComponentType(int componentId) 511public Type GetEventArgsType(ulong eventHandlerId) 1257[DynamicallyAccessedMembers(Component)] Type componentType,
RenderTree\Renderer.Log.cs (5)
14private static partial void InitializingChildComponent(ILogger logger, int componentId, Type componentType, int parentComponentId, Type parentComponentType); 17private static partial void InitializingRootComponent(ILogger logger, int componentId, Type componentType); 35private static partial void RenderingComponent(ILogger logger, int componentId, Type componentType); 46private static partial void DisposingComponent(ILogger logger, int componentId, Type componentType);
RenderTree\RenderTreeFrame.cs (4)
144internal Type ComponentTypeField; 171public Type ComponentType => ComponentTypeField; 316private RenderTreeFrame(int sequence, int componentSubtreeLength, [DynamicallyAccessedMembers(LinkerFlags.Component)] Type componentType, ComponentState componentState, object componentKey) 402internal static RenderTreeFrame ChildComponent(int sequence, [DynamicallyAccessedMembers(LinkerFlags.Component)] Type componentType)
RenderTree\RenderTreeFrameArrayBuilder.cs (1)
78public void AppendComponent(int sequence, [DynamicallyAccessedMembers(Component)] Type componentType)
RouteView.cs (4)
21private static readonly ConcurrentDictionary<Type, Type?> _layoutAttributeCache = new(); 48public Type DefaultLayout { get; set; } 78var pageLayoutType = _layoutAttributeCache
Routing\QueryParameterValueSupplier.cs (2)
30public object? GetQueryParameterValue(Type targetType, string queryParameterName) 33var elementType = isArray ? targetType.GetElementType()! : targetType;
Routing\RouteContext.cs (1)
49public Type? Handler => Entry?.Handler;
Routing\RouteData.cs (2)
20public RouteData([DynamicallyAccessedMembers(Component)] Type pageType, IReadOnlyDictionary<string, object?> routeValues) 37public Type PageType { get; }
Routing\Router.cs (1)
344internal static partial void NavigatingToComponent(ILogger logger, Type componentType, string path, string baseUri);
Routing\RouteTable.cs (2)
14private static readonly ConcurrentDictionary<(Type, string), InboundRouteEntry> _routeEntryCache = new(); 28((Type page, string template) key) => RouteTableFactory.CreateEntry(key.page, key.template));
Routing\RouteTableFactory.cs (10)
50private static List<Type> GetRouteableComponents(RouteKey routeKey) 52var routeableComponents = new List<Type>(); 72static void GetRouteableComponents(List<Type> routeableComponents, Assembly assembly) 74foreach (var type in assembly.ExportedTypes) 86internal static RouteTable Create(List<Type> componentTypes, IServiceProvider serviceProvider) 88var templatesByHandler = new Dictionary<Type, string[]>(); 89foreach (var componentType in componentTypes) 102private static string[] GetTemplates(Type componentType) 116internal static RouteTable Create(Dictionary<Type, string[]> templatesByHandler, IServiceProvider serviceProvider) 170internal static InboundRouteEntry CreateEntry([DynamicallyAccessedMembers(Component)] Type pageType, string template)
Routing\UrlValueConstraint.cs (3)
17private static readonly ConcurrentDictionary<Type, UrlValueConstraint> _cachedInstances = new(); 19public static bool TryGetByTargetType(Type targetType, [MaybeNullWhen(false)] out UrlValueConstraint result) 65private static UrlValueConstraint? Create(Type targetType) => targetType switch
src\Components\Shared\src\HotReloadManager.cs (1)
27public static void UpdateApplication(Type[]? _) => Default.OnDeltaApplied?.Invoke();
src\Http\Routing\src\DefaultInlineConstraintResolver.cs (1)
21private readonly IDictionary<string, Type> _inlineConstraintMap;
src\Http\Routing\src\ParameterPolicyActivator.cs (7)
18IDictionary<string, Type> inlineParameterPolicyMap, 32out var parameterPolicyType)) 70IDictionary<string, Type> inlineParameterPolicyMap, 74[NotNullWhen(true)] out Type? policyType) 97private static IParameterPolicy CreateParameterPolicy(IServiceProvider? serviceProvider, Type parameterPolicyType, string? argumentString) 159private static ConstructorInfo GetLongestConstructor(List<ConstructorInfo> constructors, Type parameterPolicyType) 218var parameterType = parameter.ParameterType;
src\Http\Routing\src\RouteOptions.cs (7)
23private IDictionary<string, Type> _constraintTypeMap = GetDefaultConstraintMap(); 81public IDictionary<string, Type> ConstraintMap 100internal IDictionary<string, Type> TrimmerSafeConstraintMap => _constraintTypeMap; 102private static IDictionary<string, Type> GetDefaultConstraintMap() 104var defaults = new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase); 163public void SetParameterPolicy(string token, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type) 173private static void AddConstraint<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TConstraint>(Dictionary<string, Type> constraintMap, string text) where TConstraint : IRouteConstraint
src\Http\Routing\src\Tree\InboundRouteEntry.cs (1)
44public Type Handler { get; set; }
src\Http\Routing\src\Tree\TreeRouteBuilder.cs (1)
86[DynamicallyAccessedMembers(Component)] Type handler,
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Verifiers\DiagnosticVerifier.cs (1)
244var analyzerType = analyzer.GetType();
Microsoft.AspNetCore.Components.Authorization (3)
AttributeAuthorizeDataCache.cs (3)
11private static readonly ConcurrentDictionary<Type, IAuthorizeData[]?> _cache = new(); 13public static IAuthorizeData[]? GetAuthorizeDataForType(Type type) 24private static IAuthorizeData[]? ComputeAuthorizeDataForType(Type type)
Microsoft.AspNetCore.Components.Authorization.Tests (7)
src\Components\Shared\test\AssertFrame.cs (1)
67public static void Attribute(RenderTreeFrame frame, string attributeName, Type valueType, int? sequence = null)
src\Components\Shared\test\TestServiceProvider.cs (6)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 25public object? GetService(Type serviceType) 30public object? GetKeyedService(Type serviceType, object? serviceKey) 41public object GetRequiredKeyedService(Type serviceType, object? serviceKey)
Microsoft.AspNetCore.Components.Endpoints (224)
Builder\ComponentTypeMetadata.cs (2)
18public ComponentTypeMetadata([DynamicallyAccessedMembers(Component)] Type componentType) 27public Type Type { get; }
Builder\RazorComponentEndpointDataSource.cs (1)
198public void OnHotReloadClearCache(Type[]? types)
Builder\RazorComponentEndpointFactory.cs (1)
24[DynamicallyAccessedMembers(Component)] Type rootComponent,
Builder\RazorComponentsEndpointHttpContextExtensions.cs (3)
20private static readonly ConcurrentDictionary<Type, bool> AcceptsInteractiveRoutingCache = new(); 33var pageType = context.GetEndpoint()?.Metadata.GetMetadata<ComponentTypeMetadata>()?.Type; 46public static void ClearCache(Type[]? _)
Builder\RenderModeEndpointProvider.cs (1)
36[DynamicallyAccessedMembers(Component)] Type rootComponent,
Builder\RootComponentMetadata.cs (2)
18public RootComponentMetadata([DynamicallyAccessedMembers(Component)] Type rootComponentType) 27public Type Type { get; }
DependencyInjection\HotReloadService.cs (5)
20private static event Action<Type[]?>? UpdateApplicationEvent; 21internal static event Action<Type[]?>? ClearCacheEvent; 27public static void UpdateApplication(Type[]? changedTypes) 32public static void ClearCache(Type[]? types) 37private void NotifyUpdateApplication(Type[]? changedTypes)
DependencyInjection\IComponentPrerenderer.cs (2)
26[DynamicallyAccessedMembers(Component)] Type componentType, 41/// Gets a <see cref="Dispatcher"/> that should be used for calls to <see cref="PrerenderComponentAsync(HttpContext, Type, IComponentRenderMode, ParameterView)"/>.
DependencyInjection\ServerComponentSerializer.cs (2)
19public void SerializeInvocation(ref ComponentMarker marker, ServerComponentInvocationSequence invocationId, Type type, ParameterView parameters) 27Type rootComponent,
DependencyInjection\WebAssemblyComponentSerializer.cs (1)
11public static void SerializeInvocation(ref ComponentMarker marker, Type type, ParameterView parameters)
Discovery\ComponentBuilder.cs (1)
37EqualityComparer<Type>.Default.Equals(ComponentType, other.ComponentType);
Discovery\ComponentInfo.cs (4)
20/// <param name="componentType">The component <see cref="Type"/>.</param> 21public ComponentInfo(Type componentType) 28/// Gets the component <see cref="Type"/>. 30public Type ComponentType { get; }
Discovery\IRazorComponentApplication.cs (1)
28var candidate = exported[i];
Discovery\PageCollectionBuilder.cs (1)
78private static void ResolveMetadata(Type componentType, List<object> result)
Discovery\PageComponentBuilder.cs (1)
65EqualityComparer<Type>.Default.Equals(PageType, other.PageType);
Discovery\PageComponentInfo.cs (3)
20/// <param name="type">The page <see cref="System.Type"/>.</param> 25[DynamicallyAccessedMembers(Component)] Type type, 44public Type Type { get; }
FormMapping\Converters\CollectionConverter.cs (2)
27private static readonly Type _elementType = typeof(TElement); 55Type type,
FormMapping\Converters\CompiledComplexTypeConverter.cs (2)
10public delegate bool ConverterDelegate(ref FormDataReader reader, Type type, FormDataMapperOptions options, out T? result, out bool found); 14internal override bool TryRead(ref FormDataReader context, Type type, FormDataMapperOptions options, out T? result, out bool found)
FormMapping\Converters\DictionaryConverter.cs (2)
19private static readonly Type _elementType = typeof(TValue); 31Type type,
FormMapping\Converters\EnumConverter.cs (1)
30internal override bool TryRead(ref FormDataReader reader, Type type, FormDataMapperOptions options, out TEnum result, out bool found)
FormMapping\Converters\FileConverter.cs (1)
16internal override bool TryRead(ref FormDataReader reader, Type type, FormDataMapperOptions options, out T? result, out bool found)
FormMapping\Converters\NullableConverter.cs (1)
33internal override bool TryRead(ref FormDataReader context, Type type, FormDataMapperOptions options, out T? result, out bool found)
FormMapping\Converters\ParsableConverter.cs (1)
30internal override bool TryRead(ref FormDataReader reader, Type type, FormDataMapperOptions options, out T? result, out bool found)
FormMapping\Converters\UriFormDataConverter.cs (1)
32internal override bool TryRead(ref FormDataReader context, Type type, FormDataMapperOptions options, out Uri? result, out bool found)
FormMapping\Factories\CollectionConverterFactory.cs (8)
15public bool CanConvert(Type type, FormDataMapperOptions options) 17var element = ResolveElementType(type); 34public static Type? ResolveElementType(Type type) 36var enumerable = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IEnumerable<>)); 47public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options) 55var enumerableType = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IEnumerable<>)); 56var elementType = enumerableType?.GetGenericArguments()[0];
FormMapping\Factories\Collections\ConcreteTypeCollectionConverterFactory.cs (2)
16public bool CanConvert(Type _, FormDataMapperOptions options) => true; 20public FormDataConverter CreateConverter(Type _, FormDataMapperOptions options)
FormMapping\Factories\Collections\TypedCollectionConverterFactory.cs (7)
15public abstract bool CanConvert(Type type, FormDataMapperOptions options); 19public abstract FormDataConverter CreateConverter(Type type, FormDataMapperOptions options); 26public override bool CanConvert(Type _, FormDataMapperOptions options) 35var type = typeof(TCollection); 65var _ when type.IsAssignableTo(typeof(ICollection<TElement>)) && type.GetConstructor(Type.EmptyTypes) != null => true, 111public override FormDataConverter CreateConverter(Type _, FormDataMapperOptions options) 118var type = typeof(TCollection);
FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactory.cs (1)
12internal abstract FormDataConverter CreateConverter(Type type, FormDataMapperOptions options);
FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (20)
16internal override CompiledComplexTypeConverter<T> CreateConverter(Type type, FormDataMapperOptions options) 24private CompiledComplexTypeConverter<T>.ConverterDelegate CreateConverterBody(Type type, FormDataMapperOptions options) 159Array.Empty<Type>(), 185Array.Empty<Type>(), 287Array.Empty<Type>(), 297Array.Empty<Type>(), 304Array.Empty<Type>(), 314Array.Empty<Type>(), 343var propertyConverterType = typeof(FormDataConverter<>).MakeGenericType(property.Type); 379Array.Empty<Type>(), 388Type.EmptyTypes, 398Array.Empty<Type>(), 406Array.Empty<Type>(), 443var constructorParameterConverterType = typeof(FormDataConverter<>).MakeGenericType(constructorParameter.Type); 483Array.Empty<Type>(), 491Type.EmptyTypes, 501Array.Empty<Type>(), 509Array.Empty<Type>(), 552Expression.Not(Expression.Call(readerParam, nameof(FormDataReader.CurrentPrefixExists), Array.Empty<Type>())), 575Expression.Parameter(typeof(Type), "type"),
FormMapping\Factories\ComplexTypeConverterFactory.cs (2)
18public bool CanConvert(Type type, FormDataMapperOptions options) 99public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
FormMapping\Factories\Dictionary\ConcreteTypeDictionaryConverterFactory.cs (2)
15public bool CanConvert(Type type, FormDataMapperOptions options) => true; 19public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
FormMapping\Factories\Dictionary\TypedDictionaryConverterFactory.cs (4)
16public bool CanConvert(Type type, FormDataMapperOptions options) 61var _ when type.IsAssignableTo(typeof(IDictionary<TKey, TValue>)) && type.GetConstructor(Type.EmptyTypes) != null => true, 71public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options) 143var _ when type.IsAssignableTo(typeof(IDictionary<TKey, TValue>)) && type.GetConstructor(Type.EmptyTypes) != null =>
FormMapping\Factories\DictionaryConverterFactory.cs (13)
15public bool CanConvert(Type type, FormDataMapperOptions options) 42internal static (Type keyType, Type valueType) ResolveDictionaryTypes(Type type) 46var dictionaryType = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IDictionary<,>)) ?? 55var keyType = dictionaryType.GetGenericArguments()[0]; 61var parsableKeyType = ClosedGenericMatcher.ExtractGenericInterface(keyType, typeof(IParsable<>)); 67var valueType = dictionaryType.GetGenericArguments()[1]; 73public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options) 77var dictionaryType = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IDictionary<,>)) ?? 85var keyType = dictionaryType?.GetGenericArguments()[0]; 91var parsableKeyType = ClosedGenericMatcher.ExtractGenericInterface(keyType, typeof(IParsable<>)); 98var valueType = dictionaryType?.GetGenericArguments()[1];
FormMapping\Factories\EnumConverterFactory.cs (2)
12public bool CanConvert(Type type, FormDataMapperOptions options) => type.IsEnum; 16public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
FormMapping\Factories\FileConverterFactory.cs (3)
17public bool CanConvert(Type type, FormDataMapperOptions options) => CanConvertCommon(type) || type == typeof(IBrowserFile) || type == typeof(IReadOnlyList<IBrowserFile>); 22private static bool CanConvertCommon(Type type) => type == typeof(IFormFile) || type == typeof(IFormFileCollection) || type == typeof(IReadOnlyList<IFormFile>); 26public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
FormMapping\Factories\NullableConverterFactory.cs (5)
15public bool CanConvert(Type type, FormDataMapperOptions options) 17var underlyingType = Nullable.GetUnderlyingType(type); 23public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options) 25var underlyingType = Nullable.GetUnderlyingType(type); 31var expectedConverterType = typeof(NullableConverter<>).MakeGenericType(underlyingType);
FormMapping\Factories\ParsableConverterFactory.cs (2)
15public bool CanConvert(Type type, FormDataMapperOptions options) 22public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
FormMapping\FormDataConverterOfT.cs (1)
12internal abstract bool TryRead(ref FormDataReader context, Type type, FormDataMapperOptions options, out T? result, out bool found);
FormMapping\FormDataMapper.cs (1)
46public static partial void CannotResolveConverter(ILogger logger, Type type, Exception? ex);
FormMapping\FormDataMapperOptions.cs (4)
14private readonly ConcurrentDictionary<Type, FormDataConverter> _converters = new(); 60private static FormDataConverter CreateConverter(Type type, FormDataMapperOptions options) 75internal FormDataConverter ResolveConverter(Type type) 90internal bool CanConvert(Type type)
FormMapping\HttpContextFormValueMapper.cs (3)
21private static readonly ConcurrentDictionary<Type, FormValueSupplier> _cache = new(); 31public bool CanMap(Type valueType, string scopeName, string? formName) 92private FormValueSupplier CreateDeserializer(Type type) =>
FormMapping\IFormDataConverterFactory.cs (2)
12public bool CanConvert(Type type, FormDataMapperOptions options); 16public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options);
FormMapping\Metadata\FormDataMetadataFactory.cs (31)
26public FormDataTypeMetadata? GetOrCreateMetadataFor(Type type, FormDataMapperOptions options) 267internal bool HasMetadataFor(Type type) => _context.TypeMetadata.ContainsKey(type); 269private void DetectCyclesAndMarkMetadataTypesAsRecursive(Type type, FormDataTypeMetadata result) 303void ReportRecursiveChain(Type type) 315public Dictionary<Type, FormDataTypeMetadata> TypeMetadata { get; set; } = new(); 317public List<Type> CurrentTypes { get; set; } = new(); 340internal void Track(Type type) 345internal void Untrack(Type type) 354public static partial void StartResolveMetadataGraph(ILogger logger, Type type); 357public static partial void EndResolveMetadataGraph(ILogger logger, Type type); 360public static partial void MetadataFound(ILogger<FormDataMetadataFactory> logger, Type type); 363public static partial void NoMetadataFound(ILogger<FormDataMetadataFactory> logger, Type type); 366public static partial void RecursiveTypeFound(ILogger<FormDataMetadataFactory> logger, Type type, string chain); 369public static partial void PrimitiveType(ILogger<FormDataMetadataFactory> logger, Type type); 372public static partial void DictionaryType(ILogger<FormDataMetadataFactory> logger, Type type); 375public static partial void CollectionType(ILogger<FormDataMetadataFactory> logger, Type type); 378public static partial void ObjectType(ILogger<FormDataMetadataFactory> logger, Type type); 381public static partial void ConstructorFound(ILogger<FormDataMetadataFactory> logger, Type type, string parameters); 384public static partial void ConstructorParameter(ILogger<FormDataMetadataFactory> logger, Type type, string name, Type parameterType); 387public static partial void CandidateProperty(ILogger<FormDataMetadataFactory> logger, string name, Type propertyType); 405public static partial void MetadataComputed(ILogger<FormDataMetadataFactory> logger, Type type); 408public static partial void GenericTypeDefinitionNotSupported(ILogger<FormDataMetadataFactory> logger, Type type); 411public static partial void MultiplePublicConstructorsFound(ILogger<FormDataMetadataFactory> logger, Type type); 414public static partial void InterfacesNotSupported(ILogger<FormDataMetadataFactory> logger, Type type); 417public static partial void AbstractClassesNotSupported(ILogger<FormDataMetadataFactory> logger, Type type); 420public static partial void NoPublicConstructorFound(ILogger<FormDataMetadataFactory> logger, Type type); 423public static partial void ConstructorParameterTypeNotSupported(ILogger<FormDataMetadataFactory> logger, Type type, string name, Type parameterType); 426public static partial void PropertyTypeNotSupported(ILogger<FormDataMetadataFactory> logger, Type type, string name, Type propertyType);
FormMapping\Metadata\FormDataParameterMetadata.cs (2)
11public Type Type { get; set; } = parameter.ParameterType; 22public Type Type { get; }
FormMapping\Metadata\FormDataPropertyMetadata.cs (1)
15public Type Type => property.PropertyType;
FormMapping\Metadata\FormDataTypeMetadata.cs (2)
8internal class FormDataTypeMetadata(Type type) 12public Type Type { get; set; } = type;
FormMapping\WellKnownConverters.cs (2)
13public static readonly IReadOnlyDictionary<Type, FormDataConverter> Converters; 19var converters = new Dictionary<Type, FormDataConverter>
RazorComponentEndpointHost.cs (2)
26public Type ComponentType { get; set; } = default!; 43var pageLayoutType = ComponentType.GetCustomAttribute<LayoutAttribute>()?.LayoutType;
RazorComponentEndpointInvoker.cs (2)
51var rootComponent = endpoint.Metadata.GetRequiredMetadata<RootComponentMetadata>().Type; 52var pageComponent = endpoint.Metadata.GetRequiredMetadata<ComponentTypeMetadata>().Type;
Rendering\EndpointComponentState.cs (2)
17private static readonly ConcurrentDictionary<Type, StreamRenderingAttribute?> _streamRenderingAttributeByComponentType = new(); 41public static void UpdateApplication(Type[]? _) => _streamRenderingAttributeByComponentType.Clear();
Rendering\EndpointHtmlRenderer.cs (1)
75[DynamicallyAccessedMembers(Component)] Type? componentType = null,
Rendering\EndpointHtmlRenderer.Prerendering.cs (4)
19protected override IComponent ResolveComponentForRenderMode([DynamicallyAccessedMembers(Component)] Type componentType, int? parentComponentId, IComponentActivator componentActivator, IComponentRenderMode renderMode) 87[DynamicallyAccessedMembers(Component)] Type componentType, 96[DynamicallyAccessedMembers(Component)] Type componentType, 139[DynamicallyAccessedMembers(Component)] Type rootComponentType,
Rendering\SSRRenderModeBoundary.cs (6)
23private static readonly ConcurrentDictionary<Type, string> _componentTypeNameHashCache = new(); 26private readonly Type _componentType; 36[DynamicallyAccessedMembers(Component)] Type componentType, 52private static void AssertRenderModeIsConfigured(HttpContext httpContext, Type componentType, IComponentRenderMode renderMode) 78private static void AssertRenderModeIsConfigured<TRequiredMode>(Type componentType, IComponentRenderMode specifiedMode, IComponentRenderMode[] configuredModes, string expectedCall) where TRequiredMode : IComponentRenderMode 125var valueType = value.GetType();
Rendering\TypeNameHash.cs (2)
14public static string Compute(Type type) 18throw new InvalidOperationException($"Cannot compute a hash for a type without a {nameof(Type.FullName)}.");
Results\RazorComponentResult.cs (4)
25public RazorComponentResult([DynamicallyAccessedMembers(Component)] Type componentType) 36[DynamicallyAccessedMembers(Component)] Type componentType, 48[DynamicallyAccessedMembers(Component)] Type componentType, 68public Type ComponentType { get; }
Results\RazorComponentResultExecutor.cs (1)
43[DynamicallyAccessedMembers(Component)] Type componentType,
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (16)
19/// Determine whether <paramref name="queryType"/> is or implements a closed generic <see cref="Type"/> 22/// <param name="queryType">The <see cref="Type"/> of interest.</param> 23/// <param name="interfaceType">The open generic <see cref="Type"/> to match. Usually an interface.</param> 25/// The closed generic <see cref="Type"/> created from <paramref name="interfaceType"/> that 26/// <paramref name="queryType"/> is or implements. <c>null</c> if the two <see cref="Type"/>s have no such 34public static Type? ExtractGenericInterface([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 59private static bool IsGenericInstantiation(Type candidate, Type interfaceType) 66private static Type? GetGenericInstantiation([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 68Type? bestMatch = null; 70foreach (var @interface in interfaces) 96var baseType = queryType?.BaseType;
src\Shared\Components\ComponentParameter.cs (1)
20var valueType = kvp.Value?.GetType();
src\Shared\PropertyHelper\PropertyHelper.cs (21)
41private static readonly ConcurrentDictionary<Type, PropertyHelper[]> PropertiesCache = new(); 43private static readonly ConcurrentDictionary<Type, PropertyHelper[]> VisiblePropertiesCache = new(); 50/// This constructor does not cache the helper. For caching, use <see cref="GetProperties(Type)"/>. 123[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 144[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 244Type openGenericDelegateType, 248var typeInput = propertyGetMethod.DeclaringType!; 249var typeOutput = propertyGetMethod.ReturnType; 251var delegateType = openGenericDelegateType.MakeGenericType(typeInput, typeOutput); 290var typeInput = setMethod.DeclaringType!; 291var parameterType = parameters[0].ParameterType; 412Type type, 413ConcurrentDictionary<Type, PropertyHelper[]>? allPropertiesCache, 414ConcurrentDictionary<Type, PropertyHelper[]>? visiblePropertiesCache) 444var declaringType = propertyHelper.Property.DeclaringType; 457Type? currentType = type; 493Type type, 494ConcurrentDictionary<Type, PropertyHelper[]>? cache) 509foreach (var @interface in type.GetInterfaces()) 523[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 562public static void ClearCache(Type[]? _)
Microsoft.AspNetCore.Components.Endpoints.Tests (41)
Binding\FormDataMapperTests.cs (15)
23public void CanDeserialize_PrimitiveTypes(string value, Type type, object expected) 93public void PrimitiveTypes_MissingValues_DoNotAddErrors(string _, Type type, object __) 159public void CanDeserialize_NullablePrimitiveTypes(string value, Type type, object expected) 176public void CanDeserialize_NullValues(Type type) 520elementConverter.OnTryReadDelegate = (ref FormDataReader context, Type type, FormDataMapperOptions options, out int result, out bool found) => 2096public static TheoryData<string, Type, object> NullableBasicTypes 2100var result = new TheoryData<string, Type, object> 2138public static TheoryData<Type> NullNullableBasicTypes 2142var result = new TheoryData<Type> 2180public static TheoryData<string, Type, object> PrimitiveTypesData 2184var result = new TheoryData<string, Type, object> 2223private object CallDeserialize(FormDataReader reader, FormDataMapperOptions options, Type type) 2521internal delegate bool OnTryRead(ref FormDataReader context, Type type, FormDataMapperOptions options, out int result, out bool found); 2524(ref FormDataReader context, Type type, FormDataMapperOptions options, out int result, out bool found) => 2527internal override bool TryRead(ref FormDataReader context, Type type, FormDataMapperOptions options, out int result, out bool found) =>
HotReloadServiceTests.cs (3)
199private ComponentApplicationBuilder CreateBuilder(params Type[] types) 215private IServiceProvider CreateServices(params Type[] types) 218foreach (var type in types)
RazorComponentEndpointDataSourceTest.cs (12)
47public static TheoryData<IComponentRenderMode[], Type[], Type[], string[]> ConfiguredAndDiscoveredRenderModes => 139public static TheoryData<IComponentRenderMode[], Type[], Type[]> SetRenderModesFailures => 145Array.Empty<Type>(), 164Array.Empty<Type>(), 177Array.Empty<Type>() 183Array.Empty<Type>(), 198Array.Empty<Type>() 202private ComponentApplicationBuilder CreateBuilder(params Type[] types) 218private IServiceProvider CreateServices(params Type[] types) 221foreach (var type in types)
RazorComponentsServiceCollectionExtensionsTest.cs (7)
71private IEnumerable<Type> SingleRegistrationServiceTypes 85private Dictionary<Type, Type[]> MultiRegistrationServiceTypes 89return new Dictionary<Type, Type[]>() 102Type serviceType, 116Type serviceType)
TypeNameHashTest.cs (4)
42var type = new { Foo = "bar" }.GetType(); 58var type = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12).GetType(); 72var type = typeof(Nullable<>).GetGenericArguments()[0]; 76Assert.Equal($"Cannot compute a hash for a type without a {nameof(Type.FullName)}.", ex.Message);
Microsoft.AspNetCore.Components.Forms (9)
EditContextDataAnnotationsExtensions.cs (2)
55private static void ClearCache(Type[]? _) 62private static readonly ConcurrentDictionary<(Type ModelType, string FieldName), PropertyInfo?> _propertyInfoCache = new();
FieldIdentifier.cs (4)
19private static readonly ConcurrentDictionary<(Type ModelType, MemberInfo Member), Func<object, object>> _fieldAccessors = new(); 30/// <typeparam name="TField">The field <see cref="Type"/>.</typeparam> 155ConcurrentDictionary<(Type ModelType, MemberInfo Member), Func<object, object>>? cache = null) 187static Func<object, object> CreateAccessor((Type model, MemberInfo member) arg)
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (2)
167var declaringType = methodInfo.DeclaringType; 248var memberType = memberExpression.Type;
src\Components\Shared\src\HotReloadManager.cs (1)
27public static void UpdateApplication(Type[]? _) => Default.OnDeltaApplied?.Invoke();
Microsoft.AspNetCore.Components.Forms.Tests (8)
FieldIdentifierTest.cs (1)
146var cache = new ConcurrentDictionary<(Type ModelType, MemberInfo FieldName), Func<object, object>>();
src\Components\Shared\test\AssertFrame.cs (1)
67public static void Attribute(RenderTreeFrame frame, string attributeName, Type valueType, int? sequence = null)
src\Components\Shared\test\TestServiceProvider.cs (6)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 25public object? GetService(Type serviceType) 30public object? GetKeyedService(Type serviceType, object? serviceKey) 41public object GetRequiredKeyedService(Type serviceType, object? serviceKey)
Microsoft.AspNetCore.Components.Performance (10)
RenderTreeDiffBuilderBenchmark.cs (1)
106public object GetService(Type serviceType)
RouteTableFactoryBenchmarks.cs (2)
14private Dictionary<Type, string[]> _templatesByHandler; 22_templatesByHandler = new Dictionary<Type, string[]>
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.Components.QuickGrid (4)
Columns\PropertyColumn.cs (1)
55var nullableUnderlyingTypeOrNull = Nullable.GetUnderlyingType(typeof(TProp));
Infrastructure\AsyncQueryExecutorSupplier.cs (3)
24private static readonly ConcurrentDictionary<Type, bool> IsEntityFrameworkProviderTypeCache = new(); 38var providerType = queryable.Provider?.GetType(); 56private static bool IsEntityFrameworkProviderType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryableProviderType)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Verifiers\DiagnosticVerifier.cs (1)
244var analyzerType = analyzer.GetType();
Microsoft.AspNetCore.Components.Server (38)
BlazorPack\BlazorPackHubProtocolWorker.cs (2)
13protected override object? DeserializeObject(ref MessagePackReader reader, Type type, string field) 71protected override void Serialize(ref MessagePackWriter writer, Type type, object value)
Circuits\CircuitHost.cs (1)
904private static partial void CircuitHandlerFailed(ILogger logger, Type handlerType, string handlerMethod, string message, Exception exception);
Circuits\ComponentDescriptor.cs (2)
8public Type ComponentType { get; set; } 14public void Deconstruct(out Type componentType, out ParameterView parameters, out int sequence) =>
Circuits\ComponentParameterDeserializer.cs (1)
54var parameterType = _parametersCache.GetParameterType(definition.Assembly, definition.TypeName);
Circuits\RemoteRenderer.cs (3)
69public Task AddComponentAsync(Type componentType, ParameterView parameters, string domElementSelector) 83internal Type GetExistingComponentType(int componentId) => 309protected override IComponent ResolveComponentForRenderMode([DynamicallyAccessedMembers(Component)] Type componentType, int? parentComponentId, IComponentActivator componentActivator, IComponentRenderMode renderMode)
Circuits\ServerComponentDeserializer.cs (3)
190if (!TryDeserializeComponentTypeAndParameters(serverComponent, out var componentType, out var parameters)) 206private bool TryDeserializeComponentTypeAndParameters(ServerComponent serverComponent, [NotNullWhen(true)] out Type? componentType, out ParameterView parameters) 279if (!TryDeserializeComponentTypeAndParameters(serverComponent, out var componentType, out var parameters))
src\Components\Shared\src\ComponentParametersTypeCache.cs (4)
12private readonly ConcurrentDictionary<Key, Type?> _typeToKeyLookUp = new(); 14public Type? GetParameterType(string assembly, string type) 17if (_typeToKeyLookUp.TryGetValue(key, out var resolvedType)) 28private static Type? ResolveType(Key key, Assembly[] assemblies)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (1)
20public override ElementReference Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
src\Components\Shared\src\RootComponentOperation.cs (2)
26Type componentType, 29public Type ComponentType { get; } = componentType;
src\Components\Shared\src\RootComponentTypeCache.cs (4)
13private readonly ConcurrentDictionary<Key, Type?> _typeToKeyLookUp = new(); 15public Type? GetRootComponent(string assembly, string type) 18if (_typeToKeyLookUp.TryGetValue(key, out var resolvedType)) 29private static Type? ResolveType(Key key, Assembly[] assemblies)
src\Components\Shared\src\WebRootComponentManager.cs (6)
37[DynamicallyAccessedMembers(Component)] Type componentType, 61[DynamicallyAccessedMembers(Component)] Type newComponentType, 89private readonly Type _componentType; 98[DynamicallyAccessedMembers(Component)] Type componentType, 115[DynamicallyAccessedMembers(Component)] Type componentType, 130[DynamicallyAccessedMembers(Component)] Type newComponentType,
src\Shared\Components\ComponentParameter.cs (1)
20var valueType = kvp.Value?.GetType();
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (5)
148var itemType = binder.GetStreamItemType(invocationId); 178var itemType = ProtocolHelper.TryGetReturnType(binder, invocationId); 296private object?[] BindArguments(ref MessagePackReader reader, IReadOnlyList<Type> parameterTypes) 322protected abstract object? DeserializeObject(ref MessagePackReader reader, Type type, string field); 507protected abstract void Serialize(ref MessagePackWriter writer, Type type, object value);
src\SignalR\common\Shared\TryGetReturnType.cs (1)
10internal static Type? TryGetReturnType(IInvocationBinder binder, string invocationId)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\Utilities.cs (2)
20internal static readonly bool IsMono = Type.GetType("Mono.Runtime") is Type;
Microsoft.AspNetCore.Components.Server.Tests (16)
Circuits\CircuitHostTest.cs (1)
671private ComponentMarker CreateMarker(Type type, string locationHash, Dictionary<string, object> parameters = null, string componentKey = "")
Circuits\ServerComponentDeserializerTest.cs (4)
446private ComponentMarker CreateMarker(Type type, Dictionary<string, object> parameters = null) 459private ComponentMarker[] CreateMarkers(params Type[] types) 472private ComponentMarker[] CreateMarkers(params (Type, Dictionary<string, object>)[] types) 490private ComponentMarker[] CreateMarkers(ServerComponentInvocationSequence sequence, params Type[] types)
src\Components\Endpoints\src\DependencyInjection\ServerComponentSerializer.cs (2)
19public void SerializeInvocation(ref ComponentMarker marker, ServerComponentInvocationSequence invocationId, Type type, ParameterView parameters) 27Type rootComponent,
src\SignalR\common\SignalR.Common\test\Internal\Protocol\TestBinder.cs (9)
13private readonly Type[] _paramTypes; 14private readonly Type _returnType; 36public TestBinder(Type[] paramTypes) : this(paramTypes, null) { } 37public TestBinder(Type returnType) : this(null, returnType) { } 38public TestBinder(Type[] paramTypes, Type returnType) 44public IReadOnlyList<Type> GetParameterTypes(string methodName) 53public Type GetReturnType(string invocationId) 62public Type GetStreamItemType(string streamId)
Microsoft.AspNetCore.Components.Tests (47)
BindConverterTest.cs (3)
390public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 410public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 420public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
ComponentFactoryTest.cs (16)
17var componentType = typeof(EmptyComponent); 33var componentType = typeof(List<string>); 46var componentType = typeof(EmptyComponent); 67var componentType = typeof(EmptyComponent); 79var componentType = typeof(DerivedComponent); 103var componentType = typeof(ComponentWithNonInjectableProperties); 122var componentType = typeof(ComponentWithInjectProperties); 141var componentType = typeof(ComponentWithRenderMode); 173var componentType = typeof(DerivedComponentWithRenderMode); 191var componentType = typeof(ComponentWithNonInjectableProperties); 215var componentType = typeof(ComponentWithRenderMode); 236var componentType = typeof(ComponentWithConstructorInjection); 364public IComponent CreateInstance(Type componentType) 372public IComponent CreateInstance(Type componentType) 419public Type RequestedComponentType { get; private set; } 436protected internal override IComponent ResolveComponentForRenderMode(Type componentType, int? parentComponentId, IComponentActivator componentActivator, IComponentRenderMode renderMode)
EventCallbackFactoryBinderExtensionsTest.cs (1)
690public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
RendererTest.cs (6)
617var eventArgsType = renderer.GetEventArgsType(eventHandlerId); 640var eventArgsType = renderer.GetEventArgsType(eventHandlerId); 5142protected internal override IComponent ResolveComponentForRenderMode(Type componentType, int? parentComponentId, IComponentActivator componentActivator, IComponentRenderMode renderMode) 5156public List<Type> RequestedComponentTypes { get; } = new List<Type>(); 5158public IComponent CreateInstance(Type componentType)
Rendering\RenderTreeBuilderTest.cs (1)
633var componentType = typeof(TestComponent);
Routing\QueryParameterValueSupplierTest.cs (4)
171public void RejectsUnparseableValues(string key, string value, Type targetType) 196public void RejectsUnparseableArrayEntries(string key, string validValue, string invalidValue, Type targetType) 213public void RejectsBlankValuesWhenNotNullable(string key, Type targetType) 278public void RejectsBlankArrayEntriesWhenNotNullable(string key, Type targetType)
Routing\RouteTableFactoryTests.cs (9)
96var routeTable = RouteTableFactory.Create(new List<Type> { typeof(MyComponent), }, _serviceProvider); 113var routeTable = RouteTableFactory.Create(new List<Type> { typeof(MyComponent), typeof(MyInheritedComponent) }, _serviceProvider); 456public void CorrectlyMatchesVariableLengthSegments(string path, string expectedValue, string first, string second, Type handler) 929var handler = typeof(int); 981var handler = typeof(int); 1128readonly IList<(string Template, Type Handler)> _routeTemplates = new List<(string, Type)>(); 1129readonly Type _handler = typeof(object); 1131public TestRouteTableBuilder AddRoute(string template, Type handler = null)
src\Components\Shared\test\AssertFrame.cs (1)
67public static void Attribute(RenderTreeFrame frame, string attributeName, Type valueType, int? sequence = null)
src\Components\Shared\test\TestServiceProvider.cs (6)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 25public object? GetService(Type serviceType) 30public object? GetKeyedService(Type serviceType, object? serviceKey) 41public object GetRequiredKeyedService(Type serviceType, object? serviceKey)
Microsoft.AspNetCore.Components.Web (38)
Forms\InputBase.cs (1)
26private Type? _nullableUnderlyingType;
Forms\InputDate.cs (1)
55var type = Nullable.GetUnderlyingType(typeof(TValue)) ?? typeof(TValue);
Forms\InputNumber.cs (1)
22var targetType = Nullable.GetUnderlyingType(typeof(TValue)) ?? typeof(TValue);
Forms\Mapping\FormValueMappingContext.cs (3)
13internal FormValueMappingContext(string acceptMappingScopeName, string? acceptFormName, Type valueType, string parameterName) 41/// Gets the <see cref="Type"/> of the value to map. 43public Type ValueType { get; }
Forms\Mapping\IFormValueMapper.cs (2)
14/// <param name="valueType">The <see cref="Type"/> for the value to map.</param> 18bool CanMap(Type valueType, string scopeName, string? formName);
HtmlRendering\HtmlRenderer.cs (4)
76[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType) 89[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, 109[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType) 131[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType,
HtmlRendering\StaticHtmlRenderer.cs (1)
53[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType,
JSComponents\JSComponentConfigurationExtensions.cs (2)
45public static void RegisterForJavaScript(this IJSComponentConfiguration configuration, [DynamicallyAccessedMembers(Component)] Type componentType, string identifier) 56public static void RegisterForJavaScript(this IJSComponentConfiguration configuration, [DynamicallyAccessedMembers(Component)] Type componentType, string identifier, string javaScriptInitializer)
JSComponents\JSComponentConfigurationStore.cs (6)
24private readonly Dictionary<string, Type> _jsComponentTypesByIdentifier = new(StringComparer.Ordinal); 28internal void Add([DynamicallyAccessedMembers(LinkerFlags.Component)] Type componentType, string identifier) 46[NotNullWhen(true)][DynamicallyAccessedMembers(LinkerFlags.Component)] out Type? componentType) 55internal void Add([DynamicallyAccessedMembers(LinkerFlags.Component)] Type componentType, string identifier, string javaScriptInitializer) 76public JSComponentParameter(string name, Type dotNetType) 82private static string GetJSType(Type dotNetType) => dotNetType switch
JSComponents\JSComponentInterop.cs (11)
26private static readonly ConcurrentDictionary<Type, ParameterTypeCache> ParameterTypeCaches = new(); 68if (!Configuration.TryGetComponentType(identifier, out var componentType)) 90var componentType = Renderer.GetRootComponentType(componentId); 158internal static ParameterTypeCache GetComponentParameters(Type componentType) 161internal static bool IsEventCallbackType(Type type) 166private static ParameterKind GetParameterKind(Type type) 182private static object CreateEventCallbackWithSingleParameter(Type eventCallbackType, IJSObjectReference? jsObjectReference) 189private static bool TryGetComponentParameterInfo(Type componentType, string parameterName, out ParameterInfo parameterInfo) 200public ParameterTypeCache(Type componentType) 223public readonly Type Type { get; } 226public ParameterInfo(Type parameterType)
Routing\FocusOnNavigate.cs (1)
18private Type? _lastNavigatedPageType = typeof(NonMatchingType);
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (2)
167var declaringType = methodInfo.DeclaringType; 248var memberType = memberExpression.Type;
src\Components\Shared\src\JsonSerialization\JsonConverterFactoryTypeInfoResolver.cs (1)
21public JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options)
WebEventData\WebEventData.cs (1)
78var eventArgsType = renderer.GetEventArgsType(eventHandlerId);
WebRenderer.cs (1)
77protected internal int AddRootComponent([DynamicallyAccessedMembers(Component)] Type componentType, string domElementSelector)
Microsoft.AspNetCore.Components.Web.Tests (11)
Forms\EditFormTest.cs (1)
276public bool CanMap(Type valueType, string mappingScopeName, string formName) => false;
Forms\Mapping\FormMappingScopeTest.cs (1)
149public bool CanMap(Type valueType, string mappingScopeName, string formName) => false;
Forms\Mapping\SupplyParameterFromFormTest.cs (1)
85public bool CanMap(Type valueType, string mappingScopeName, string formName)
HtmlRendering\HtmlRendererTest.cs (1)
1387public bool CanMap(Type valueType, string mappingScopeName, string formName)
src\Components\Shared\test\AssertFrame.cs (1)
67public static void Attribute(RenderTreeFrame frame, string attributeName, Type valueType, int? sequence = null)
src\Components\Shared\test\TestServiceProvider.cs (6)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 25public object? GetService(Type serviceType) 30public object? GetKeyedService(Type serviceType, object? serviceKey) 41public object GetRequiredKeyedService(Type serviceType, object? serviceKey)
Microsoft.AspNetCore.Components.WebAssembly (42)
Hosting\RootComponentMapping.cs (3)
20public RootComponentMapping([DynamicallyAccessedMembers(Component)] Type componentType, string selector) 45public RootComponentMapping([DynamicallyAccessedMembers(Component)] Type componentType, string selector, ParameterView parameters) : this(componentType, selector) 54public Type ComponentType { get; }
Hosting\RootComponentMappingCollection.cs (2)
36public void Add([DynamicallyAccessedMembers(Component)] Type componentType, string selector) 47public void Add([DynamicallyAccessedMembers(Component)] Type componentType, string selector, ParameterView parameters)
Hosting\WebAssemblyHostBuilder.cs (1)
143var componentType = _rootComponentCache.GetRootComponent(registeredComponent.Assembly!, registeredComponent.TypeName!);
HotReload\HotReloadAgent.cs (14)
51public List<Action<Type[]?>> ClearCache { get; } = new(); 52public List<Action<Type[]?>> UpdateApplication { get; } = new(); 79ctorArgs[0].Value is not Type handlerType) 94[DynamicallyAccessedMembers(HotReloadHandlerLinkerFlags)] Type handlerType) 116Action<Type[]?> CreateAction(MethodInfo update) 118Action<Type[]?> action = update.CreateDelegate<Action<Type[]?>>(); 132MethodInfo? GetUpdateMethod([DynamicallyAccessedMembers(HotReloadHandlerLinkerFlags)] Type handlerType, string name) 134if (handlerType.GetMethod(name, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static, new[] { typeof(Type[]) }) is MethodInfo updateMethod && 213Type[]? updatedTypes = GetMetadataUpdateTypes(deltas); 227private static Type[] GetMetadataUpdateTypes(IReadOnlyList<UpdateDelta> deltas) 229List<Type>? types = null; 243var type = assemblyTypes.FirstOrDefault(t => t.MetadataToken == updatedType); 252return types?.ToArray() ?? Type.EmptyTypes;
HotReload\WebAssemblyHotReload.cs (1)
70var method = typeof(System.Reflection.Metadata.MetadataUpdater).GetMethod("GetCapabilities", BindingFlags.NonPublic | BindingFlags.Static, Type.EmptyTypes);
Prerendering\WebAssemblyComponentParameterDeserializer.cs (1)
52var parameterType = _parametersCache.GetParameterType(definition.Assembly, definition.TypeName);
Rendering\WebAssemblyRenderer.cs (2)
92public Task AddComponentAsync([DynamicallyAccessedMembers(Component)] Type componentType, ParameterView parameters, string domElementSelector) 187protected override IComponent ResolveComponentForRenderMode([DynamicallyAccessedMembers(Component)] Type componentType, int? parentComponentId, IComponentActivator componentActivator, IComponentRenderMode renderMode)
src\Components\Shared\src\ComponentParametersTypeCache.cs (4)
12private readonly ConcurrentDictionary<Key, Type?> _typeToKeyLookUp = new(); 14public Type? GetParameterType(string assembly, string type) 17if (_typeToKeyLookUp.TryGetValue(key, out var resolvedType)) 28private static Type? ResolveType(Key key, Assembly[] assemblies)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (1)
20public override ElementReference Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
src\Components\Shared\src\RootComponentOperation.cs (2)
26Type componentType, 29public Type ComponentType { get; } = componentType;
src\Components\Shared\src\RootComponentTypeCache.cs (4)
13private readonly ConcurrentDictionary<Key, Type?> _typeToKeyLookUp = new(); 15public Type? GetRootComponent(string assembly, string type) 18if (_typeToKeyLookUp.TryGetValue(key, out var resolvedType)) 29private static Type? ResolveType(Key key, Assembly[] assemblies)
src\Components\Shared\src\WebRootComponentManager.cs (6)
37[DynamicallyAccessedMembers(Component)] Type componentType, 61[DynamicallyAccessedMembers(Component)] Type newComponentType, 89private readonly Type _componentType; 98[DynamicallyAccessedMembers(Component)] Type componentType, 115[DynamicallyAccessedMembers(Component)] Type componentType, 130[DynamicallyAccessedMembers(Component)] Type newComponentType,
src\Shared\Components\ComponentParameter.cs (1)
20var valueType = kvp.Value?.GetType();
Microsoft.AspNetCore.Components.WebAssembly.Tests (4)
Hosting\WebAssemblyHostBuilderTest.cs (3)
206private static IReadOnlyList<Type> DefaultServiceTypes 210return new Type[] 228foreach (var type in DefaultServiceTypes)
WebAssemblyHotReloadTest.cs (1)
15var hotReloadManager = typeof(Renderer).Assembly.GetType("Microsoft.AspNetCore.Components.HotReload.HotReloadManager");
Microsoft.AspNetCore.Components.WebView (6)
Services\WebViewRenderer.cs (1)
64public new int AddRootComponent(Type componentType, string domElementSelector)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (1)
20public override ElementReference Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
374public override Dictionary<string, StaticWebAssetNode> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
WebViewManager.cs (3)
89public Task AddRootComponentAsync(Type componentType, string selector, ParameterView parameters) 118/// <param name="selector">The CSS selector describing where in the page the component was placed. This must exactly match the selector provided on an earlier call to <see cref="AddRootComponentAsync(Type, string, ParameterView)"/>.</param> 248public Type ComponentType { get; init; }
Microsoft.AspNetCore.Components.WebView.Maui (1)
RootComponent.cs (1)
26 public Type? ComponentType { get; set; }
Microsoft.AspNetCore.Components.WebView.WindowsForms (2)
RootComponent.cs (2)
22 public RootComponent(string selector, Type componentType, IDictionary<string, object?>? parameters) 43 public Type ComponentType { get; }
Microsoft.AspNetCore.Components.WebView.Wpf (1)
RootComponent.cs (1)
25 public Type ComponentType { get; set; } = default!;
Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.Connections.Abstractions (6)
ConnectionBuilderExtensions.cs (1)
19/// <typeparam name="TConnectionHandler">The <see cref="Type"/> of the <see cref="ConnectionHandler"/>.</typeparam>
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (3)
26[DynamicallyAccessedMembers(ActivatorAccessibility)] Type instanceType, 92[DynamicallyAccessedMembers(ActivatorAccessibility)] Type type) 116var givenType = givenParameters[givenIndex]?.GetType();
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (2)
47Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType); 87private static object? CreateValueType(Type t) => RuntimeHelpers.GetUninitializedObject(t);
Microsoft.AspNetCore.DataProtection (37)
AuthenticatedEncryption\AuthenticatedEncryptorFactory.cs (2)
167private static Type GetManagedTypeFromEncryptionAlgorithm(EncryptionAlgorithm algorithm) 185private static Type GetManagedTypeFromValidationAlgorithm(ValidationAlgorithm algorithm)
AuthenticatedEncryption\ConfigurationModel\ManagedAlgorithmHelpers.cs (7)
14private static readonly List<Type> KnownAlgorithmTypes = new List<Type> 24public static string TypeToFriendlyName(Type type) 40public static Type FriendlyNameToType(string typeName) 42foreach (var knownType in KnownAlgorithmTypes) 50var type = TypeExtensions.GetTypeWithTrimFriendlyErrorMessage(typeName); 59if (type.GetConstructor(Type.EmptyTypes) == null)
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorConfiguration.cs (3)
29public Type EncryptionAlgorithmType { get; set; } = typeof(Aes); 53public Type ValidationAlgorithmType { get; set; } = typeof(HMACSHA256); 83private static string TypeToFriendlyName(Type type)
AuthenticatedEncryption\ConfigurationModel\XmlSerializedDescriptorInfo.cs (2)
23public XmlSerializedDescriptorInfo(XElement serializedDescriptorElement, Type deserializerType) 43public Type DeserializerType { get; }
AuthenticatedEncryption\ManagedAuthenticatedEncryptorFactory.cs (1)
116public static Func<T> CreateFactory<T>([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type implementation) where T : class
Internal\DefaultTypeNameResolver.cs (2)
18public bool TryResolveType(string typeName, [NotNullWhen(true)] out Type? type) 25type = Type.GetType(typeName, throwOnError: false);
Internal\IActivator.cs (1)
19object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type expectedBaseType, string implementationTypeName);
Internal\ITypeNameResolver.cs (1)
11bool TryResolveType(string typeName, [NotNullWhen(true)] out Type? type);
LoggingServiceProviderExtensions.cs (1)
36public static ILogger GetLogger(this IServiceProvider? services, Type type)
SimpleActivator.cs (4)
16private static readonly Type[] _serviceProviderTypeArray = { typeof(IServiceProvider) }; 32public virtual object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type expectedBaseType, string implementationTypeName) 35var implementationType = TypeExtensions.GetTypeWithTrimFriendlyErrorMessage(implementationTypeName); 41var ctorParameterless = implementationType.GetConstructor(Type.EmptyTypes);
TypeExtensions.cs (7)
11/// Helpful extension methods on <see cref="Type"/>. 19public static void AssertIsAssignableFrom(this Type expectedBaseType, Type implementationType) 32public static Type GetTypeWithTrimFriendlyErrorMessage(string typeName) 36return Type.GetType(typeName, throwOnError: true)!; 44public static bool MatchName(this Type matchType, string resolvedTypeName, ITypeNameResolver typeNameResolver) 50return typeNameResolver.TryResolveType(resolvedTypeName, out var resolvedType) && resolvedType == matchType;
TypeForwardingActivator.cs (4)
30public override object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type expectedBaseType, string originalTypeName) 35internal object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type expectedBaseType, string originalTypeName, out bool forwarded) 39var type = Type.GetType(forwardedTypeName, false);
XmlEncryption\EncryptedXmlInfo.cs (2)
22public EncryptedXmlInfo(XElement encryptedElement, Type decryptorType) 42public Type DecryptorType { get; }
Microsoft.AspNetCore.DataProtection.Extensions (11)
src\Shared\TrimmingAttributes.cs (11)
184/// with the specified signature of a member on a <see cref="System.Type"/>. 187/// <param name="type">The <see cref="System.Type"/> containing <paramref name="memberSignature"/>.</param> 188public DynamicDependencyAttribute(string memberSignature, Type type) 210/// with the specified types of members on a <see cref="System.Type"/>. 213/// <param name="type">The <see cref="System.Type"/> containing the specified members.</param> 214public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type) 254/// Gets the <see cref="System.Type"/> containing the specified member. 260public Type? Type { get; } 286/// Indicates that certain members on a specified <see cref="Type"/> are accessed dynamically, 293/// This attribute is valid on members whose type is <see cref="Type"/> or <see cref="string"/>. 299/// can be accessed dynamically on <see cref="Type"/> instances returned from calling
Microsoft.AspNetCore.DataProtection.Tests (13)
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorDescriptorDeserializerTests.cs (2)
19public void ImportFromXml_BuiltInTypes_CreatesAppropriateDescriptor(Type encryptionAlgorithmType, Type validationAlgorithmType)
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorDescriptorTests.cs (2)
44public void ExportToXml_BuiltInTypes_ProducesCorrectPayload(Type encryptionAlgorithmType, Type validationAlgorithmType)
Internal\KeyManagementOptionsSetupTest.cs (1)
49["KeyEscrowSinks"] = String.Join(" ;; ; ", new Type[] { typeof(MyKeyEscrowSink1), typeof(MyKeyEscrowSink2) }.Select(t => t.AssemblyQualifiedName)),
RegistryPolicyResolverTests.cs (1)
39["KeyEscrowSinks"] = String.Join(" ;; ; ", new Type[] { typeof(MyKeyEscrowSink1), typeof(MyKeyEscrowSink2) }.Select(t => t.AssemblyQualifiedName))
TypeForwardingActivatorTests.cs (4)
51public void CreateInstance_Generics(Type type) 64public void CreateInstance_ThrowsForOpenGenerics(Type type) 92public void CreateInstance_DoesNotForwardingTypesExternalTypes(Type type) 109var type = typeof(ClassWithParameterlessCtor);
XmlEncryption\XmlEncryptionExtensionsTests.cs (3)
77Type resolvedType; 98var resolvedType = typeof(NullXmlDecryptor); 130Type resolvedType = null;
Microsoft.AspNetCore.Diagnostics (14)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (5)
84var type = method.DeclaringType; 116var parameterType = parameter.ParameterType; 161var type = method.DeclaringType; 196private static bool TryResolveStateMachineMethod(ref MethodBase method, out Type? declaringType) 203var parentType = declaringType.DeclaringType;
src\Shared\TypeNameHelper\TypeNameHelper.cs (9)
17private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 46/// <param name="type">The <see cref="Type"/>.</param> 52public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 59private static void ProcessType(StringBuilder builder, Type type, in DisplayNameOptions options) 93private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 95var innerType = type; 112private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (9)
DatabaseContextDetails.cs (2)
8public Type Type { get; } 13public DatabaseContextDetails(Type type, bool databaseExists, bool pendingModelChanges, IEnumerable<string> pendingMigrations)
DatabaseDeveloperPageExceptionFilter.cs (1)
67foreach (var registeredContext in registeredContexts)
DatabaseErrorPageMiddleware.cs (3)
28public void Hold(Exception exception, Type contextType) 35public Type? ContextType { get; private set; } 97var contextType = _localDiagnostic.Value!.ContextType;
DiagnosticsEntityFrameworkCoreLoggerExtensions.cs (1)
32public static partial void AttemptingToMatchException(this ILogger logger, Type exceptionType);
HttpContextDatabaseContextDetailsExtensions.cs (1)
19public static async ValueTask<DatabaseContextDetails?> GetContextDetailsAsync(this HttpContext httpContext, Type dbcontextType, ILogger logger)
MigrationsEndPointMiddleware.cs (1)
113var contextType = registeredContexts.FirstOrDefault(c => string.Equals(contextTypeName, c.AssemblyQualifiedName, StringComparison.Ordinal));
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Logging\IncomingHttpRouteUtility.cs (1)
21private static readonly Type _dataClassificationAttributeType = typeof(DataClassificationAttribute);
Microsoft.AspNetCore.Diagnostics.Tests (1)
ExceptionHandlerMiddlewareTest.cs (1)
527public object GetService(Type serviceType)
Microsoft.AspNetCore.Grpc.JsonTranscoding (91)
Internal\Binding\IServiceInvokerResolver.cs (1)
16Type[] methodParameters,
Internal\Binding\JsonTranscodingProviderServiceBinder.cs (1)
273public static partial void MethodDescriptorNotFound(ILogger logger, string methodName, Type serviceType);
Internal\Binding\JsonTranscodingServiceMethodProvider.cs (2)
94public static partial void BindMethodNotFound(ILogger logger, Type serviceType); 97public static partial void ServiceDescriptorError(ILogger logger, Type serviceType, Exception ex);
Internal\Binding\ReflectionServiceInvokerResolver.cs (5)
14private readonly Type _declaringType; 16public ReflectionServiceInvokerResolver(Type declaringType) 23Type[] methodParameters, 51private MethodInfo? GetMethod(string methodName, Type[] methodParameters) 53Type? currentType = typeof(TService);
Internal\GrpcServerLog.cs (2)
24public static partial void DeserializingMessage(ILogger logger, Type messageType); 42public static partial void SerializedMessage(ILogger logger, Type messageType);
Internal\Json\AnyConverter.cs (2)
8using Type = System.Type; 21public override TMessage? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\BoolConverter.cs (2)
6using Type = System.Type; 12public override bool Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\ByteStringConverter.cs (2)
7using Type = System.Type; 13public override ByteString? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\DurationConverter.cs (2)
8using Type = System.Type; 18public override TMessage? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\EnumConverter.cs (2)
9using Type = System.Type; 19public override TEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\FieldMaskConverter.cs (2)
10using Type = System.Type; 20public override TMessage? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\Int64Converter.cs (2)
6using Type = System.Type; 16public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\JsonConverterFactoryForEnum.cs (4)
7using Type = System.Type; 20public override bool CanConvert(Type typeToConvert) 26Type typeToConvert, JsonSerializerOptions options) 29typeof(EnumConverter<>).MakeGenericType(new Type[] { typeToConvert }),
Internal\Json\JsonConverterFactoryForWellKnownTypes.cs (5)
8using Type = System.Type; 21public override bool CanConvert(Type typeToConvert) 38Type typeToConvert, JsonSerializerOptions options) 41var converterType = JsonConverterHelper.WellKnownTypeNames[descriptor.FullName]; 44converterType.MakeGenericType(new Type[] { typeToConvert }),
Internal\Json\JsonConverterFactoryForWrappers.cs (4)
9using Type = System.Type; 22public override bool CanConvert(Type typeToConvert) 39Type typeToConvert, JsonSerializerOptions options) 42typeof(WrapperConverter<>).MakeGenericType(new Type[] { typeToConvert }),
Internal\Json\JsonConverterHelper.cs (12)
15using Type = System.Type; 23internal static readonly Dictionary<string, Type> WellKnownTypeNames = new Dictionary<string, Type> 63internal static Type GetFieldType(FieldDescriptor descriptor) 75var itemType = GetFieldTypeCore(descriptor); 86private static Type GetFieldTypeCore(FieldDescriptor descriptor, bool nullableType = false) 135var keyType = GetFieldType(mapKey); 136var valueType = GetFieldType(mapValue); 138var repeatedFieldType = typeof(Dictionary<,>).MakeGenericType(keyType, valueType); 150var fieldType = GetFieldType(fieldDescriptor); 151var itemType = fieldType.GetGenericArguments()[0]; 152var repeatedFieldType = typeof(List<>).MakeGenericType(itemType);
Internal\Json\ListValueConverter.cs (2)
8using Type = System.Type; 18public override TMessage? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\MessageTypeInfoResolver.cs (3)
13using Type = System.Type; 26public JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options) 64private bool IsStandardMessage(Type type, [NotNullWhen(true)] out MessageDescriptor? messageDescriptor)
Internal\Json\NullValueConverter.cs (2)
7using Type = System.Type; 15public override NullValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\StructConverter.cs (2)
8using Type = System.Type; 18public override TMessage? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\TimestampConverter.cs (2)
8using Type = System.Type; 18public override TMessage? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\UInt64Converter.cs (2)
7using Type = System.Type; 17public override ulong Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\ValueConverter.cs (2)
7using Type = System.Type; 19public override TMessage? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Internal\Json\WrapperConverter.cs (3)
6using Type = System.Type; 16public override TMessage? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 20var t = JsonConverterHelper.GetFieldType(valueDescriptor);
Internal\JsonRequestHelpers.cs (2)
192Type type; 380Type responseType;
src\Grpc\JsonTranscoding\src\Shared\DescriptorRegistry.cs (3)
14private readonly ConcurrentDictionary<Type, DescriptorBase> _typeDescriptorMap = new ConcurrentDictionary<Type, DescriptorBase>(); 79public DescriptorBase? FindDescriptorByType(Type type)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (5)
43using Type = System.Type; 374private static readonly ConcurrentDictionary<Type, Dictionary<object, string>> _dictionaries 375= new ConcurrentDictionary<Type, Dictionary<object, string>>(); 379var enumType = value.GetType(); 395private static Dictionary<object, string> GetNameMapping(Type enumType)
src\Grpc\JsonTranscoding\src\Shared\Server\BindMethodFinder.cs (9)
28internal static MethodInfo? GetBindMethod(Type serviceType) 42internal static MethodInfo? GetBindMethodUsingAttribute(Type serviceType) 44Type? currentServiceType = serviceType; 67internal static MethodInfo? GetBindMethodFallback(Type serviceType) 70var baseType = GetServiceBaseType(serviceType); 77var declaringType = baseType.DeclaringType; 88private static Type? GetServiceBaseType(Type serviceImplementation) 92var baseType = serviceImplementation.BaseType;
src\Grpc\JsonTranscoding\src\Shared\Server\InterceptorPipelineBuilder.cs (1)
179var activatorType = typeof(IGrpcInterceptorActivator<>).MakeGenericType(Registration.Type);
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (3)
29using Type = System.Type; 55public static ServiceDescriptor? GetServiceDescriptor(Type serviceReflectionType) 408public static BodyDescriptorInfo? ResolveBodyDescriptor(string body, Type serviceType, MethodDescriptor methodDescriptor)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (11)
ConverterTests\JsonConverterWriteTests.cs (2)
16using Type = System.Type; 555private static DescriptorRegistry CreateDescriptorRegistry(Type type)
Infrastructure\TestHelpers.cs (2)
35internal static MessageDescriptor GetMessageDescriptor(Type typeToConvert) 37var property = typeToConvert.GetProperty("Descriptor", BindingFlags.Static | BindingFlags.Public, binder: null, typeof(MessageDescriptor), Type.EmptyTypes, modifiers: null);
ServerStreamingServerCallHandlerTests.cs (3)
26using Type = System.Type; 306List<(Type Type, object[] Args)>? interceptors = null, 323List<(Type Type, object[] Args)>? interceptors = null,
UnaryServerCallHandlerTests.cs (4)
30using Type = System.Type; 1405var interceptors = new List<(Type Type, object[] Args)>(); 1809List<(Type Type, object[] Args)>? interceptors = null, 1826List<(Type Type, object[] Args)>? interceptors = null,
Microsoft.AspNetCore.Grpc.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.Grpc.Swagger (21)
Internal\GrpcDataContractResolver.cs (3)
10using Type = System.Type; 25public DataContract GetDataContractForType(Type type) 108var fieldType = MessageDescriptorHelpers.ResolveFieldType(field);
Internal\GrpcJsonTranscodingDescriptionProvider.cs (1)
79var responseType = responseBodyDescriptor != null ? MessageDescriptorHelpers.ResolveFieldType(responseBodyDescriptor) : methodDescriptor.OutputType.ClrType;
Internal\GrpcModelMetadata.cs (1)
20public override Type BinderType { get; }
Internal\MessageDescriptorHelpers.cs (3)
10public static Type ResolveFieldType(FieldDescriptor field) 15var valueType = GetTypeFromFieldType(mapFields[1]); 28private static Type GetTypeFromFieldType(FieldDescriptor field)
Internal\XmlComments\GrpcXmlCommentsDocumentFilter.cs (1)
53private bool TryAdd(OpenApiDocument swaggerDoc, KeyValuePair<string, ActionDescriptor> nameAndType, Type type)
Internal\XmlComments\GrpcXmlCommentsOperationFilter.cs (1)
63private void ApplyServiceTags(OpenApiOperation operation, Type controllerType)
src\Grpc\JsonTranscoding\src\Shared\DescriptorRegistry.cs (3)
14private readonly ConcurrentDictionary<Type, DescriptorBase> _typeDescriptorMap = new ConcurrentDictionary<Type, DescriptorBase>(); 79public DescriptorBase? FindDescriptorByType(Type type)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (5)
43using Type = System.Type; 374private static readonly ConcurrentDictionary<Type, Dictionary<object, string>> _dictionaries 375= new ConcurrentDictionary<Type, Dictionary<object, string>>(); 379var enumType = value.GetType(); 395private static Dictionary<object, string> GetNameMapping(Type enumType)
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (3)
29using Type = System.Type; 55public static ServiceDescriptor? GetServiceDescriptor(Type serviceReflectionType) 408public static BodyDescriptorInfo? ResolveBodyDescriptor(string body, Type serviceType, MethodDescriptor methodDescriptor)
Microsoft.AspNetCore.Grpc.Swagger.Tests (3)
SchemaGeneratorIntegrationTests.cs (1)
18private (OpenApiSchema Schema, SchemaRepository SchemaRepository) GenerateSchema(System.Type type, IDescriptor descriptor)
XmlComments\XmlCommentsDocumentFilterTests.cs (2)
29public void Apply_SetsTagDescription_FromControllerSummaryTags(Type serviceType, string expectedDescription) 46static ApiDescription CreateApiDescription(Type serviceType)
Microsoft.AspNetCore.HeaderParsing (2)
HeaderSetup.cs (2)
25public Type? ParserType { get; } 44public HeaderSetup(string headerName, Type parserType, bool cacheable = false)
Microsoft.AspNetCore.Hosting (42)
GenericHost\GenericWebHostBuilder.cs (6)
102var startupType = StartupLoader.FindStartupType(webHostOptions.StartupAssembly!, webhostContext.HostingEnvironment.EnvironmentName); 166public IWebHostBuilder UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType) 215private void UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType, HostBuilderContext context, IServiceCollection services, object? instance = null) 283var containerType = configureContainerBuilder.GetContainerType(); 291var actionType = typeof(Action<,>).MakeGenericType(typeof(HostBuilderContext), containerType); 369public object? GetService(Type serviceType)
GenericHost\HostingStartupWebHostBuilder.cs (1)
81public IWebHostBuilder UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType)
GenericHost\SlimWebHostBuilder.cs (1)
67public IWebHostBuilder UseStartup([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicMethods)] Type startupType)
Infrastructure\ISupportsStartup.cs (3)
12/// <see cref="WebHostBuilderExtensions.UseStartup(IWebHostBuilder, Type)"/> and <see cref="WebHostBuilderExtensions.UseStartup{TStartup}(IWebHostBuilder, Func{WebHostBuilderContext, TStartup})"/> 34/// <param name="startupType">The <see cref="Type"/> to be used.</param> 36IWebHostBuilder UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType);
Internal\ConfigureContainerBuilder.cs (1)
22public Type GetContainerType()
Internal\StartupLoader.cs (12)
41public static StartupMethods LoadMethods(IServiceProvider hostingServiceProvider, [DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType, string environmentName, object? instance = null) 55var type = configureContainerMethod.MethodInfo != null ? configureContainerMethod.GetContainerType() : typeof(object); 69static Type CreateConfigureServicesDelegateBuilder(Type type) 238public static Type FindStartupType(string startupAssemblyName, string environmentName) 260var type = 294internal static ConfigureBuilder FindConfigureDelegate([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType, string environmentName) 300internal static ConfigureContainerBuilder FindConfigureContainerDelegate([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType, string environmentName) 306internal static bool HasConfigureServicesIServiceProviderDelegate([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType, string environmentName) 311internal static ConfigureServicesBuilder FindConfigureServicesDelegate([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType, string environmentName) 318private static MethodInfo? FindMethod([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType, string methodName, string environmentName, Type? returnType = null, bool required = true)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (5)
84var type = method.DeclaringType; 116var parameterType = parameter.ParameterType; 161var type = method.DeclaringType; 196private static bool TryResolveStateMachineMethod(ref MethodBase method, out Type? declaringType) 203var parentType = declaringType.DeclaringType;
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
374public override Dictionary<string, StaticWebAssetNode> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
src\Shared\TypeNameHelper\TypeNameHelper.cs (9)
17private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 46/// <param name="type">The <see cref="Type"/>.</param> 52public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 59private static void ProcessType(StringBuilder builder, Type type, in DisplayNameOptions options) 93private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 95var innerType = type; 112private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
WebHostBuilder.cs (1)
318var startupType = StartupLoader.FindStartupType(startupAssemblyName, _hostingEnvironment.EnvironmentName);
WebHostBuilderExtensions.cs (2)
131/// <param name="startupType">The <see cref="Type"/> to be used.</param> 133public static IWebHostBuilder UseStartup(this IWebHostBuilder hostBuilder, [DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType)
Microsoft.AspNetCore.Hosting.Abstractions (2)
HostingStartupAttribute.cs (2)
18public HostingStartupAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type hostingStartupType) 35public Type HostingStartupType { get; }
Microsoft.AspNetCore.Hosting.Tests (25)
Fakes\GenericWebHostBuilderWrapper.cs (1)
77public IWebHostBuilder UseStartup(Type startupType)
Fakes\StartupThrowTypeLoadException.cs (1)
14classes: new Type[] { GetType() },
HostingApplicationTests.cs (2)
214public object this[Type key] { get => Features[key]; set => Features[key] = value; } 224public IEnumerator<KeyValuePair<Type, object>> GetEnumerator() => Features.GetEnumerator();
Internal\MyContainer.cs (1)
19public object GetService(Type serviceType)
StartupManagerTests.cs (17)
27var type = typeof(VoidReturningStartupServicesFiltersStartup); 49var type = typeof(VoidReturningStartupServicesFiltersStartup); 70var type = typeof(IServiceProviderReturningStartupServicesFiltersStartup); 95var type = typeof(ConfigureContainerStartupServicesFiltersStartup); 117var type = typeof(ConfigureContainerStartupServicesFiltersStartup); 139var type = typeof(ConfigureServicesAndConfigureContainerStartup); 297var type = StartupLoader.FindStartupType("Microsoft.AspNetCore.Hosting.Tests", "WithServices"); 319var type = StartupLoader.FindStartupType("Microsoft.AspNetCore.Hosting.Tests", "WithScopedServices"); 346var type = StartupLoader.FindStartupType("Microsoft.AspNetCore.Hosting.Tests", environment); 366var type = StartupLoader.FindStartupType("Microsoft.AspNetCore.Hosting.Tests", "Boom"); 378var type = StartupLoader.FindStartupType("Microsoft.AspNetCore.Hosting.Tests", environment); 393var type = StartupLoader.FindStartupType("Microsoft.AspNetCore.Hosting.Tests", environment); 414var type = StartupLoader.FindStartupType("Microsoft.AspNetCore.Hosting.Tests", "TwoConfigures"); 429var type = StartupLoader.FindStartupType("Microsoft.AspNetCore.Hosting.Tests", "PrivateConfigure"); 443var type = StartupLoader.FindStartupType("Microsoft.AspNetCore.Hosting.Tests", "TwoConfigureServices"); 456var type = StartupLoader.FindStartupType("Microsoft.AspNetCore.Hosting.Tests", "WithNullConfigureServices"); 473var type = StartupLoader.FindStartupType("Microsoft.AspNetCore.Hosting.Tests", "WithConfigureServices");
WebHostTests.AsyncDisposable.cs (1)
74public object GetService(Type serviceType) => _serviceProvider.GetService(serviceType);
WebHostTests.cs (2)
1306public object this[Type key] 1331public IEnumerator<KeyValuePair<Type, object>> GetEnumerator()
Microsoft.AspNetCore.Html.Abstractions (1)
HtmlFormattableString.cs (1)
158public object? GetFormat(Type? formatType)
Microsoft.AspNetCore.Http (1)
MiddlewareFactory.cs (1)
28public IMiddleware? Create(Type middlewareType)
Microsoft.AspNetCore.Http.Abstractions (65)
EndpointFilterFactoryContext.cs (1)
30public object? GetService(Type serviceType) => null;
EndpointFilterInvocationContext.cs (1)
28/// <typeparam name="T">The <see cref="Type"/> of the resolved argument.</typeparam>
Extensions\EndpointBuilder.cs (1)
49public object? GetService(Type serviceType) => null;
Extensions\UseMiddlewareExtensions.cs (18)
51[DynamicallyAccessedMembers(MiddlewareAccessibility)] Type middleware, 106private readonly Type _middleware; 113[DynamicallyAccessedMembers(MiddlewareAccessibility)] Type middleware, 160private readonly Type _middlewareType; 162public InterfaceMiddlewareBinder(Type middlewareType) 206var parameterType = parameters[i].ParameterType; 229var parameterType = parameters[i].ParameterType; 230var declaringType = methodInfo.DeclaringType!; 246private static UnaryExpression GetMethodArgument(ParameterInfo parameter, ParameterExpression providerArg, Type parameterType, Type? declaringType) 256parameterTypeExpression.Add(Expression.Constant(parameterType, typeof(Type))); 257parameterTypeExpression.Add(Expression.Constant(declaringType, typeof(Type))); 295var middleware = typeof(T); 306var parameterType = parameter.ParameterType; 328private static object GetService(IServiceProvider sp, Type type, Type middleware) 335private static object GetKeyedService(IServiceProvider sp, object key, Type type, Type middleware)
HttpContext.cs (2)
111public DictionaryItemDebugView<Type, object>[] Items => _features.Select(pair => new DictionaryItemDebugView<Type, object>(pair)).ToArray();
IMiddlewareFactory.cs (2)
14/// <param name="middlewareType">The concrete <see cref="Type"/> of the <see cref="IMiddleware"/>.</param> 16IMiddleware? Create(Type middlewareType);
Metadata\AcceptsMetadata.cs (2)
21public AcceptsMetadata(string[] contentTypes, Type? type = null, bool isOptional = false) 38public Type? RequestType { get; }
Metadata\IAcceptsMetadata.cs (1)
23Type? RequestType { get; }
Metadata\IProducesResponseTypeMetadata.cs (1)
14Type? Type { get; }
Metadata\ProducesResponseTypeMetadata.cs (4)
24public ProducesResponseTypeMetadata(int statusCode, Type? type = null, string[]? contentTypes = null) 54private ProducesResponseTypeMetadata(int statusCode, Type? type, IEnumerable<string> contentTypes) 64public Type? Type { get; private set; } 87internal static ProducesResponseTypeMetadata CreateUnvalidated(Type? type, int statusCode, IEnumerable<string> contentTypes) => new(statusCode, type, contentTypes);
PathString.cs (2)
514public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 523CultureInfo? culture, object? value, Type destinationType)
Routing\EndpointMetadataCollection.cs (2)
30private readonly ConcurrentDictionary<Type, object[]> _cache; 41_cache = new ConcurrentDictionary<Type, object[]>();
Routing\RouteValueDictionary.cs (5)
44private static readonly ConcurrentDictionary<Type, PropertyHelper[]> _propertyCache = new ConcurrentDictionary<Type, PropertyHelper[]>(); 891var type = Value.GetType(); 900private static void ValidatePropertyNames(Type type, PropertyHelper[] properties) 927internal static void ClearCache(Type[]? _)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (2)
47Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType); 87private static object? CreateValueType(Type t) => RuntimeHelpers.GetUninitializedObject(t);
src\Shared\PropertyHelper\PropertyHelper.cs (21)
41private static readonly ConcurrentDictionary<Type, PropertyHelper[]> PropertiesCache = new(); 43private static readonly ConcurrentDictionary<Type, PropertyHelper[]> VisiblePropertiesCache = new(); 50/// This constructor does not cache the helper. For caching, use <see cref="GetProperties(Type)"/>. 123[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 144[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 244Type openGenericDelegateType, 248var typeInput = propertyGetMethod.DeclaringType!; 249var typeOutput = propertyGetMethod.ReturnType; 251var delegateType = openGenericDelegateType.MakeGenericType(typeInput, typeOutput); 290var typeInput = setMethod.DeclaringType!; 291var parameterType = parameters[0].ParameterType; 412Type type, 413ConcurrentDictionary<Type, PropertyHelper[]>? allPropertiesCache, 414ConcurrentDictionary<Type, PropertyHelper[]>? visiblePropertiesCache) 444var declaringType = propertyHelper.Property.DeclaringType; 457Type? currentType = type; 493Type type, 494ConcurrentDictionary<Type, PropertyHelper[]>? cache) 509foreach (var @interface in type.GetInterfaces()) 523[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 562public static void ClearCache(Type[]? _)
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.Http.Abstractions.Tests (17)
UseMiddlewareTest.cs (13)
297public IMiddleware? Create(Type middlewareType) 311public IMiddleware? Create(Type middlewareType) => null; 318private readonly Dictionary<Type, object> _services = new Dictionary<Type, object>(); 320public void AddService(Type type, object value) => _services[type] = value; 322public object? GetService(Type serviceType) 339private readonly Dictionary<object, Tuple<Type, object>> _services = new Dictionary<object, Tuple<Type, object>>(); 346public void AddKeyedService(object key, Type type, object value) => _services[key] = new Tuple<Type, object>(type, value); 348public object? GetKeyedService(Type serviceType, object? serviceKey) 358public object GetRequiredKeyedService(Type serviceType, object? serviceKey) 370public object? GetService(Type serviceType)
UsePathBaseExtensionsTests.cs (4)
245private readonly Dictionary<Type, object> _services = new Dictionary<Type, object>(); 247public void AddService(Type type, object value) => _services[type] = value; 249public object? GetService(Type serviceType)
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionDispatcher.cs (1)
837public object? GetService(Type serviceType) => null;
Microsoft.AspNetCore.Http.Connections.Client (2)
src\Shared\ThrowHelpers\ObjectDisposedThrowHelper.cs (2)
34public static void ThrowIf([DoesNotReturnIf(true)] bool condition, Type type) 54private static void ThrowObjectDisposedException(Type? type)
Microsoft.AspNetCore.Http.Extensions (276)
DefaultProblemDetailsWriter.cs (1)
63var problemDetailsType = context.ProblemDetails.GetType();
HeaderDictionaryTypeExtensions.cs (2)
264var type = typeof(T); 301var type = typeof(T);
HttpRequestJsonExtensions.cs (3)
172Type type, 194Type type, 237Type type,
HttpResponseJsonExtensions.cs (6)
214Type type, 237Type type, 260Type type, 287Type type, 312Type type, 331static async Task WriteAsJsonAsyncSlow(PipeWriter body, object? value, Type type, JsonSerializerContext context,
RequestDelegateFactory.cs (28)
55private static readonly MethodInfo GetRequiredServiceMethod = typeof(ServiceProviderServiceExtensions).GetMethod(nameof(ServiceProviderServiceExtensions.GetRequiredService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider) })!; 56private static readonly MethodInfo GetServiceMethod = typeof(ServiceProviderServiceExtensions).GetMethod(nameof(ServiceProviderServiceExtensions.GetService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider) })!; 57private static readonly MethodInfo GetRequiredKeyedServiceMethod = typeof(ServiceProviderKeyedServiceExtensions).GetMethod(nameof(ServiceProviderKeyedServiceExtensions.GetRequiredKeyedService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider), typeof(object) })!; 58private static readonly MethodInfo GetKeyedServiceMethod = typeof(ServiceProviderKeyedServiceExtensions).GetMethod(nameof(ServiceProviderKeyedServiceExtensions.GetKeyedService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider), typeof(object) })!; 65private static readonly MethodInfo ArrayEmptyOfObjectMethod = typeof(Array).GetMethod(nameof(Array.Empty), BindingFlags.Public | BindingFlags.Static)!.MakeGenericMethod(new Type[] { typeof(object) }); 346var returnType = methodInfo.ReturnType; 502private static Expression MapHandlerReturnTypeToValueTask(Expression methodCall, Type returnType) 535var typeArg = coercedAwaitableInfo.AwaitableInfo.ResultType; 541var typeArg = coercedAwaitableInfo.AwaitableInfo.ResultType; 607var constructorType = factoryContext.ArgumentTypes?.Length switch 648factoryContext.ArgumentTypes = new Type[parameters.Length]; 937private static Expression CreateParamCheckingResponseWritingMethodCall(Type returnType, RequestDelegateFactoryContext factoryContext) 1025private static void PopulateBuiltInResponseTypeMetadata(Type returnType, EndpointBuilder builder) 1059private static Expression AddResponseWritingToMethodCall(Expression methodCall, Type returnType, RequestDelegateFactoryContext factoryContext) 1113var typeArg = returnType.GetGenericArguments()[0]; 1161var typeArg = returnType.GetGenericArguments()[0]; 1368[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type bodyType, 1423private static object? CreateValueType(Type t) => RuntimeHelpers.GetUninitializedObject(t); 1552private static Expression GetValueFromProperty(MemberExpression sourceExpression, PropertyInfo itemProperty, string key, Type? returnType = null) 1561var parameterType = parameter.ParameterType; 1676var targetParseType = parameter.ParameterType.IsArray ? parameter.ParameterType.GetElementType()! : parameter.ParameterType; 1678var underlyingNullableType = Nullable.GetUnderlyingType(targetParseType); 1681var nonNullableParameterType = underlyingNullableType ?? targetParseType; 1961private static Type? GetExpressionType(Type type) => 2017private static void AddInferredAcceptsMetadata(RequestDelegateFactoryContext factoryContext, Type type, string[] contentTypes) 2615private static NotSupportedException GetUnsupportedReturnTypeException(Type returnType) 2895public object? GetService(Type serviceType) => null;
RequestDelegateFactoryContext.cs (2)
57public Type[] ArgumentTypes { get; set; } = Array.Empty<Type>();
src\Components\Endpoints\src\FormMapping\Converters\CollectionConverter.cs (2)
27private static readonly Type _elementType = typeof(TElement); 55Type type,
src\Components\Endpoints\src\FormMapping\Converters\CompiledComplexTypeConverter.cs (2)
10public delegate bool ConverterDelegate(ref FormDataReader reader, Type type, FormDataMapperOptions options, out T? result, out bool found); 14internal override bool TryRead(ref FormDataReader context, Type type, FormDataMapperOptions options, out T? result, out bool found)
src\Components\Endpoints\src\FormMapping\Converters\DictionaryConverter.cs (2)
19private static readonly Type _elementType = typeof(TValue); 31Type type,
src\Components\Endpoints\src\FormMapping\Converters\EnumConverter.cs (1)
30internal override bool TryRead(ref FormDataReader reader, Type type, FormDataMapperOptions options, out TEnum result, out bool found)
src\Components\Endpoints\src\FormMapping\Converters\FileConverter.cs (1)
16internal override bool TryRead(ref FormDataReader reader, Type type, FormDataMapperOptions options, out T? result, out bool found)
src\Components\Endpoints\src\FormMapping\Converters\NullableConverter.cs (1)
33internal override bool TryRead(ref FormDataReader context, Type type, FormDataMapperOptions options, out T? result, out bool found)
src\Components\Endpoints\src\FormMapping\Converters\ParsableConverter.cs (1)
30internal override bool TryRead(ref FormDataReader reader, Type type, FormDataMapperOptions options, out T? result, out bool found)
src\Components\Endpoints\src\FormMapping\Converters\UriFormDataConverter.cs (1)
32internal override bool TryRead(ref FormDataReader context, Type type, FormDataMapperOptions options, out Uri? result, out bool found)
src\Components\Endpoints\src\FormMapping\Factories\CollectionConverterFactory.cs (8)
15public bool CanConvert(Type type, FormDataMapperOptions options) 17var element = ResolveElementType(type); 34public static Type? ResolveElementType(Type type) 36var enumerable = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IEnumerable<>)); 47public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options) 55var enumerableType = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IEnumerable<>)); 56var elementType = enumerableType?.GetGenericArguments()[0];
src\Components\Endpoints\src\FormMapping\Factories\Collections\ConcreteTypeCollectionConverterFactory.cs (2)
16public bool CanConvert(Type _, FormDataMapperOptions options) => true; 20public FormDataConverter CreateConverter(Type _, FormDataMapperOptions options)
src\Components\Endpoints\src\FormMapping\Factories\Collections\TypedCollectionConverterFactory.cs (7)
15public abstract bool CanConvert(Type type, FormDataMapperOptions options); 19public abstract FormDataConverter CreateConverter(Type type, FormDataMapperOptions options); 26public override bool CanConvert(Type _, FormDataMapperOptions options) 35var type = typeof(TCollection); 65var _ when type.IsAssignableTo(typeof(ICollection<TElement>)) && type.GetConstructor(Type.EmptyTypes) != null => true, 111public override FormDataConverter CreateConverter(Type _, FormDataMapperOptions options) 118var type = typeof(TCollection);
src\Components\Endpoints\src\FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactory.cs (1)
12internal abstract FormDataConverter CreateConverter(Type type, FormDataMapperOptions options);
src\Components\Endpoints\src\FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (20)
16internal override CompiledComplexTypeConverter<T> CreateConverter(Type type, FormDataMapperOptions options) 24private CompiledComplexTypeConverter<T>.ConverterDelegate CreateConverterBody(Type type, FormDataMapperOptions options) 159Array.Empty<Type>(), 185Array.Empty<Type>(), 287Array.Empty<Type>(), 297Array.Empty<Type>(), 304Array.Empty<Type>(), 314Array.Empty<Type>(), 343var propertyConverterType = typeof(FormDataConverter<>).MakeGenericType(property.Type); 379Array.Empty<Type>(), 388Type.EmptyTypes, 398Array.Empty<Type>(), 406Array.Empty<Type>(), 443var constructorParameterConverterType = typeof(FormDataConverter<>).MakeGenericType(constructorParameter.Type); 483Array.Empty<Type>(), 491Type.EmptyTypes, 501Array.Empty<Type>(), 509Array.Empty<Type>(), 552Expression.Not(Expression.Call(readerParam, nameof(FormDataReader.CurrentPrefixExists), Array.Empty<Type>())), 575Expression.Parameter(typeof(Type), "type"),
src\Components\Endpoints\src\FormMapping\Factories\ComplexTypeConverterFactory.cs (2)
18public bool CanConvert(Type type, FormDataMapperOptions options) 99public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
src\Components\Endpoints\src\FormMapping\Factories\Dictionary\ConcreteTypeDictionaryConverterFactory.cs (2)
15public bool CanConvert(Type type, FormDataMapperOptions options) => true; 19public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
src\Components\Endpoints\src\FormMapping\Factories\Dictionary\TypedDictionaryConverterFactory.cs (4)
16public bool CanConvert(Type type, FormDataMapperOptions options) 61var _ when type.IsAssignableTo(typeof(IDictionary<TKey, TValue>)) && type.GetConstructor(Type.EmptyTypes) != null => true, 71public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options) 143var _ when type.IsAssignableTo(typeof(IDictionary<TKey, TValue>)) && type.GetConstructor(Type.EmptyTypes) != null =>
src\Components\Endpoints\src\FormMapping\Factories\DictionaryConverterFactory.cs (13)
15public bool CanConvert(Type type, FormDataMapperOptions options) 42internal static (Type keyType, Type valueType) ResolveDictionaryTypes(Type type) 46var dictionaryType = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IDictionary<,>)) ?? 55var keyType = dictionaryType.GetGenericArguments()[0]; 61var parsableKeyType = ClosedGenericMatcher.ExtractGenericInterface(keyType, typeof(IParsable<>)); 67var valueType = dictionaryType.GetGenericArguments()[1]; 73public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options) 77var dictionaryType = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IDictionary<,>)) ?? 85var keyType = dictionaryType?.GetGenericArguments()[0]; 91var parsableKeyType = ClosedGenericMatcher.ExtractGenericInterface(keyType, typeof(IParsable<>)); 98var valueType = dictionaryType?.GetGenericArguments()[1];
src\Components\Endpoints\src\FormMapping\Factories\EnumConverterFactory.cs (2)
12public bool CanConvert(Type type, FormDataMapperOptions options) => type.IsEnum; 16public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
src\Components\Endpoints\src\FormMapping\Factories\FileConverterFactory.cs (3)
19public bool CanConvert(Type type, FormDataMapperOptions options) => CanConvertCommon(type); 22private static bool CanConvertCommon(Type type) => type == typeof(IFormFile) || type == typeof(IFormFileCollection) || type == typeof(IReadOnlyList<IFormFile>); 26public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
src\Components\Endpoints\src\FormMapping\Factories\NullableConverterFactory.cs (5)
15public bool CanConvert(Type type, FormDataMapperOptions options) 17var underlyingType = Nullable.GetUnderlyingType(type); 23public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options) 25var underlyingType = Nullable.GetUnderlyingType(type); 31var expectedConverterType = typeof(NullableConverter<>).MakeGenericType(underlyingType);
src\Components\Endpoints\src\FormMapping\Factories\ParsableConverterFactory.cs (2)
15public bool CanConvert(Type type, FormDataMapperOptions options) 22public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
src\Components\Endpoints\src\FormMapping\FormDataConverterOfT.cs (1)
12internal abstract bool TryRead(ref FormDataReader context, Type type, FormDataMapperOptions options, out T? result, out bool found);
src\Components\Endpoints\src\FormMapping\FormDataMapper.cs (1)
46public static partial void CannotResolveConverter(ILogger logger, Type type, Exception? ex);
src\Components\Endpoints\src\FormMapping\FormDataMapperOptions.cs (4)
14private readonly ConcurrentDictionary<Type, FormDataConverter> _converters = new(); 60private static FormDataConverter CreateConverter(Type type, FormDataMapperOptions options) 75internal FormDataConverter ResolveConverter(Type type) 90internal bool CanConvert(Type type)
src\Components\Endpoints\src\FormMapping\IFormDataConverterFactory.cs (2)
12public bool CanConvert(Type type, FormDataMapperOptions options); 16public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options);
src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (31)
26public FormDataTypeMetadata? GetOrCreateMetadataFor(Type type, FormDataMapperOptions options) 267internal bool HasMetadataFor(Type type) => _context.TypeMetadata.ContainsKey(type); 269private void DetectCyclesAndMarkMetadataTypesAsRecursive(Type type, FormDataTypeMetadata result) 303void ReportRecursiveChain(Type type) 315public Dictionary<Type, FormDataTypeMetadata> TypeMetadata { get; set; } = new(); 317public List<Type> CurrentTypes { get; set; } = new(); 340internal void Track(Type type) 345internal void Untrack(Type type) 354public static partial void StartResolveMetadataGraph(ILogger logger, Type type); 357public static partial void EndResolveMetadataGraph(ILogger logger, Type type); 360public static partial void MetadataFound(ILogger<FormDataMetadataFactory> logger, Type type); 363public static partial void NoMetadataFound(ILogger<FormDataMetadataFactory> logger, Type type); 366public static partial void RecursiveTypeFound(ILogger<FormDataMetadataFactory> logger, Type type, string chain); 369public static partial void PrimitiveType(ILogger<FormDataMetadataFactory> logger, Type type); 372public static partial void DictionaryType(ILogger<FormDataMetadataFactory> logger, Type type); 375public static partial void CollectionType(ILogger<FormDataMetadataFactory> logger, Type type); 378public static partial void ObjectType(ILogger<FormDataMetadataFactory> logger, Type type); 381public static partial void ConstructorFound(ILogger<FormDataMetadataFactory> logger, Type type, string parameters); 384public static partial void ConstructorParameter(ILogger<FormDataMetadataFactory> logger, Type type, string name, Type parameterType); 387public static partial void CandidateProperty(ILogger<FormDataMetadataFactory> logger, string name, Type propertyType); 405public static partial void MetadataComputed(ILogger<FormDataMetadataFactory> logger, Type type); 408public static partial void GenericTypeDefinitionNotSupported(ILogger<FormDataMetadataFactory> logger, Type type); 411public static partial void MultiplePublicConstructorsFound(ILogger<FormDataMetadataFactory> logger, Type type); 414public static partial void InterfacesNotSupported(ILogger<FormDataMetadataFactory> logger, Type type); 417public static partial void AbstractClassesNotSupported(ILogger<FormDataMetadataFactory> logger, Type type); 420public static partial void NoPublicConstructorFound(ILogger<FormDataMetadataFactory> logger, Type type); 423public static partial void ConstructorParameterTypeNotSupported(ILogger<FormDataMetadataFactory> logger, Type type, string name, Type parameterType); 426public static partial void PropertyTypeNotSupported(ILogger<FormDataMetadataFactory> logger, Type type, string name, Type propertyType);
src\Components\Endpoints\src\FormMapping\Metadata\FormDataParameterMetadata.cs (2)
11public Type Type { get; set; } = parameter.ParameterType; 22public Type Type { get; }
src\Components\Endpoints\src\FormMapping\Metadata\FormDataPropertyMetadata.cs (1)
15public Type Type => property.PropertyType;
src\Components\Endpoints\src\FormMapping\Metadata\FormDataTypeMetadata.cs (2)
8internal class FormDataTypeMetadata(Type type) 12public Type Type { get; set; } = type;
src\Components\Endpoints\src\FormMapping\WellKnownConverters.cs (2)
13public static readonly IReadOnlyDictionary<Type, FormDataConverter> Converters; 19var converters = new Dictionary<Type, FormDataConverter>
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (16)
19/// Determine whether <paramref name="queryType"/> is or implements a closed generic <see cref="Type"/> 22/// <param name="queryType">The <see cref="Type"/> of interest.</param> 23/// <param name="interfaceType">The open generic <see cref="Type"/> to match. Usually an interface.</param> 25/// The closed generic <see cref="Type"/> created from <paramref name="interfaceType"/> that 26/// <paramref name="queryType"/> is or implements. <c>null</c> if the two <see cref="Type"/>s have no such 34public static Type? ExtractGenericInterface([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 59private static bool IsGenericInstantiation(Type candidate, Type interfaceType) 66private static Type? GetGenericInstantiation([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 68Type? bestMatch = null; 70foreach (var @interface in interfaces) 96var baseType = queryType?.BaseType;
src\Shared\EndpointMetadataPopulator.cs (1)
49var returnType = methodInfo.ReturnType;
src\Shared\Json\JsonSerializerExtensions.cs (3)
16public static bool ShouldUseWith(this JsonTypeInfo jsonTypeInfo, [NotNullWhen(false)] Type? runtimeType) 19public static JsonTypeInfo GetReadOnlyTypeInfo(this JsonSerializerOptions options, Type type) 25public static JsonTypeInfo GetRequiredTypeInfo(this JsonSerializerContext context, Type type)
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (9)
20public Type AwaiterType { get; } 25public Type ResultType { get; } 29Type awaiterType, 34Type resultType, 48Type type, 54var getAwaiterMethod = type.GetMethod("GetAwaiter", Everything, Type.EmptyTypes); 62var awaiterType = getAwaiterMethod.ReturnType; 65var isCompletedProperty = awaiterType.GetProperty("IsCompleted", Everything, binder: null, returnType: typeof(bool), types: Type.EmptyTypes, modifiers: null); 93var getResultMethod = awaiterType.GetMethod("GetResult", Everything, Type.EmptyTypes);
src\Shared\ObjectMethodExecutor\CoercedAwaitableInfo.cs (5)
15public Type CoercerResultType { get; } 25public CoercedAwaitableInfo(Expression coercerExpression, Type coercerResultType, AwaitableInfo coercedAwaitableInfo) 35[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type, 43out var nonGenericAwaitableType)) 61out var coercerResultType))
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (9)
68var isAwaitable = IsTaskType(MethodReturnType, out var resultType); 96public Type? AsyncResultType { get; } 99public Type MethodReturnType { get; internal set; } 281var postCoercionMethodReturnType = coercedAwaitableInfo.CoercerResultType ?? methodInfo.ReturnType; 398private static bool IsTaskType(Type methodReturnType, [NotNullWhen(true)] out Type? resultType) 412var currentType = methodReturnType; 437private static MethodExecutorAsync? GetExecutorAsyncTrimAotCompatible(MethodInfo methodInfo, Type asyncResultType) 439var methodReturnType = methodInfo.ReturnType;
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (20)
59Type possibleFSharpAsyncType, 61out Type awaitableType) 63var methodReturnGenericType = possibleFSharpAsyncType.IsGenericType 74var awaiterResultType = possibleFSharpAsyncType.GetGenericArguments().Single(); 98TryBuildCoercerFromUnitAwaitableToVoidAwaitable(awaitableType, out var coercerExpression, out var nonGenericAwaitableType) 132Type genericAwaitableType, 134out Type nonGenericAwaitableType) 152static Expression MakeTaskOfUnitToTaskExpression(Type type) 158static Expression MakeValueTaskOfUnitToValueTaskExpression(Type type) 172private static bool IsFSharpAsyncOpenGenericType(Type possibleFSharpAsyncType) => 176private static bool IsFSharpUnit(Type possibleFSharpUnitType) => 180private static bool IsCoerceableFSharpType(Type possibleFSharpType, string coerceableFSharpTypeName) 206private static bool TryPopulateFSharpValueCaches(Type possibleFSharpType) 209var fsharpOptionType = assembly.GetType(FSharpOptionTypeName); 210var fsharpAsyncType = assembly.GetType(FSharpAsyncTypeName); 211var fsharpAsyncGenericType = assembly.GetType(FSharpAsyncGenericTypeName); 219var fsharpOptionOfTaskCreationOptionsType = fsharpOptionType 225var fsharpOptionOfCancellationTokenType = fsharpOptionType 252private static bool TypesHaveSameIdentity(Type type1, Type type2)
src\Shared\ParameterBindingMethodCache.cs (29)
46private readonly ConcurrentDictionary<Type, Func<ParameterExpression, Expression, Expression>?> _stringMethodCallCache = new(); 47private readonly ConcurrentDictionary<Type, (Func<ParameterInfo, Expression>?, int)> _bindAsyncMethodCallCache = new(); 48private readonly ConcurrentDictionary<Type, (ConstructorInfo?, ConstructorParameter[])> _constructorCache = new(); 67public bool HasTryParseMethod(Type type) 69var nonNullableParameterType = Nullable.GetUnderlyingType(type) ?? type; 80public Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type type) 85Func<ParameterExpression, Expression, Expression>? Finder(Type type) 149Type t when t == typeof(DateTime) => DateTimeStyles.AdjustToUniversal | DateTimeStyles.AllowWhiteSpaces, 150Type t when t == typeof(DateTimeOffset) => DateTimeStyles.AssumeUniversal | DateTimeStyles.AllowWhiteSpaces, 218(Func<ParameterInfo, Expression>?, int) Finder(Type nonNullableParameterType) 240var valueTaskResultType = methodInfo.ReturnType.GetGenericArguments()[0]; 302var nonNullableParameterType = Nullable.GetUnderlyingType(parameter.ParameterType) ?? parameter.ParameterType; 313public (ConstructorInfo?, ConstructorParameter[]) FindConstructor(Type type) 315static (ConstructorInfo? constructor, ConstructorParameter[] parameters) Finder(Type type) 359private static ConstructorInfo? GetConstructor(Type type) 410private static MethodInfo? GetIBindableFromHttpContextMethod(Type type) 413foreach (var i in type.GetInterfaces()) 431private static bool TryGetExplicitIParsableTryParseMethod(Type type, out MethodInfo methodInfo) 442private MethodInfo? GetStaticMethodFromHierarchy(Type type, string name, Type[] parameterTypes, Func<MethodInfo, bool> validateReturnType) 456foreach (var implementedInterface in type.GetInterfaces()) 480private static MethodInfo? GetAnyMethodFromHierarchy(Type type, string name) 491foreach (var implementedInterface in type.GetInterfaces()) 513new[] { typeof(Type), typeof(string), typeof(object).MakeByRefType() }); 520new[] { typeof(string), Type.MakeGenericMethodParameter(0).MakeByRefType() }); 532private static bool TryGetDateTimeTryParseMethod(Type type, [NotNullWhen(true)] out MethodInfo? methodInfo) 568private static bool TryGetNumberStylesTryGetMethod(Type type, [NotNullWhen(true)] out MethodInfo? method, [NotNullWhen(true)] out NumberStyles? numberStyles) 709public ParameterLookupKey(string name, Type type) 716public Type Type { get; }
src\Shared\PropertyAsParameterInfo.cs (4)
140public override object[] GetCustomAttributes(Type attributeType, bool inherit) 187public override Type[] GetOptionalCustomModifiers() 190public override Type[] GetRequiredCustomModifiers() 193public override bool IsDefined(Type attributeType, bool inherit)
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
41var runtimeType = value?.GetType();
src\Shared\TypeNameHelper\TypeNameHelper.cs (9)
17private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 46/// <param name="type">The <see cref="Type"/>.</param> 52public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 59private static void ProcessType(StringBuilder builder, Type type, in DisplayNameOptions options) 93private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 95var innerType = type; 112private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
Microsoft.AspNetCore.Http.Extensions.Tests (52)
HttpResponseJsonExtensionsTests.cs (1)
79public override int Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
ParameterBindingMethodCacheTests.cs (29)
27public void FindTryParseStringMethod_ReturnsTheExpectedTryParseMethodWithInvariantCulture(Type type) 67public void FindTryParseStringMethod_ReturnsTheExpectedTryParseMethodWithInvariantCultureDateType(Type type) 99public void FindTryParseStringMethod_ReturnsTheExpectedTryParseMethodWithInvariantCultureCustomType(Type type) 124public void FindTryParseMethod_WithNoFormatProvider(Type type) 170var type = typeof(TodoWithExplicitIParsable); 178var type = typeof(Choice); 198var type = typeof(Choice); 221var type = typeof(BindAsyncRecord); 252var type = typeof(BindAsyncSingleArgStruct); 472public void FindConstructor_FindsParameterlessConstructor_WhenExplicitlyDeclared(Type type) 484public void FindConstructor_FindsDefaultConstructor_WhenNotExplictlyDeclared(Type type) 498public void FindConstructor_FindsParameterizedConstructor_WhenExplictlyDeclared(Type type) 510public void FindConstructor_ReturnNullForStruct_WhenNotExplictlyDeclared(Type type) 522public void FindConstructor_ReturnNullForStruct_WhenMultipleParameterizedConstructorsDeclared(Type type) 531public static TheoryData<Type> InvalidTryParseStringTypesData 535return new TheoryData<Type> 554public void FindTryParseMethod_ThrowsIfInvalidTryParseOnType(Type type) 565public void FindTryParseMethod_DoesNotThrowIfInvalidTryParseOnType_WhenThrowOnInvalidFalse(Type type) 587public void FindTryParseMethod_IgnoresInvalidTryParseIfGoodOneFound(Type type) 593public static TheoryData<Type> InvalidBindAsyncTypesData 597return new TheoryData<Type> 614public void FindBindAsyncMethod_ThrowsIfInvalidBindAsyncOnType(Type type) 629public void FindBindAsyncMethod_DoesNotThrowIfInvalidBindAsyncOnType_WhenThrowOnInvalidFalse(Type type) 658public void FindBindAsyncMethod_IgnoresInvalidBindAsyncIfGoodOneFound(Type type) 680public void FindConstructor_ThrowsIfNoPublicConstructors(Type type) 690public void FindConstructor_ThrowsIfAbstract(Type type) 700public void FindConstructor_ThrowsIfMultipleParameterizedConstructors(Type type) 712public void FindConstructor_ThrowsIfParameterizedConstructorIncludeNoMatchingArguments(Type type) 1520public MockParameterInfo(Type type, string name)
ProblemDetailsServiceCollectionExtensionsTest.cs (1)
253public JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options)
PropertyAsParameterInfoTests.cs (1)
176private static PropertyInfo GetProperty(Type containerType, string propertyName)
RequestDelegateFactoryTests.cs (7)
862mock.Setup(m => m.GetService(It.IsAny<Type>())).Returns<Type>(t => 992static string GetMultipleContructorsError(Type type) 995static string GetAbstractClassError(Type type) 998static string GetNoContructorsError(Type type) 1001static string GetInvalidConstructorError(Type type) 3690public object? GetService(Type serviceType)
RequestDelegateGenerator\CompileTimeCreationTests.AsParameters.cs (4)
41static string GetAbstractTypeError(Type type) 44static string GetMultipleContructorsError(Type type) 47static string GetNoContructorsError(Type type) 50static string GetInvalidConstructorError(Type type)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
454public object GetService(Type serviceType) 464public bool IsService(Type serviceType) =>
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (4)
223mock.Setup(m => m.GetService(It.IsAny<Type>())).Returns<Type>(t => 279mock.Setup(m => m.GetService(It.IsAny<Type>())).Returns<Type>(t =>
RequestDelegateGenerator\RequestDelegateCreationTests.KeyServices.cs (2)
257public object GetService(Type serviceType) 265public object GetRequiredService(Type serviceType)
RequestDelegateGenerator\SharedTypes.cs (1)
985public override ITodo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Microsoft.AspNetCore.Http.Microbenchmarks (10)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
454public object GetService(Type serviceType) 464public bool IsService(Type serviceType) =>
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (1)
985public override ITodo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.Http.Results (5)
HttpResultsHelper.cs (1)
40Type? runtimeType = value.GetType();
Results.cs (1)
219public static IResult Json(object? data, Type type, JsonSerializerContext context, string? contentType = null, int? statusCode = null)
src\Shared\Json\JsonSerializerExtensions.cs (3)
16public static bool ShouldUseWith(this JsonTypeInfo jsonTypeInfo, [NotNullWhen(false)] Type? runtimeType) 19public static JsonTypeInfo GetReadOnlyTypeInfo(this JsonSerializerOptions options, Type type) 25public static JsonTypeInfo GetRequiredTypeInfo(this JsonSerializerContext context, Type type)
Microsoft.AspNetCore.Http.Results.Tests (50)
EmptyServiceProvider.cs (1)
10public object GetService(Type serviceType) => null;
ResultsOfTTests.cs (1)
104public object GetService(Type serviceType) => null;
ResultsOfTTests.Generated.cs (45)
19public void ResultsOfTResult1TResult2_Result_IsAssignedResult(int input, Type expectedResultType) 103public async Task ResultsOfTResult1TResult2_AcceptsIResult_AsFirstTypeArg(int input, Type expectedResultType) 128public async Task ResultsOfTResult1TResult2_AcceptsIResult_AsSecondTypeArg(int input, Type expectedResultType) 154public async Task ResultsOfTResult1TResult2_AcceptsNestedResultsOfT_AsFirstTypeArg(int input, Type expectedResultType) 181public async Task ResultsOfTResult1TResult2_AcceptsNestedResultsOfT_AsSecondTypeArg(int input, Type expectedResultType) 231public void ResultsOfTResult1TResult2TResult3_Result_IsAssignedResult(int input, Type expectedResultType) 319public async Task ResultsOfTResult1TResult2TResult3_AcceptsIResult_AsFirstTypeArg(int input, Type expectedResultType) 346public async Task ResultsOfTResult1TResult2TResult3_AcceptsIResult_AsSecondTypeArg(int input, Type expectedResultType) 373public async Task ResultsOfTResult1TResult2TResult3_AcceptsIResult_AsThirdTypeArg(int input, Type expectedResultType) 401public async Task ResultsOfTResult1TResult2TResult3_AcceptsNestedResultsOfT_AsFirstTypeArg(int input, Type expectedResultType) 430public async Task ResultsOfTResult1TResult2TResult3_AcceptsNestedResultsOfT_AsSecondTypeArg(int input, Type expectedResultType) 459public async Task ResultsOfTResult1TResult2TResult3_AcceptsNestedResultsOfT_AsThirdTypeArg(int input, Type expectedResultType) 512public void ResultsOfTResult1TResult2TResult3TResult4_Result_IsAssignedResult(int input, Type expectedResultType) 604public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsIResult_AsFirstTypeArg(int input, Type expectedResultType) 633public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsIResult_AsSecondTypeArg(int input, Type expectedResultType) 662public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsIResult_AsThirdTypeArg(int input, Type expectedResultType) 691public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsIResult_AsFourthTypeArg(int input, Type expectedResultType) 721public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsNestedResultsOfT_AsFirstTypeArg(int input, Type expectedResultType) 752public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsNestedResultsOfT_AsSecondTypeArg(int input, Type expectedResultType) 783public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsNestedResultsOfT_AsThirdTypeArg(int input, Type expectedResultType) 814public async Task ResultsOfTResult1TResult2TResult3TResult4_AcceptsNestedResultsOfT_AsFourthTypeArg(int input, Type expectedResultType) 870public void ResultsOfTResult1TResult2TResult3TResult4TResult5_Result_IsAssignedResult(int input, Type expectedResultType) 966public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsIResult_AsFirstTypeArg(int input, Type expectedResultType) 997public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsIResult_AsSecondTypeArg(int input, Type expectedResultType) 1028public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsIResult_AsThirdTypeArg(int input, Type expectedResultType) 1059public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsIResult_AsFourthTypeArg(int input, Type expectedResultType) 1090public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsIResult_AsFifthTypeArg(int input, Type expectedResultType) 1122public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsNestedResultsOfT_AsFirstTypeArg(int input, Type expectedResultType) 1155public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsNestedResultsOfT_AsSecondTypeArg(int input, Type expectedResultType) 1188public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsNestedResultsOfT_AsThirdTypeArg(int input, Type expectedResultType) 1221public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsNestedResultsOfT_AsFourthTypeArg(int input, Type expectedResultType) 1254public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5_AcceptsNestedResultsOfT_AsFifthTypeArg(int input, Type expectedResultType) 1313public void ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_Result_IsAssignedResult(int input, Type expectedResultType) 1413public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsFirstTypeArg(int input, Type expectedResultType) 1446public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsSecondTypeArg(int input, Type expectedResultType) 1479public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsThirdTypeArg(int input, Type expectedResultType) 1512public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsFourthTypeArg(int input, Type expectedResultType) 1545public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsFifthTypeArg(int input, Type expectedResultType) 1578public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsIResult_AsSixthTypeArg(int input, Type expectedResultType) 1612public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsFirstTypeArg(int input, Type expectedResultType) 1647public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsSecondTypeArg(int input, Type expectedResultType) 1682public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsThirdTypeArg(int input, Type expectedResultType) 1717public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsFourthTypeArg(int input, Type expectedResultType) 1752public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsFifthTypeArg(int input, Type expectedResultType) 1787public async Task ResultsOfTResult1TResult2TResult3TResult4TResult5TResult6_AcceptsNestedResultsOfT_AsSixthTypeArg(int input, Type expectedResultType)
ResultsTests.cs (3)
1700public void FactoryMethod_ReturnsCorrectResultType(Expression<Func<IResult>> expression, Type expectedReturnType) 1728private static IEnumerable<(Expression<Func<IResult>>, Type)> FactoryMethodsTuples { get; } = new List<(Expression<Func<IResult>>, Type)>
Microsoft.AspNetCore.Http.Tests (3)
DefaultHttpContextTests.cs (3)
335var type = value.GetType(); 363var type = value.GetType(); 521public object GetService(Type serviceType)
Microsoft.AspNetCore.Identity (7)
IdentityBuilderExtensions.cs (7)
30var dataProtectionProviderType = typeof(DataProtectorTokenProvider<>).MakeGenericType(builder.UserType); 31var phoneNumberProviderType = typeof(PhoneNumberTokenProvider<>).MakeGenericType(builder.UserType); 32var emailTokenProviderType = typeof(EmailTokenProvider<>).MakeGenericType(builder.UserType); 33var authenticatorProviderType = typeof(AuthenticatorTokenProvider<>).MakeGenericType(builder.UserType); 58var managerType = typeof(SignInManager<>).MakeGenericType(builder.UserType); 73var managerType = typeof(SignInManager<>).MakeGenericType(builder.UserType); 74var customType = typeof(TSignInManager);
Microsoft.AspNetCore.Identity.EntityFrameworkCore (16)
IdentityEntityFrameworkBuilderExtensions.cs (16)
29private static void AddStores(IServiceCollection services, Type userType, Type? roleType, Type contextType) 31var identityUserType = FindGenericBaseType(userType, typeof(IdentityUser<>)); 37var keyType = identityUserType.GenericTypeArguments[0]; 41var identityRoleType = FindGenericBaseType(roleType, typeof(IdentityRole<>)); 47Type userStoreType; 48Type roleStoreType; 49var identityContext = FindGenericBaseType(contextType, typeof(IdentityDbContext<,,,,,,,>)); 75Type userStoreType; 76var identityContext = FindGenericBaseType(contextType, typeof(IdentityUserContext<,,,,>)); 94private static Type? FindGenericBaseType(Type currentType, Type genericBaseType) 96Type? type = currentType; 99var genericType = type.IsGenericType ? type.GetGenericTypeDefinition() : null;
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (2)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (2)
82protected Type GetBasestTypeInAssembly(Type type)
Microsoft.AspNetCore.Identity.InMemory.Test (2)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (2)
82protected Type GetBasestTypeInAssembly(Type type)
Microsoft.AspNetCore.Identity.Test (2)
src\Identity\test\Shared\ApiConsistencyTestBase.cs (2)
82protected Type GetBasestTypeInAssembly(Type type)
Microsoft.AspNetCore.Identity.UI (4)
IdentityDefaultUIAttribute.cs (2)
9public IdentityDefaultUIAttribute(Type implementationTemplate) 14public Type Template { get; }
IdentityPageModelConvention.cs (2)
20var templateInstance = defaultUIAttribute.Template.MakeGenericType(typeof(TUser)); 24private static void ValidateTemplate(Type template)
Microsoft.AspNetCore.InternalTesting (17)
LoggedTest\LoggedTestBase.cs (1)
64var classType = GetType();
TestContext.cs (2)
22Type testClass, 37public Type TestClass { get; }
TestFileOutputContext.cs (1)
100public static string GetTestClassName(Type type)
TestPlatformHelper.cs (1)
12Type.GetType("Mono.Runtime") != null;
xunit\AspNetTestAssemblyRunner.cs (1)
18private readonly Dictionary<Type, object> _assemblyFixtureMappings = new();
xunit\AspNetTestCaseRunner.cs (1)
28protected override XunitTestRunner CreateTestRunner(ITest test, IMessageBus messageBus, Type testClass, object[] constructorArguments, MethodInfo testMethod, object[] testMethodArguments, string skipReason, IReadOnlyList<BeforeAfterTestAttribute> beforeAfterAttributes, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource)
xunit\AspNetTestClassRunner.cs (1)
24IDictionary<Type, object> collectionFixtureMappings)
xunit\AspNetTestCollectionRunner.cs (2)
15private readonly IDictionary<Type, object> _assemblyFixtureMappings; 19Dictionary<Type, object> assemblyFixtureMappings,
xunit\AspNetTestInvoker.cs (2)
22Type testClass, 62private static IEnumerable<ITestMethodLifecycle> GetLifecycleHooks(object testClassInstance, Type testClass, MethodInfo testMethod)
xunit\AspNetTestRunner.cs (1)
22Type testClass,
xunit\AspNetTheoryTestCaseRunner.cs (1)
28protected override XunitTestRunner CreateTestRunner(ITest test, IMessageBus messageBus, Type testClass, object[] constructorArguments, MethodInfo testMethod, object[] testMethodArguments, string skipReason, IReadOnlyList<BeforeAfterTestAttribute> beforeAfterAttributes, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource)
xunit\AssemblyFixtureAttribute.cs (2)
11public AssemblyFixtureAttribute(Type fixtureType) 16public Type FixtureType { get; private set; }
xunit\ConditionalTheoryDiscoverer.cs (1)
54var type = obj.GetType();
Microsoft.AspNetCore.InternalTesting.Tests (5)
TestableAspNetTestAssemblyRunner.cs (2)
31public static TestableAspNetTestAssemblyRunner Create(Type fixtureType, bool failTestCase = false) 87var type = assembly.GetType(TestableAssembly.TestClassName);
TestableAssembly.cs (3)
50public static Assembly Create(Type fixtureType, string logDirectory = null, bool failTestCase = false) 58var fixtureConstructor = typeof(AssemblyFixtureAttribute).GetConstructor(new[] { typeof(Type) }); 77var factConstructor = typeof(FactAttribute).GetConstructor(Array.Empty<Type>());
Microsoft.AspNetCore.JsonPatch (53)
Adapters\AdapterFactory.cs (1)
40var type = typeof(DictionaryAdapter<,>).MakeGenericType(jsonDictionaryContract.DictionaryKeyType, jsonDictionaryContract.DictionaryValueType);
Converters\JsonPatchDocumentConverter.cs (2)
17public override bool CanConvert(Type objectType) 22public override object ReadJson(JsonReader reader, Type objectType, object existingValue,
Converters\TypedJsonPatchDocumentConverter.cs (6)
16Type objectType, 27var genericType = objectType.GenericTypeArguments[0]; 33var genericOperation = typeof(Operation<>); 34var concreteOperationType = genericOperation.MakeGenericType(genericType); 36var genericList = typeof(List<>); 37var concreteList = genericList.MakeGenericType(concreteOperationType);
Internal\ConversionResultProvider.cs (5)
16public static ConversionResult ConvertTo(object value, Type typeToConvertTo) 21internal static ConversionResult ConvertTo(object value, Type typeToConvertTo, IContractResolver contractResolver) 58public static ConversionResult CopyTo(object value, Type typeToConvertTo) 60var targetType = typeToConvertTo; 81private static bool IsNullableType(Type type)
Internal\DynamicObjectAdapter.cs (2)
237protected virtual bool TryConvertValue(object value, Type propertyType, out object convertedValue) 242protected virtual bool TryConvertValue(object value, Type propertyType, IContractResolver contractResolver, out object convertedValue)
Internal\ListAdapter.cs (8)
29if (!TryGetListTypeArgument(list, out var typeArgument, out errorMessage)) 131if (!TryGetListTypeArgument(list, out var typeArgument, out errorMessage)) 168if (!TryGetListTypeArgument(list, out var typeArgument, out errorMessage)) 232Type listTypeArgument, 248Type listTypeArgument, 267protected virtual bool TryGetListTypeArgument(IList list, out Type listTypeArgument, out string errorMessage) 270var listType = list.GetType(); 279var genericList = ClosedGenericMatcher.ExtractGenericInterface(listType, typeof(IList<>));
Internal\PocoAdapter.cs (2)
226protected virtual bool TryConvertValue(object value, Type propertyType, out object convertedValue) 231protected virtual bool TryConvertValue(object value, Type propertyType, IContractResolver contractResolver, out object convertedValue)
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (16)
19/// Determine whether <paramref name="queryType"/> is or implements a closed generic <see cref="Type"/> 22/// <param name="queryType">The <see cref="Type"/> of interest.</param> 23/// <param name="interfaceType">The open generic <see cref="Type"/> to match. Usually an interface.</param> 25/// The closed generic <see cref="Type"/> created from <paramref name="interfaceType"/> that 26/// <paramref name="queryType"/> is or implements. <c>null</c> if the two <see cref="Type"/>s have no such 34public static Type? ExtractGenericInterface([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 59private static bool IsGenericInstantiation(Type candidate, Type interfaceType) 66private static Type? GetGenericInstantiation([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 68Type? bestMatch = null; 70foreach (var @interface in interfaces) 96var baseType = queryType?.BaseType;
src\Shared\TrimmingAttributes.cs (11)
184/// with the specified signature of a member on a <see cref="System.Type"/>. 187/// <param name="type">The <see cref="System.Type"/> containing <paramref name="memberSignature"/>.</param> 188public DynamicDependencyAttribute(string memberSignature, Type type) 210/// with the specified types of members on a <see cref="System.Type"/>. 213/// <param name="type">The <see cref="System.Type"/> containing the specified members.</param> 214public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type) 254/// Gets the <see cref="System.Type"/> containing the specified member. 260public Type? Type { get; } 286/// Indicates that certain members on a specified <see cref="Type"/> are accessed dynamically, 293/// This attribute is valid on members whose type is <see cref="Type"/> or <see cref="string"/>. 299/// can be accessed dynamically on <see cref="Type"/> instances returned from calling
Microsoft.AspNetCore.JsonPatch.Tests (6)
IntegrationTests\HeterogenousCollectionTests.cs (3)
51protected override JsonConverter ResolveContractConverter(Type objectType) 68public override Shape Create(Type objectType) 75Type objectType,
TestObjectModels\HeterogenousCollection.cs (3)
39protected override JsonConverter ResolveContractConverter(Type objectType) 54public override Rectangle Create(Type objectType) 61Type objectType,
Microsoft.AspNetCore.Localization.FunctionalTests (1)
LocalizationTest.cs (1)
96private async Task RunTest(Type startupType, string culture, string expected)
Microsoft.AspNetCore.Mvc (6)
HotReloadService.cs (6)
51private static event Action<Type[]?>? ClearCacheEvent; 52private static event Action<Type[]?>? UpdateApplicationEvent; 54public static void ClearCache(Type[]? changedTypes) 59public static void UpdateApplication(Type[]? changedTypes) 66private void NotifyClearCache(Type[]? changedTypes) 75private void NotifyUpdateApplication(Type[]? changedTypes)
Microsoft.AspNetCore.Mvc.Abstractions (124)
Abstractions\ParameterDescriptor.cs (1)
21public Type ParameterType { get; set; } = default!;
ApiExplorer\ApiParameterDescription.cs (1)
42public Type Type { get; set; } = default!;
ApiExplorer\ApiResponseType.cs (1)
34public Type? Type { get; set; }
Formatters\FormatterCollection.cs (1)
44public void RemoveType(Type formatterType)
Formatters\InputFormatterContext.cs (2)
113/// Gets the requested <see cref="Type"/> of the request body deserialization. 115public Type ModelType { get; }
Formatters\OutputFormatterCanWriteContext.cs (2)
55/// Gets or sets the <see cref="Type"/> of the object to write to the response. 57public virtual Type? ObjectType { get; protected set; }
Formatters\OutputFormatterWriteContext.cs (2)
19/// <param name="objectType">The <see cref="Type"/> of the object to write to the response.</param> 21public OutputFormatterWriteContext(HttpContext httpContext, Func<Stream, Encoding, TextWriter> writerFactory, Type? objectType, object? @object)
ModelBinding\BindingInfo.cs (3)
16private Type? _binderType; 53/// Gets or sets the <see cref="Type"/> of the <see cref="IModelBinder"/> implementation used to bind the 60public Type? BinderType
ModelBinding\IBinderTypeProviderMetadata.cs (3)
7/// Provides a <see cref="Type"/> which implements <see cref="IModelBinder"/>. 12/// A <see cref="Type"/> which implements either <see cref="IModelBinder"/>. 14Type? BinderType { get; }
ModelBinding\IModelMetadataProvider.cs (8)
15/// Supplies metadata describing a <see cref="Type"/>. 17/// <param name="modelType">The <see cref="Type"/>.</param> 18/// <returns>A <see cref="ModelMetadata"/> instance describing the <see cref="Type"/>.</returns> 19ModelMetadata GetMetadataForType(Type modelType); 22/// Supplies metadata describing the properties of a <see cref="Type"/>. 24/// <param name="modelType">The <see cref="Type"/>.</param> 25/// <returns>A set of <see cref="ModelMetadata"/> instances describing properties of the <see cref="Type"/>.</returns> 26IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType);
ModelBinding\Metadata\ModelMetadataIdentity.cs (15)
14Type modelType, 16Type? containerType = null, 28/// Creates a <see cref="ModelMetadataIdentity"/> for the provided model <see cref="Type"/>. 30/// <param name="modelType">The model <see cref="Type"/>.</param> 32public static ModelMetadataIdentity ForType(Type modelType) 48Type modelType, 50Type containerType) 68Type modelType, 69Type containerType) 93public static ModelMetadataIdentity ForParameter(ParameterInfo parameter, Type modelType) 108public static ModelMetadataIdentity ForConstructor(ConstructorInfo constructor, Type modelType) 117/// Gets the <see cref="Type"/> defining the model property represented by the current 120public Type? ContainerType { get; } 123/// Gets the <see cref="Type"/> represented by the current instance. 125public Type ModelType { get; }
ModelBinding\Metadata\ModelMetadataKind.cs (1)
12/// Used for <see cref="ModelMetadata"/> for a <see cref="System.Type"/>.
ModelBinding\ModelBindingContext.cs (1)
90public virtual Type ModelType => ModelMetadata.ModelType;
ModelBinding\ModelMetadata.cs (18)
69public Type? ContainerType => Identity.ContainerType; 91public Type ModelType => Identity.ModelType; 206/// Gets the <see cref="Type"/> of an <see cref="IModelBinder"/> of a model if specified explicitly using 209public abstract Type? BinderType { get; } 251/// Gets the <see cref="ModelMetadata"/> for elements of <see cref="ModelType"/> if that <see cref="Type"/> 446private Type? _elementType; 449/// Gets the <see cref="Type"/> for elements of <see cref="ModelType"/> if that <see cref="Type"/> 452public Type? ElementType 474/// A complex type is defined as a <see cref="Type"/> without a <see cref="TypeConverter"/> that can convert 499/// A collection type is defined as a <see cref="Type"/> which is assignable to <see cref="ICollection{T}"/>. 523/// An enumerable type is defined as a <see cref="Type"/> which is assignable to 540public Type UnderlyingOrModelType { get; private set; } = default!; 643internal static Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type modelType) 780var collectionType = ClosedGenericMatcher.ExtractGenericInterface(ModelType, typeof(ICollection<>)); 786var enumerableType = ClosedGenericMatcher.ExtractGenericInterface(ModelType, typeof(IEnumerable<>)); 814public virtual ModelMetadata GetMetadataForType(Type modelType) 820public virtual IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType)
ModelBinding\ModelMetadataProvider.cs (11)
14/// Supplies metadata describing the properties of a <see cref="Type"/>. 16/// <param name="modelType">The <see cref="Type"/>.</param> 17/// <returns>A set of <see cref="ModelMetadata"/> instances describing properties of the <see cref="Type"/>.</returns> 18public abstract IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType); 21/// Supplies metadata describing a <see cref="Type"/>. 23/// <param name="modelType">The <see cref="Type"/>.</param> 24/// <returns>A <see cref="ModelMetadata"/> instance describing the <see cref="Type"/>.</returns> 25public abstract ModelMetadata GetMetadataForType(Type modelType); 40public virtual ModelMetadata GetMetadataForParameter(ParameterInfo parameter, Type modelType) 51public virtual ModelMetadata GetMetadataForProperty(PropertyInfo propertyInfo, Type modelType) 62public virtual ModelMetadata GetMetadataForConstructor(ConstructorInfo constructor, Type modelType)
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (16)
19/// Determine whether <paramref name="queryType"/> is or implements a closed generic <see cref="Type"/> 22/// <param name="queryType">The <see cref="Type"/> of interest.</param> 23/// <param name="interfaceType">The open generic <see cref="Type"/> to match. Usually an interface.</param> 25/// The closed generic <see cref="Type"/> created from <paramref name="interfaceType"/> that 26/// <paramref name="queryType"/> is or implements. <c>null</c> if the two <see cref="Type"/>s have no such 34public static Type? ExtractGenericInterface([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 59private static bool IsGenericInstantiation(Type candidate, Type interfaceType) 66private static Type? GetGenericInstantiation([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 68Type? bestMatch = null; 70foreach (var @interface in interfaces) 96var baseType = queryType?.BaseType;
src\Shared\ParameterBindingMethodCache.cs (29)
46private readonly ConcurrentDictionary<Type, Func<ParameterExpression, Expression, Expression>?> _stringMethodCallCache = new(); 47private readonly ConcurrentDictionary<Type, (Func<ParameterInfo, Expression>?, int)> _bindAsyncMethodCallCache = new(); 48private readonly ConcurrentDictionary<Type, (ConstructorInfo?, ConstructorParameter[])> _constructorCache = new(); 67public bool HasTryParseMethod(Type type) 69var nonNullableParameterType = Nullable.GetUnderlyingType(type) ?? type; 80public Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type type) 85Func<ParameterExpression, Expression, Expression>? Finder(Type type) 149Type t when t == typeof(DateTime) => DateTimeStyles.AdjustToUniversal | DateTimeStyles.AllowWhiteSpaces, 150Type t when t == typeof(DateTimeOffset) => DateTimeStyles.AssumeUniversal | DateTimeStyles.AllowWhiteSpaces, 218(Func<ParameterInfo, Expression>?, int) Finder(Type nonNullableParameterType) 240var valueTaskResultType = methodInfo.ReturnType.GetGenericArguments()[0]; 302var nonNullableParameterType = Nullable.GetUnderlyingType(parameter.ParameterType) ?? parameter.ParameterType; 313public (ConstructorInfo?, ConstructorParameter[]) FindConstructor(Type type) 315static (ConstructorInfo? constructor, ConstructorParameter[] parameters) Finder(Type type) 359private static ConstructorInfo? GetConstructor(Type type) 410private static MethodInfo? GetIBindableFromHttpContextMethod(Type type) 413foreach (var i in type.GetInterfaces()) 431private static bool TryGetExplicitIParsableTryParseMethod(Type type, out MethodInfo methodInfo) 442private MethodInfo? GetStaticMethodFromHierarchy(Type type, string name, Type[] parameterTypes, Func<MethodInfo, bool> validateReturnType) 456foreach (var implementedInterface in type.GetInterfaces()) 480private static MethodInfo? GetAnyMethodFromHierarchy(Type type, string name) 491foreach (var implementedInterface in type.GetInterfaces()) 513new[] { typeof(Type), typeof(string), typeof(object).MakeByRefType() }); 520new[] { typeof(string), Type.MakeGenericMethodParameter(0).MakeByRefType() }); 532private static bool TryGetDateTimeTryParseMethod(Type type, [NotNullWhen(true)] out MethodInfo? methodInfo) 568private static bool TryGetNumberStylesTryGetMethod(Type type, [NotNullWhen(true)] out MethodInfo? method, [NotNullWhen(true)] out NumberStyles? numberStyles) 709public ParameterLookupKey(string name, Type type) 716public Type Type { get; }
src\Shared\TypeNameHelper\TypeNameHelper.cs (9)
17private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 46/// <param name="type">The <see cref="Type"/>.</param> 52public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 59private static void ProcessType(StringBuilder builder, Type type, in DisplayNameOptions options) 93private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 95var innerType = type; 112private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
Microsoft.AspNetCore.Mvc.Abstractions.Test (33)
ModelBinding\BindingInfoTest.cs (10)
104var modelType = typeof(Guid); 131var modelType = typeof(Guid?); 153var modelType = typeof(Guid); 178var modelType = typeof(Guid); 204var modelType = typeof(Guid); 231var modelType = typeof(Guid); 257var modelType = typeof(Guid?); 279var modelType = typeof(Guid); 300var modelType = typeof(Guid); 322var modelType = typeof(Guid);
ModelBinding\ModelMetadataTest.cs (23)
24public void IsComplexType_ReturnsFalseForSimpleTypes(Type type) 38public void IsComplexType_ReturnsTrueForComplexTypes(Type type) 65public static TheoryData<Type> NonCollectionNonEnumerableData 69return new TheoryData<Type> 79public static TheoryData<Type> CollectionAndEnumerableData 83return new TheoryData<Type> 100public void IsCollectionType_ReturnsFalseForNonCollectionTypes(Type type) 111public void IsCollectionType_ReturnsTrueForCollectionTypes(Type type) 122public void IsEnumerableType_ReturnsFalseForNonEnumerableTypes(Type type) 136public void IsEnumerableType_ReturnsTrueForEnumerableTypes(Type type) 155public void IsNullableValueType_ReturnsExpectedValue(Type modelType, bool expected) 174public void IsReferenceOrNullableType_ReturnsExpectedValue(Type modelType, bool expected) 193public void UnderlyingOrModelType_ReturnsExpectedValue(Type modelType, Type expected) 209public void ElementType_ReturnsNull_ForNonCollections(Type modelType) 215var elementType = metadata.ElementType; 230public void ElementType_ReturnsExpectedMetadata(Type modelType, Type expected) 236var elementType = metadata.ElementType; 448public TestModelMetadata(Type modelType) 458public TestModelMetadata(PropertyInfo propertyInfo, Type modelType, Type containerType) 479public override Type BinderType
Microsoft.AspNetCore.Mvc.ApiExplorer (37)
ApiResponseTypeProvider.cs (14)
34var declaredReturnType = GetDeclaredReturnType(action); 36var runtimeReturnType = GetRuntimeReturnType(declaredReturnType); 47var defaultErrorType = typeof(void); 78Type? type, 79Type defaultErrorType) 137Type? type, 138Type? defaultErrorType, 226Type? type, 298var responseType = apiResponse.Type; 347private Type? GetDeclaredReturnType(ControllerActionDescriptor action) 349var declaredReturnType = action.MethodInfo.ReturnType; 358var unwrappedType = declaredReturnType; 379private static Type? GetRuntimeReturnType(Type? declaredReturnType)
DefaultApiDescriptionProvider.cs (3)
417private IReadOnlyList<ApiRequestFormat> GetSupportedFormats(MediaTypeCollection contentTypes, Type type) 669private static Type GetModelType(ModelMetadata metadata) 688public readonly Type ContainerType;
EndpointMetadataApiDescriptionProvider.cs (11)
141var acceptsRequestType = acceptsMetadata.RequestType; 250private (BindingSource, string, bool, Type) GetBindingSourceAndName(IParameterBindingMetadata parameter, RouteEndpoint routeEndpoint, bool disableInferredBody) 254var parameterType = parameter.ParameterInfo.ParameterType; 291var displayType = EndpointModelMetadata.GetDisplayType(parameterType); 322Type returnType, 325var responseType = returnType; 332var defaultErrorType = errorMetadata?.Type ?? typeof(void); 400private static ApiResponseType CreateDefaultApiResponseType(Type responseType) 417private static ApiResponseFormat? CreateDefaultApiResponseFormat(Type responseType) 436private static EndpointModelMetadata CreateModelMetadata(Type type) => 439private static EndpointModelMetadata CreateModelMetadata(IParameterBindingMetadata parameter, Type type)
EndpointModelMetadata.cs (4)
20public override Type? BinderType { get; } 55public static Type GetDisplayType(Type type) 57var underlyingType = Nullable.GetUnderlyingType(type) ?? type;
src\Shared\PropertyAsParameterInfo.cs (4)
140public override object[] GetCustomAttributes(Type attributeType, bool inherit) 187public override Type[] GetOptionalCustomModifiers() 190public override Type[] GetRequiredCustomModifiers() 193public override bool IsDefined(Type attributeType, bool inherit)
src\Shared\RoslynUtils\TypeHelper.cs (1)
22internal static bool IsCompilerGeneratedType(Type? type = null)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (29)
ApiResponseTypeProviderTest.cs (4)
328var errorType = typeof(InvalidTimeZoneException); 381var errorType = typeof(ProblemDetails); 423var errorType = typeof(InvalidTimeZoneException); 784private static ControllerActionDescriptor GetControllerActionDescriptor(Type type, string name)
DefaultApiDescriptionProviderTest.cs (18)
171Type constraintType, 217Type constraintType, 636public static TheoryData<Type, string, List<FilterDescriptor>> ReturnsActionResultWithProducesAndProducesContentTypeData 656return new TheoryData<Type, string, List<FilterDescriptor>> 685Type controllerType, 733public static TheoryData<Type, string, List<FilterDescriptor>> ReturnsVoidOrTaskWithProducesContentTypeData 756return new TheoryData<Type, string, List<FilterDescriptor>> 795Type controllerType, 2295private ControllerActionDescriptor CreateActionDescriptor(string methodName = null, Type controllerType = null) 2809public List<Type> SupportedTypes { get; } = new List<Type>(); 2818protected override bool CanReadType(Type type) 2837public List<Type> SupportedTypes { get; } = new List<Type>(); 2844protected override bool CanWriteType(Type type) 2877public Type Type { get; set; } 2904public Type RequestType => null; 2911public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
EndpointMetadataApiDescriptionProviderTest.cs (7)
135static void AssertJsonResponse(ApiDescription apiDescription, Type expectedType) 462static void AssertPathParameter(ApiDescription apiDescription, Type expectedTYpe) 483static void AssertPathParameter(ApiDescription apiDescription, Type expectedTYpe) 595static void AssertBodyParameter(ApiDescription apiDescription, string expectedName, Type expectedType) 1310static void AssertFormFileParameter(ApiDescription apiDescription, Type expectedType, string expectedName) 1604public bool IsService(Type serviceType) => serviceType == typeof(IInferredServiceInterface); 1694public object? GetService(Type serviceType)
Microsoft.AspNetCore.Mvc.Core (420)
ApiConventionMethodAttribute.cs (4)
28/// The <see cref="Type"/> of the convention. 37public ApiConventionMethodAttribute(Type conventionType, string methodName) 47private static MethodInfo GetConventionMethod(Type conventionType, string methodName) 68public Type ConventionType { get; }
ApiConventionTypeAttribute.cs (4)
34/// The <see cref="Type"/> of the convention. 42public ApiConventionTypeAttribute(Type conventionType) 51public Type ConventionType { get; } 53internal static void EnsureValid(Type conventionType)
ApiExplorer\ApiConventionMatcher.cs (2)
169internal static bool IsTypeMatch(Type type, Type conventionType, ApiConventionTypeMatchBehavior typeMatchBehavior)
ApiExplorer\IApiRequestFormatMetadataProvider.cs (2)
24/// The <see cref="Type"/> for which the supported content types are desired. 29Type objectType);
ApiExplorer\IApiResponseMetadataProvider.cs (1)
18Type? Type { get; }
ApiExplorer\IApiResponseTypeMetadataProvider.cs (2)
24/// The <see cref="Type"/> for which the supported content types are desired. 29Type objectType);
ApplicationModels\ApiBehaviorApplicationModelProvider.cs (1)
43var defaultErrorType = options.SuppressMapClientErrors ? typeof(void) : typeof(ProblemDetails);
ApplicationModels\ApplicationModelFactory.cs (1)
329var type = method.ReflectedType!;
ApplicationModels\DefaultApplicationModelProvider.cs (2)
218var declaringType = propertyInfo.DeclaringType!; 656var declaringType = baseMethodInfo.DeclaringType;
ApplicationModels\InferParameterBindingInfoConvention.cs (2)
134private bool IsService(Type type) 144type.GetGenericTypeDefinition() is Type genericDefinition &&
ApplicationModels\ParameterModelBase.cs (2)
22Type parameterType, 59public Type ParameterType { get; }
ApplicationParts\ApplicationPartFactory.cs (1)
45var type = provideAttribute.GetFactoryType();
ApplicationParts\ProvideApplicationPartFactoryAttribute.cs (4)
12private readonly Type? _applicationPartFactoryType; 19public ProvideApplicationPartFactoryAttribute(Type factoryType) 39public Type GetFactoryType() 42Type.GetType(_applicationPartFactoryTypeName!, throwOnError: true)!;
BindPropertyAttribute.cs (2)
26private Type? _binderType; 41public Type? BinderType
ConsumesAttribute.cs (3)
62public ConsumesAttribute(Type requestType, string contentType, params string[] otherContentTypes) 97readonly Type? _requestType; 101Type? IAcceptsMetadata.RequestType => _requestType;
ControllerBase.cs (2)
2748Type modelType, 2785Type modelType,
Controllers\ControllerActivatorProvider.cs (2)
44var controllerType = descriptor.ControllerTypeInfo?.AsType(); 58var typeActivator = ActivatorUtilities.CreateFactory(controllerType, Type.EmptyTypes);
Controllers\ControllerBinderDelegateProvider.cs (1)
174var controllerType = actionDescriptor.ControllerTypeInfo.AsType();
Controllers\ControllerFactoryProvider.cs (3)
42var controllerType = descriptor.ControllerTypeInfo?.AsType(); 77var controllerType = descriptor.ControllerTypeInfo?.AsType(); 98var controllerType = descriptor.ControllerTypeInfo?.AsType();
Controllers\DefaultControllerPropertyActivator.cs (5)
13private static readonly Func<Type, PropertyActivator<ControllerContext>[]> _getPropertiesToActivate = 15private readonly ConcurrentDictionary<Type, PropertyActivator<ControllerContext>[]> _activateActions = new(); 19var controllerType = controller.GetType(); 37var controllerType = actionDescriptor.ControllerTypeInfo?.AsType(); 59private static PropertyActivator<ControllerContext>[] GetPropertiesToActivate(Type type)
Controllers\ServiceBasedControllerActivator.cs (1)
19var controllerType = actionContext.ActionDescriptor.ControllerTypeInfo.AsType();
DependencyInjection\ApplicationModelConventionExtensions.cs (1)
32public static void RemoveType(this IList<IApplicationModelConvention> list, Type type)
DependencyInjection\MvcCoreMvcBuilderExtensions.cs (1)
127foreach (var controller in feature.Controllers.Select(c => c.AsType()))
DependencyInjection\MvcCoreMvcCoreBuilderExtensions.cs (1)
144foreach (var controller in feature.Controllers.Select(c => c.AsType()))
Filters\DisableRequestSizeLimitFilter.cs (3)
72public static partial void NotMostEffectiveFilter(ILogger logger, Type overriddenFilter, Type overridingFilter, Type filterPolicy);
Filters\FilterCollection.cs (12)
22/// Use <see cref="AddService(Type)"/> to register a service as a filter. 38/// Use <see cref="AddService(Type)"/> to register a service as a filter. 41public IFilterMetadata Add(Type filterType) 57/// Use <see cref="AddService(Type)"/> to register a service as a filter. 73/// Use <see cref="AddService(Type)"/> to register a service as a filter. 75public IFilterMetadata Add(Type filterType, int order) 99/// <see cref="Add(Type)"/> to register a service that will be created via 115/// <see cref="Add(Type)"/> to register a service that will be created via 119public IFilterMetadata AddService(Type filterType) 134/// <see cref="Add(Type)"/> to register a service that will be created via 150/// <see cref="Add(Type)"/> to register a service that will be created via 153public IFilterMetadata AddService(Type filterType, int order)
Filters\MiddlewareFilterAttribute.cs (2)
20public MiddlewareFilterAttribute(Type configurationType) 30public Type ConfigurationType { get; }
Filters\MiddlewareFilterBuilder.cs (4)
20private readonly ConcurrentDictionary<Type, Lazy<RequestDelegate>> _pipelinesCache 21= new ConcurrentDictionary<Type, Lazy<RequestDelegate>>(); 31public RequestDelegate GetPipeline(Type configurationType) 42private RequestDelegate BuildPipeline(Type middlewarePipelineProviderType)
Filters\MiddlewareFilterConfigurationProvider.cs (6)
18public static Action<IApplicationBuilder> CreateConfigureDelegate(Type configurationType) 33private static ConfigureBuilder GetConfigureDelegateBuilder(Type startupType) 39private static MethodInfo FindMethod(Type startupType, Type returnType) 71private static bool HasParameterlessConstructor(Type modelType) 73return !modelType.IsAbstract && modelType.GetConstructor(Type.EmptyTypes) != null;
Filters\OutputCacheFilter.cs (3)
54public static partial void NotMostEffectiveFilter(ILogger logger, Type overriddenFilter, Type overridingFilter, Type filterPolicy);
Filters\RequestFormLimitsFilter.cs (3)
58public static partial void NotMostEffectiveFilter(ILogger logger, Type overriddenFilter, Type overridingFilter, Type filterPolicy);
Filters\RequestSizeLimitFilter.cs (3)
74public static partial void NotMostEffectiveFilter(ILogger logger, Type overriddenFilter, Type overridingFilter, Type filterPolicy);
Filters\ResponseCacheFilter.cs (3)
106public static partial void NotMostEffectiveFilter(ILogger logger, Type overriddenFilter, Type overridingFilter, Type filterPolicy);
Formatters\InputFormatter.cs (4)
26protected virtual object? GetDefaultValueForType(Type modelType) 84/// <param name="type">The <see cref="Type"/> of object that will be read.</param> 86protected virtual bool CanReadType(Type type) 121public virtual IReadOnlyList<string>? GetSupportedContentTypes(string contentType, Type objectType)
Formatters\OutputFormatter.cs (2)
26protected virtual bool CanWriteType(Type? type) 34Type objectType)
Formatters\SystemTextJsonInputFormatter.cs (1)
148public static void JsonInputSuccess(ILogger logger, Type modelType)
Formatters\SystemTextJsonOutputFormatter.cs (1)
79var runtimeType = context.Object?.GetType();
Infrastructure\ActionMethodExecutor.cs (2)
359var type = executor.AsyncResultType ?? executor.MethodReturnType; 364private static IActionResult ConvertToActionResult(IActionResultTypeMapper mapper, object? returnValue, Type declaredType)
Infrastructure\ActionResultTypeMapper.cs (3)
12public Type GetResultDataType(Type returnType) 25public IActionResult Convert(object? value, Type returnType)
Infrastructure\AsyncEnumerableReader.cs (3)
34private readonly ConcurrentDictionary<Type, Func<object, CancellationToken, Task<ICollection>>?> _asyncEnumerableConverters = new(); 52public bool TryGetReader(Type type, [NotNullWhen(true)] out Func<object, CancellationToken, Task<ICollection>>? reader) 65var enumeratedObjectType = enumerableType.GetGenericArguments()[0];
Infrastructure\ClientErrorResultFilter.cs (2)
61public static partial void TransformingClientError(ILogger logger, Type initialActionResultType, Type replacedActionResultType, int? statusCode);
Infrastructure\ControllerActionInvoker.cs (2)
594var controllerType = context.ActionDescriptor.ControllerTypeInfo.AsType(); 609var controllerType = context.ActionDescriptor.ControllerTypeInfo.AsType();
Infrastructure\IActionResultTypeMapper.cs (4)
26/// <returns>A <see cref="Type"/> that represents the response data.</returns> 31Type GetResultDataType(Type returnType); 45IActionResult Convert(object? value, Type returnType);
Infrastructure\ITypeActivatorCache.cs (4)
10/// <see cref="Extensions.DependencyInjection.ActivatorUtilities.CreateFactory(Type, Type[])"/>. 19/// <param name="optionType">The <see cref="Type"/> of the <typeparamref name="TInstance"/> to create.</param> 20TInstance CreateInstance<TInstance>(IServiceProvider serviceProvider, Type optionType);
Infrastructure\MvcCoreMvcOptionsSetup.cs (2)
111modelMetadataDetailsProviders.Add(new ExcludeBindingMetadataProvider(typeof(Type))); 123modelMetadataDetailsProviders.Add(new SuppressChildValidationMetadataProvider(typeof(Type)));
Infrastructure\ObjectResultExecutor.cs (2)
72var objectType = result.DeclaredType; 83private Task ExecuteAsyncCore(ActionContext context, ObjectResult result, Type? objectType, object? value)
Infrastructure\ResourceInvoker.Log.cs (3)
50var controllerType = controllerActionDescriptor.ControllerTypeInfo.AsType(); 83private static partial void BeforeExecutingActionResult(ILogger logger, Type actionResult); 91private static partial void AfterExecutingActionResult(ILogger logger, Type actionResult);
Infrastructure\SystemTextJsonResultExecutor.cs (1)
61var objectType = value?.GetType() ?? typeof(object);
Infrastructure\TypeActivatorCache.cs (7)
11/// <see cref="ActivatorUtilities.CreateFactory(Type, Type[])"/>. 15private readonly Func<Type, ObjectFactory> _createFactory = 16(type) => ActivatorUtilities.CreateFactory(type, Type.EmptyTypes); 17private readonly ConcurrentDictionary<Type, ObjectFactory> _typeActivatorCache = 18new ConcurrentDictionary<Type, ObjectFactory>(); 23Type implementationType)
ModelBinderAttribute.cs (4)
30private Type? _binderType; 42/// <param name="binderType">A <see cref="Type"/> which implements <see cref="IModelBinder"/>.</param> 47public ModelBinderAttribute(Type binderType) 59public Type? BinderType
ModelBinderOfTAttribute.cs (1)
9/// <typeparam name="TBinder">A <see cref="Type"/> which implements <see cref="IModelBinder"/>.</typeparam>
ModelBinding\Binders\ArrayModelBinder.cs (3)
86public override bool CanCreateInstance(Type targetType) 92protected override object CreateEmptyCollection(Type targetType) 100protected override object? ConvertToCollectionType(Type targetType, IEnumerable<TElement?> collection)
ModelBinding\Binders\ArrayModelBinderProvider.cs (2)
24var elementType = context.Metadata.ElementMetadata!.ModelType; 25var binderType = typeof(ArrayModelBinder<>).MakeGenericType(elementType);
ModelBinding\Binders\BinderTypeModelBinder.cs (3)
22/// <param name="binderType">The <see cref="Type"/> of the <see cref="IModelBinder"/>.</param> 23public BinderTypeModelBinder(Type binderType) 36_factory = ActivatorUtilities.CreateFactory(binderType, Type.EmptyTypes);
ModelBinding\Binders\BinderTypeModelBinderProvider.cs (1)
19if (context.BindingInfo.BinderType is Type binderType)
ModelBinding\Binders\CollectionModelBinder.cs (7)
191public virtual bool CanCreateInstance(Type targetType) 229/// <param name="targetType"><see cref="Type"/> of the model.</param> 232protected virtual object CreateEmptyCollection(Type targetType) 246/// <param name="targetType"><see cref="Type"/> of the model.</param> 248protected object CreateInstance(Type targetType) 428/// <param name="targetType"><see cref="Type"/> of the model.</param> 440protected virtual object? ConvertToCollectionType(Type targetType, IEnumerable<TElement?> collection)
ModelBinding\Binders\CollectionModelBinderProvider.cs (5)
23var modelType = context.Metadata.ModelType; 44var listType = typeof(List<>).MakeGenericType(enumerableType.GenericTypeArguments); 54private static IModelBinder CreateInstance(ModelBinderProviderContext context, Type collectionType) 56var binderType = typeof(CollectionModelBinder<>).MakeGenericType(collectionType.GenericTypeArguments); 57var elementType = collectionType.GenericTypeArguments[0];
ModelBinding\Binders\ComplexObjectModelBinder.cs (5)
190var modelType = bindingContext.ModelType; 191if (modelType.IsAbstract || modelType.GetConstructor(Type.EmptyTypes) == null) 658internal static bool CanUpdateReadOnlyProperty(Type propertyType) 738public static partial void NoPublicSettableItems(ILogger logger, string modelName, Type modelType); 749private static partial void CannotBindToComplexType(ILogger logger, Type modelType);
ModelBinding\Binders\ComplexTypeModelBinder.cs (5)
428private static bool CanUpdateReadOnlyProperty(Type propertyType) 471var modelType = bindingContext.ModelType; 472if (modelType.IsAbstract || modelType.GetConstructor(Type.EmptyTypes) == null) 578private static partial void NoPublicSettableProperties(ILogger logger, string modelName, Type modelType); 584private static partial void CannotBindToComplexType(ILogger logger, Type modelType);
ModelBinding\Binders\DateTimeModelBinder.cs (1)
54var type = metadata.UnderlyingOrModelType;
ModelBinding\Binders\DateTimeModelBinderProvider.cs (1)
24var modelType = context.Metadata.UnderlyingOrModelType;
ModelBinding\Binders\DecimalModelBinder.cs (1)
56var type = metadata.UnderlyingOrModelType;
ModelBinding\Binders\DictionaryModelBinder.cs (3)
222Type targetType, 240protected override object CreateEmptyCollection(Type targetType) 252public override bool CanCreateInstance(Type targetType)
ModelBinding\Binders\DictionaryModelBinderProvider.cs (2)
23var modelType = context.Metadata.ModelType; 27var binderType = typeof(DictionaryModelBinder<,>).MakeGenericType(dictionaryType.GenericTypeArguments);
ModelBinding\Binders\DoubleModelBinder.cs (1)
56var type = metadata.UnderlyingOrModelType;
ModelBinding\Binders\EnumTypeModelBinder.cs (2)
29Type modelType, 60var modelType = bindingContext.ModelMetadata.UnderlyingOrModelType;
ModelBinding\Binders\FloatingPointTypeModelBinderProvider.cs (1)
27var modelType = context.Metadata.UnderlyingOrModelType;
ModelBinding\Binders\FloatModelBinder.cs (1)
56var type = metadata.UnderlyingOrModelType;
ModelBinding\Binders\FormCollectionModelBinderProvider.cs (1)
23var modelType = context.Metadata.ModelType;
ModelBinding\Binders\FormFileModelBinder.cs (1)
102var modelType = bindingContext.ModelType;
ModelBinding\Binders\FormFileModelBinderProvider.cs (1)
24var modelType = context.Metadata.ModelType;
ModelBinding\Binders\HeaderModelBinderProvider.cs (1)
68public static partial void CannotCreateHeaderModelBinder(ILogger logger, Type modelType);
ModelBinding\Binders\KeyValuePairModelBinderProvider.cs (2)
21var modelType = context.Metadata.ModelType; 33var binderType = typeof(KeyValuePairModelBinder<,>).MakeGenericType(typeArguments);
ModelBinding\Binders\SimpleTypeModelBinder.cs (1)
25public SimpleTypeModelBinder(Type type, ILoggerFactory loggerFactory)
ModelBinding\Binders\TryParseModelBinder.cs (2)
33public TryParseModelBinder(Type modelType, ILoggerFactory loggerFactory) 107private static Func<ValueProviderResult, ModelBindingContext, object?> CreateTryParseOperation(Type modelType)
ModelBinding\DefaultModelBindingContext.cs (1)
288var rootModelType = states[states.Length - 1].ModelMetadata.ModelType;
ModelBinding\ICollectionModelBinder.cs (2)
17/// <param name="targetType"><see cref="Type"/> of the model.</param> 25bool CanCreateInstance(Type targetType);
ModelBinding\Metadata\BindingMetadata.cs (4)
17private Type? _binderType; 33/// Gets or sets the <see cref="Type"/> of the <see cref="IModelBinder"/> implementation used to bind the 40public Type? BinderType 76/// of the property accessor and model <see cref="Type"/>. See <see cref="ModelMetadata.IsReadOnly"/>.
ModelBinding\Metadata\BindingSourceMetadataProvider.cs (2)
23public BindingSourceMetadataProvider(Type type, BindingSource? bindingSource) 35public Type Type { get; }
ModelBinding\Metadata\DefaultBindingMetadataProvider.cs (3)
80internal static ConstructorInfo? GetBoundConstructor(Type type) 96private static ConstructorInfo? GetRecordTypeConstructor(Type type, ConstructorInfo[] constructors) 140static bool IsRecordType(Type type)
ModelBinding\Metadata\DefaultModelMetadata.cs (3)
173public override Type? BinderType => BindingMetadata.BinderType; 559public override ModelMetadata GetMetadataForType(Type modelType) 565public override IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType)
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (22)
72public override IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType) 103public override ModelMetadata GetMetadataForParameter(ParameterInfo parameter, Type modelType) 114public override ModelMetadata GetMetadataForType(Type modelType) 124public override ModelMetadata GetMetadataForProperty(PropertyInfo propertyInfo, Type modelType) 135public override ModelMetadata GetMetadataForConstructor(ConstructorInfo constructorInfo, Type modelType) 150private ModelMetadataCacheEntry GetCacheEntry(Type modelType) 169private ModelMetadataCacheEntry GetCacheEntry(ParameterInfo parameter, Type modelType) 176private ModelMetadataCacheEntry GetCacheEntry(PropertyInfo property, Type modelType) 183private ModelMetadataCacheEntry GetCacheEntry(ConstructorInfo constructor, Type modelType) 236var parameterTypes = new Type[parameters.Length]; 274var parameterType = constructorParameter.ParameterType; 322/// <see cref="Type"/>. 325/// The <see cref="ModelMetadataIdentity"/> identifying the model <see cref="Type"/>. 327/// <returns>A details object for each property of the model <see cref="Type"/>.</returns> 330/// <see cref="GetMetadataForProperties(Type)"/>. Override this method to provide a different 359var containerType = propertyKey.ContainerType!; 384/// Creates the <see cref="DefaultMetadataDetails"/> entry for a model <see cref="Type"/>. 387/// The <see cref="ModelMetadataIdentity"/> identifying the model <see cref="Type"/>. 389/// <returns>A details object for the model <see cref="Type"/>.</returns> 392/// <see cref="GetMetadataForType(Type)"/>. Override this method to provide a different 403/// Creates the <see cref="DefaultMetadataDetails"/> entry for a parameter <see cref="Type"/>. 406/// The <see cref="ModelMetadataIdentity"/> identifying the parameter <see cref="Type"/>.
ModelBinding\Metadata\ExcludeBindingMetadataProvider.cs (4)
14private readonly Type _type; 20/// The <see cref="Type"/>. All properties with this <see cref="Type"/> will have 23public ExcludeBindingMetadataProvider(Type type)
ModelBinding\Metadata\MetadataDetailsProviderExtensions.cs (1)
30public static void RemoveType(this IList<IMetadataDetailsProvider> list, Type type)
ModelBinding\Metadata\ModelAttributes.cs (22)
12/// Provides access to the combined list of attributes associated with a <see cref="Type"/>, property, or parameter. 31/// If this instance represents a property, the set of attributes for the property's <see cref="Type"/>. 77/// on the property definition are before those on the property's <see cref="Type"/>. If this instance 79/// the parameter's <see cref="Type"/>. 96/// Gets the set of attributes on the <see cref="Type"/>. If this instance represents a property, then 106/// <param name="type">The <see cref="Type"/> in which caller found <paramref name="property"/>. 111/// A <see cref="ModelAttributes"/> instance with the attributes of the property and its <see cref="Type"/>. 113public static ModelAttributes GetAttributesForProperty(Type type, PropertyInfo property) 121/// <param name="containerType">The <see cref="Type"/> in which caller found <paramref name="property"/>. 127/// A <see cref="ModelAttributes"/> instance with the attributes of the property and its <see cref="Type"/>. 129public static ModelAttributes GetAttributesForProperty(Type containerType, PropertyInfo property, Type modelType) 137var metadataType = GetMetadataType(containerType); 153/// <param name="type">The <see cref="Type"/> for which attributes need to be resolved. 155/// <returns>A <see cref="ModelAttributes"/> instance with the attributes of the <see cref="Type"/>.</returns> 156public static ModelAttributes GetAttributesForType(Type type) 162var metadataType = GetMetadataType(type); 178/// A <see cref="ModelAttributes"/> instance with the attributes of the parameter and its <see cref="Type"/>. 199/// A <see cref="ModelAttributes"/> instance with the attributes of the parameter and its <see cref="Type"/>. 201public static ModelAttributes GetAttributesForParameter(ParameterInfo parameterInfo, Type modelType) 215private static Type? GetMetadataType(Type type)
ModelBinding\Metadata\ValidationMetadata.cs (1)
18/// <see cref="ModelMetadata.IsRequired"/> will be computed based on the model <see cref="System.Type"/>.
ModelBinding\ModelBinderProviderExtensions.cs (1)
30public static void RemoveType(this IList<IModelBinderProvider> list, Type type)
ModelBinding\ModelBindingHelper.cs (16)
164Type modelType, 205Type modelType, 360/// <param name="modelType">The <see cref="Type"/> of the model.</param> 365Type modelType, 461var modelType = bindingContext.ModelType; 545var modelType = bindingContext.ModelType; 587/// Converts the provided <paramref name="value"/> to a value of <see cref="Type"/> <typeparamref name="T"/>. 589/// <typeparam name="T">The <see cref="Type"/> for conversion.</typeparam> 603/// Converts the provided <paramref name="value"/> to a value of <see cref="Type"/> <paramref name="type"/>. 606/// <param name="type">The <see cref="Type"/> for conversion.</param> 611public static object? ConvertTo(object? value, Type type, CultureInfo? culture) 630private static object? UnwrapPossibleArrayType(object value, Type destinationType, CultureInfo culture) 636var destinationElementType = destinationType.GetElementType()!; 676private static object? ConvertSimpleType(object? value, Type destinationType, CultureInfo culture) 746private static Type UnwrapNullableType(Type destinationType)
ModelBinding\ModelMetadataProviderExtensions.cs (2)
20/// <param name="containerType">The <see cref="Type"/> for which the property is defined.</param> 25Type containerType,
ModelBinding\ParameterBinder.cs (1)
248var modelType = modelBindingResult.Model.GetType();
ModelBinding\ParameterBinder.Log.cs (13)
56private static partial void AttemptingToBindParameter(ILogger logger, string? parameterName, Type modelType); 59private static partial void AttemptingToBindProperty(ILogger logger, Type? propertyContainerType, string? propertyName, Type modelType); 102private static partial void DoneAttemptingToBindParameter(ILogger logger, string? parameterName, Type modelType); 105private static partial void DoneAttemptingToBindProperty(ILogger logger, Type? propertyContainerType, string? propertyName, Type modelType); 149private static partial void AttemptingToValidateParameter(ILogger logger, string? parameterName, Type modelType); 152private static partial void AttemptingToValidateProperty(ILogger logger, Type? propertyContainerType, string? propertyName, Type modelType); 199private static partial void DoneAttemptingToValidateParameter(ILogger logger, string? parameterName, Type modelType); 202private static partial void DoneAttemptingToValidateProperty(ILogger logger, Type? propertyContainerType, string? propertyName, Type modelType); 248private static partial void ParameterBinderRequestPredicateShortCircuitOfProperty(ILogger logger, Type? propertyContainerType, string? propertyName);
ModelBinding\SuppressChildValidationMetadataProvider.cs (3)
24public SuppressChildValidationMetadataProvider(Type type) 48public Type? Type { get; } 83private bool IsMatchingName(Type? type)
ModelBinding\Validation\DefaultCollectionValidationStrategy.cs (2)
49private readonly ConcurrentDictionary<Type, Func<object, IEnumerator>> _genericGetEnumeratorCache = new ConcurrentDictionary<Type, Func<object, IEnumerator>>();
ModelBinding\Validation\DefaultModelValidatorProvider.cs (1)
39public bool HasValidators(Type modelType, IList<object> validatorMetadata)
ModelBinding\Validation\IMetadataBasedModelValidatorProvider.cs (2)
25/// <param name="modelType">The <see cref="Type"/> of the model.</param> 28bool HasValidators(Type modelType, IList<object> validatorMetadata);
ModelBinding\Validation\ModelValidatorProviderExtensions.cs (1)
30public static void RemoveType(this IList<IModelValidatorProvider> list, Type type)
ModelBinding\Validation\ShortFormDictionaryValidationStrategy.cs (2)
13/// <typeparam name="TKey">The <see cref="Type"/> of the keys of the model dictionary.</typeparam> 14/// <typeparam name="TValue">The <see cref="Type"/> of the values of the model dictionary.</typeparam>
ModelBinding\ValueProviderFactoryExtensions.cs (1)
30public static void RemoveType(this IList<IValueProviderFactory> list, Type type)
ModelMetadataTypeAttribute.cs (2)
16public ModelMetadataTypeAttribute(Type type) 26public Type MetadataType { get; }
MvcCoreLoggerExtensions.cs (13)
150private static partial void FoundNoValueForPropertyInRequest(ILogger logger, string modelName, Type? propertyContainerType, string? modelFieldName, Type modelType); 155private static partial void FoundNoValueForParameterInRequest(ILogger logger, string modelName, string? modelFieldName, Type modelType); 158private static partial void FoundNoValueInRequest(ILogger logger, string modelName, Type modelType); 166private static partial void CannotBindToFilesCollectionDueToUnsupportedContentType(ILogger logger, string modelName, Type modelType); 200private static partial void AttemptingToBindParameterModel(ILogger logger, string? parameterName, Type modelType, string modelName); 203private static partial void AttemptingToBindPropertyModel(ILogger logger, Type? propertyContainerType, string? propertyName, Type modelType, string modelName); 206private static partial void AttemptingToBindModel(ILogger logger, Type modelType, string modelName); 238private static partial void DoneAttemptingToBindPropertyModel(ILogger logger, Type? propertyContainerType, string? propertyName, Type modelType); 241private static partial void DoneAttemptingToBindModel(ILogger logger, Type modelType, string modelName); 244private static partial void DoneAttemptingToBindParameterModel(ILogger logger, string? parameterName, Type modelType);
ObjectResult.cs (1)
52public Type? DeclaredType { get; set; }
ProducesAttribute.cs (3)
14/// A filter that specifies the expected <see cref="System.Type"/> the action will return and the supported 25public ProducesAttribute(Type type) 53public Type? Type { get; set; }
ProducesDefaultResponseTypeAttribute.cs (3)
10/// A filter that specifies the <see cref="System.Type"/> for all HTTP status codes that are not covered by <see cref="ProducesResponseTypeAttribute"/>. 27public ProducesDefaultResponseTypeAttribute(Type type) 35public Type Type { get; }
ProducesErrorResponseTypeAttribute.cs (2)
25public ProducesErrorResponseTypeAttribute(Type type) 33public Type Type { get; }
ProducesOfTAttribute.cs (1)
7/// <typeparam name="T">The <see cref="Type"/> of object that is going to be written in the response.</typeparam>
ProducesResponseTypeAttribute.cs (3)
34public ProducesResponseTypeAttribute(Type type, int statusCode) 48public ProducesResponseTypeAttribute(Type type, int statusCode, string contentType, params string[] additionalContentTypes) 68public Type Type { get; set; }
ProducesResponseTypeOfTAttribute.cs (1)
7/// <typeparam name="T">The <see cref="Type"/> of object that is going to be written in the response.</typeparam>
Routing\ControllerActionEndpointDataSource.cs (1)
134internal void AddDynamicControllerEndpoint(IEndpointRouteBuilder endpoints, string pattern, Type transformerType, object? state, int? order = null)
Routing\DynamicControllerRouteValueTransformerMetadata.cs (2)
10public DynamicControllerRouteValueTransformerMetadata(Type selectorType, object? state) 27public Type SelectorType { get; }
ServiceFilterAttribute.cs (4)
29/// <param name="type">The <see cref="Type"/> of filter to find.</param> 30public ServiceFilterAttribute(Type type) 39/// Gets the <see cref="Type"/> of filter to find. 41public Type ServiceType { get; }
ServiceFilterOfTAttribute.cs (1)
10/// <typeparam name="TFilter">The <see cref="Type"/> of filter to find.</typeparam>
src\Shared\EndpointMetadataPopulator.cs (1)
49var returnType = methodInfo.ReturnType;
src\Shared\Json\JsonSerializerExtensions.cs (3)
16public static bool ShouldUseWith(this JsonTypeInfo jsonTypeInfo, [NotNullWhen(false)] Type? runtimeType) 19public static JsonTypeInfo GetReadOnlyTypeInfo(this JsonSerializerOptions options, Type type) 25public static JsonTypeInfo GetRequiredTypeInfo(this JsonSerializerContext context, Type type)
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (9)
20public Type AwaiterType { get; } 25public Type ResultType { get; } 29Type awaiterType, 34Type resultType, 48Type type, 54var getAwaiterMethod = type.GetMethod("GetAwaiter", Everything, Type.EmptyTypes); 62var awaiterType = getAwaiterMethod.ReturnType; 65var isCompletedProperty = awaiterType.GetProperty("IsCompleted", Everything, binder: null, returnType: typeof(bool), types: Type.EmptyTypes, modifiers: null); 93var getResultMethod = awaiterType.GetMethod("GetResult", Everything, Type.EmptyTypes);
src\Shared\ObjectMethodExecutor\CoercedAwaitableInfo.cs (5)
15public Type CoercerResultType { get; } 25public CoercedAwaitableInfo(Expression coercerExpression, Type coercerResultType, AwaitableInfo coercedAwaitableInfo) 35[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type, 43out var nonGenericAwaitableType)) 61out var coercerResultType))
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (9)
68var isAwaitable = IsTaskType(MethodReturnType, out var resultType); 96public Type? AsyncResultType { get; } 99public Type MethodReturnType { get; internal set; } 281var postCoercionMethodReturnType = coercedAwaitableInfo.CoercerResultType ?? methodInfo.ReturnType; 398private static bool IsTaskType(Type methodReturnType, [NotNullWhen(true)] out Type? resultType) 412var currentType = methodReturnType; 437private static MethodExecutorAsync? GetExecutorAsyncTrimAotCompatible(MethodInfo methodInfo, Type asyncResultType) 439var methodReturnType = methodInfo.ReturnType;
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (20)
59Type possibleFSharpAsyncType, 61out Type awaitableType) 63var methodReturnGenericType = possibleFSharpAsyncType.IsGenericType 74var awaiterResultType = possibleFSharpAsyncType.GetGenericArguments().Single(); 98TryBuildCoercerFromUnitAwaitableToVoidAwaitable(awaitableType, out var coercerExpression, out var nonGenericAwaitableType) 132Type genericAwaitableType, 134out Type nonGenericAwaitableType) 152static Expression MakeTaskOfUnitToTaskExpression(Type type) 158static Expression MakeValueTaskOfUnitToValueTaskExpression(Type type) 172private static bool IsFSharpAsyncOpenGenericType(Type possibleFSharpAsyncType) => 176private static bool IsFSharpUnit(Type possibleFSharpUnitType) => 180private static bool IsCoerceableFSharpType(Type possibleFSharpType, string coerceableFSharpTypeName) 206private static bool TryPopulateFSharpValueCaches(Type possibleFSharpType) 209var fsharpOptionType = assembly.GetType(FSharpOptionTypeName); 210var fsharpAsyncType = assembly.GetType(FSharpAsyncTypeName); 211var fsharpAsyncGenericType = assembly.GetType(FSharpAsyncGenericTypeName); 219var fsharpOptionOfTaskCreationOptionsType = fsharpOptionType 225var fsharpOptionOfCancellationTokenType = fsharpOptionType 252private static bool TypesHaveSameIdentity(Type type1, Type type2)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (2)
47Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType); 87private static object? CreateValueType(Type t) => RuntimeHelpers.GetUninitializedObject(t);
src\Shared\PropertyActivator\PropertyActivator.cs (7)
38Type type, 39Type activateAttributeType, 50Type type, 51Type activateAttributeType, 64Type type, 81Type type, 82Type activateAttributeType,
src\Shared\PropertyHelper\PropertyHelper.cs (21)
41private static readonly ConcurrentDictionary<Type, PropertyHelper[]> PropertiesCache = new(); 43private static readonly ConcurrentDictionary<Type, PropertyHelper[]> VisiblePropertiesCache = new(); 50/// This constructor does not cache the helper. For caching, use <see cref="GetProperties(Type)"/>. 123[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 144[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 244Type openGenericDelegateType, 248var typeInput = propertyGetMethod.DeclaringType!; 249var typeOutput = propertyGetMethod.ReturnType; 251var delegateType = openGenericDelegateType.MakeGenericType(typeInput, typeOutput); 290var typeInput = setMethod.DeclaringType!; 291var parameterType = parameters[0].ParameterType; 412Type type, 413ConcurrentDictionary<Type, PropertyHelper[]>? allPropertiesCache, 414ConcurrentDictionary<Type, PropertyHelper[]>? visiblePropertiesCache) 444var declaringType = propertyHelper.Property.DeclaringType; 457Type? currentType = type; 493Type type, 494ConcurrentDictionary<Type, PropertyHelper[]>? cache) 509foreach (var @interface in type.GetInterfaces()) 523[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 562public static void ClearCache(Type[]? _)
TypeFilterAttribute.cs (5)
33/// <param name="type">The <see cref="Type"/> of filter to create.</param> 34public TypeFilterAttribute(Type type) 49/// Gets the <see cref="Type"/> of filter to create. 51public Type ImplementationType { get; } 67_factory = ActivatorUtilities.CreateFactory(ImplementationType, argumentTypes ?? Type.EmptyTypes);
TypeFilterOfTAttribute.cs (1)
9/// <typeparam name="TFilter">The <see cref="Type"/> of filter to create.</typeparam>
Microsoft.AspNetCore.Mvc.Core.Test (318)
AcceptedAtActionResultTests.cs (1)
290public object GetService(Type serviceType) => new ForwardingUrlHelperFactory();
ApiConventionMethodAttributeTest.cs (12)
16var attribute = typeof(ProducesAttribute); 38var attribute = typeof(ProducesAttribute); 62var type = typeof(ConventionWithNullableContextAttribute); 69var attributeType = a.GetType(); 79var attribute = typeof(ProducesAttribute); 89var attribute = typeof(ProducesAttribute); 90var type = typeof(TestConventions); 106var attribute = typeof(ProducesAttribute); 107var type = typeof(TestConventions); 123var attribute = typeof(ProducesAttribute); 124var type = typeof(TestConventions); 144private static string GetErrorMessage(string methodName, params Type[] attributes)
ApiExplorer\ApiConventionMatcherTest.cs (10)
265public void IsTypeMatch_WithAny_ReturnsTrue(Type type, Type conventionType) 278var type = typeof(Base); 279var conventionType = typeof(Base); 292var type = typeof(Derived); 293var conventionType = typeof(Base); 306var type = typeof(Base); 307var conventionType = typeof(Derived); 320var type = typeof(string); 321var conventionType = typeof(Derived);
ApplicationModels\ApiConventionApplicationModelConventionTest.cs (6)
65var expected = typeof(InvalidFilterCriteriaException); 85var expected = typeof(InvalidEnumArgumentException); 101var expected = typeof(InvalidTimeZoneException); 119var expected = typeof(InvalidTimeZoneException); 138var expected = typeof(void); 150private ApiConventionApplicationModelConvention GetConvention(Type errorType = null)
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (4)
25var controllerType = typeof(AccountController); 43var controllerType = typeof(AnonymousController); 61var controllerType = typeof(AccountController); 206private static ApplicationModelProviderContext CreateProviderContext(Type controllerType)
ApplicationModels\ConsumesConstraintForFormFileParameterConventionTest.cs (2)
57Type type, 69private static ActionModel GetActionModel(Type controllerType, string actionName)
ApplicationModels\ControllerActionDescriptorProviderTests.cs (2)
981public void ApiExplorer_DoesNotSetExtensionData_WhenNotVisible(Type controllerType) 1092public void ApiExplorer_ThrowsForConventionalRouting(string actionName, Type type)
ApplicationModels\DefaultApplicationModelProviderTest.cs (2)
1000public void CreateActionModel_RouteAttributeOnController_CreatesAttributeRoute_ForNonAttributedActions(Type controller) 1023public void CreateActionModel_RouteOnController_CreatesOneActionInfoPerRouteTemplateOnAction(Type controller)
ApplicationModels\EndpointMetadataProviderTest.cs (5)
32public void DiscoversEndpointMetadata_FromReturnTypeImplementingIEndpointMetadataProvider(Type controllerType, string actionName) 141public void AllowsRemovalOfMetadata_ByReturnTypeImplementingIEndpointMetadataProvider(Type controllerType, string actionName) 215private Endpoint GetEndpoint(Type controllerType, string actionName) => Assert.Single(GetEndpoints(controllerType, actionName)); 216private List<Endpoint> GetEndpoints(Type controllerType, string actionName) => FilterEndpoints(GetEndpointDataSource(controllerType, actionName).Endpoints); 235private ControllerActionEndpointDataSource GetEndpointDataSource(Type controllerType, string actionName)
ApplicationModels\InferParameterBindingInfoConventionTest.cs (5)
904serviceProviderIsService = serviceProviderIsService ?? Mock.Of<IServiceProviderIsService>(s => s.IsService(It.IsAny<Type>()) == false); 909Type type, 922Type controllerType, 931private static ParameterModel GetParameterModel(Type controllerType, string actionName) 1131public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
ApplicationParts\RelatedAssemblyPartTest.cs (1)
93public override object[] GetCustomAttributes(Type attributeType, bool inherit)
Controllers\ControllerBinderDelegateProviderTest.cs (4)
903public static TheoryData<string, Type, Func<object, object>, object, object> SkippedPropertyData 907return new TheoryData<string, Type, Func<object, object>, object, object> 945Type propertyType, 990var boundPropertyTypes = new Dictionary<string, Type>
Controllers\ControllerFeatureProviderTest.cs (2)
264public void AncestorTypeHasControllerAttribute_IsController(Type type) 370public void IsController_ReturnsFalse_IfTypeOrAncestorHasNonControllerAttribute(Type type)
Controllers\DefaultControllerActivatorTest.cs (1)
19public void Create_CreatesInstancesOfTypes(Type type)
DependencyInjection\ApplicationModelConventionExtensionsTest.cs (1)
17var controllerType = typeof(HelloController);
DependencyInjection\MvcBuilderExtensionsTest.cs (1)
45new[] { typeof(Type) }),
DependencyInjection\MvcCoreBuilderExtensionsTest.cs (1)
42new[] { typeof(Type) }),
DependencyInjection\MvcCoreServiceCollectionExtensionsTest.cs (27)
39var mockType = typeof(Mock<>).MakeGenericType(serviceType.Key); 51foreach (var implementationType in serviceType.Value) 65foreach (var serviceType in SingleRegistrationServiceTypes) 67var mockType = typeof(Mock<>).MakeGenericType(serviceType); 75foreach (var singleRegistrationType in SingleRegistrationServiceTypes) 214private IEnumerable<Type> SingleRegistrationServiceTypes 228private Dictionary<Type, Type[]> MultiRegistrationServiceTypes 232return new Dictionary<Type, Type[]>() 236new Type[] 243new Type[] 250new Type[] 257new Type[] 264new Type[] 271new Type[] 278new Type[] 285new Type[] 292new Type[] 299new Type[] 306new Type[] 314new Type[] 321new Type[] 329new Type[] 340Type serviceType, 354Type serviceType, 355Type implementationType)
Filters\MiddlewareFilterConfigurationProviderTest.cs (3)
18public void CreateConfigureDelegate_ThrowsIfTypeCannotBeInstantiated(Type configurationType) 65var type = typeof(InvalidType_NoConfigure); 81var type = typeof(InvalidType_NoPublic_Configure);
Filters\MiddlewareFilterTest.cs (1)
319private RequestDelegate GetMiddlewarePipeline(Type middlewarePipelineProviderType)
Formatters\InputFormatterTest.cs (3)
442public IList<Type> SupportedTypes { get; } = new List<Type>(); 444protected override bool CanReadType(Type type)
Formatters\JsonInputFormatterTestBase.cs (2)
287protected async Task ReadAsync_ReadsValidArray_AsList(Type requestedType) 649Type modelType,
Formatters\JsonOutputFormatterTestBase.cs (1)
176Type outputType,
Formatters\NoContentFormatterTests.cs (2)
38var type = declaredTypeAsString ? typeof(string) : typeof(object); 62public void CanWriteResult_ReturnsTrue_IfReturnTypeIsVoidOrTask(Type declaredType)
Formatters\OutputFormatterTests.cs (3)
189public List<Type> SupportedTypes { get; } = new List<Type>(); 191protected override bool CanWriteType(Type type)
Formatters\StreamOutputFormatterTest.cs (3)
14public void CanWriteResult_ReturnsTrue_ForStreams(Type type, string contentType) 39public void CanWriteResult_OnlyActsOnStreams_IgnoringContentType(Type type, string contentType) 65public void CanWriteResult_OnlyActsOnStreams(Type type)
Formatters\StringOutputFormatterTests.cs (1)
89var type = useDeclaredTypeAsString ? typeof(string) : typeof(object);
Formatters\SystemTextJsonInputFormatterTest.cs (2)
223public override short Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 236public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Formatters\SystemTextJsonOutputFormatterTest.cs (1)
324public override ThrowingFormatterModel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Formatters\TextInputFormatterTest.cs (3)
214public IList<Type> SupportedTypes { get; } = new List<Type>(); 216protected override bool CanReadType(Type type)
Infrastructure\ActionMethodExecutorTest.cs (1)
452var type = typeof(TestController);
Infrastructure\ActionResultTypeMapperTest.cs (4)
81var returnType = typeof(ActionResult<string>); 84var result = mapper.GetResultDataType(returnType); 96var returnType = typeof(string); 99var result = mapper.GetResultDataType(returnType);
Infrastructure\AsyncEnumerableReaderTest.cs (1)
15public void TryGetReader_ReturnsFalse_IfTypeIsNotIAsyncEnumerable(Type type)
Infrastructure\ControllerActionInvokerTest.cs (1)
1356public async Task InvokeAction_WithNullActionResultThrows(string methodName, Type resultType)
Infrastructure\SystemTextJsonResultExecutorTest.cs (1)
49public override ThrowingFormatterModel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
ModelBinding\Binders\ArrayModelBinderProviderTest.cs (2)
14public void Create_ForNonArrayTypes_ReturnsNull(Type modelType) 32public void Create_ForArrayTypes_ReturnsBinder(Type modelType)
ModelBinding\Binders\BinderTypeModelBinderTest.cs (2)
68private static DefaultModelBindingContext GetBindingContext(Type modelType, Type binderType = null)
ModelBinding\Binders\BodyModelBinderTests.cs (2)
675Type modelType, 734protected override bool CanReadType(Type type)
ModelBinding\Binders\ByteArrayModelBinderProviderTest.cs (1)
13public void Create_ForNonByteArrayTypes_ReturnsNull(Type modelType)
ModelBinding\Binders\ByteArrayModelBinderTests.cs (1)
103private static DefaultModelBindingContext GetBindingContext(IValueProvider valueProvider, Type modelType)
ModelBinding\Binders\CancellationTokenModelBinderProviderTest.cs (1)
13public void Create_ForNonCancellationTokenTypes_ReturnsNull(Type modelType)
ModelBinding\Binders\CancellationTokenModelBinderTests.cs (1)
26private static DefaultModelBindingContext GetBindingContext(Type modelType)
ModelBinding\Binders\CollectionModelBinderProviderTest.cs (3)
16public void Create_ForNonSupportedTypes_ReturnsNull(Type modelType) 43public void Create_ForSupportedTypes_ReturnsBinder(Type modelType) 50Type elementType = null;
ModelBinding\Binders\CollectionModelBinderTest.cs (3)
422public static TheoryData<Type, bool> CanCreateInstanceData 426return new TheoryData<Type, bool> 440public void CanCreateInstance_ReturnsExpectedValue(Type modelType, bool expectedResult)
ModelBinding\Binders\ComplexObjectModelBinderProviderTest.cs (1)
14public void Create_ForNonComplexType_ReturnsNull(Type modelType)
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (7)
153Type modelType, 181Type modelType, 207Type modelType, 244Type modelType, 978var type = model.GetType(); 1122private static ModelMetadata GetMetadataForType(Type type) 1127private static ModelMetadata GetMetadataForProperty(Type type, string propertyName)
ModelBinding\Binders\ComplexTypeModelBinderProviderTest.cs (1)
14public void Create_ForNonComplexType_ReturnsNull(Type modelType)
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (7)
152Type modelType, 180Type modelType, 206Type modelType, 243Type modelType, 1140var type = model.GetType(); 1286private static ModelMetadata GetMetadataForType(Type type) 1291private static ModelMetadata GetMetadataForProperty(Type type, string propertyName)
ModelBinding\Binders\DateTimeModelBinderProviderTest.cs (1)
15public void Create_ForNonDateTime_ReturnsNull(Type modelType)
ModelBinding\Binders\DateTimeModelBinderTest.cs (2)
157public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid(Type type) 207private static DefaultModelBindingContext GetBindingContext(Type modelType = null)
ModelBinding\Binders\DictionaryModelBinderProviderTest.cs (2)
15public void Create_ForNonDictionaryType_ReturnsNull(Type modelType) 32public void Create_ForDictionaryType_ReturnsBinder(Type modelType)
ModelBinding\Binders\DictionaryModelBinderTest.cs (3)
586public static TheoryData<Type, bool> CanCreateInstanceData 590return new TheoryData<Type, bool> 605public void CanCreateInstance_ReturnsExpectedValue(Type modelType, bool expectedResult)
ModelBinding\Binders\EnumTypeModelBinderProviderTest.cs (3)
13public void ReturnsBinder_ForEnumType(Type modelType) 29public void ReturnsBinder_ForFlagsEnumType(Type modelType) 46public void DoesNotReturnBinder_ForNonEnumTypes(Type modelType)
ModelBinding\Binders\EnumTypeModelBinderTest.cs (13)
14public async Task BindModel_SetsModel_ForEmptyValue_AndNullableEnumTypes(Type modelType) 30public async Task BindModel_AddsErrorToModelState_ForEmptyValue_AndNonNullableEnumTypes(Type modelType) 53var modelType = typeof(IntEnum); 75var modelType = typeof(FlagsEnum); 99var modelType = typeof(FlagsEnum?); 133public async Task BindModel_AddsErrorToModelState_ForInvalidEnumValues(Type modelType, string suppliedValue) 161var modelType = typeof(FlagsEnum); 186var modelType = typeof(FlagsEnum?); 214Type modelType, 236Type modelType, 258private static Type GetUnderlyingType(Type modelType) 260var underlyingType = Nullable.GetUnderlyingType(modelType);
ModelBinding\Binders\FloatingPointTypeModelBinderProviderTest.cs (5)
15public void Create_ForCollectionOrComplexTypes_ReturnsNull(Type modelType) 35public void Create_ForUnsupportedSimpleTypes_ReturnsNull(Type modelType) 51public void Create_ForDecimalTypes_ReturnsBinder(Type modelType) 67public void Create_ForDoubleTypes_ReturnsBinder(Type modelType) 83public void Create_ForFloatTypes_ReturnsBinder(Type modelType)
ModelBinding\Binders\FloatingPointTypeModelBinderTestOfT.cs (16)
11public static TheoryData<Type> ConvertibleTypeData 15return new TheoryData<Type> 33public async Task BindModel_ReturnsFailure_IfAttemptedValueCannotBeParsed(Type destinationType) 52public async Task BindModel_CreatesError_IfAttemptedValueCannotBeParsed(Type destinationType) 77public async Task BindModel_CreatesError_IfAttemptedValueCannotBeCompletelyParsed(Type destinationType) 101public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedWhitespace(Type destinationType) 125public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedDecimal(Type destinationType) 149public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedThousandsSeparator(Type destinationType) 173public async Task BindModel_ReturnsFailed_IfValueProviderEmpty(Type destinationType) 237public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_Twelve(Type destinationType) 259public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_TwelvePointFive(Type destinationType) 280public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_FrenchTwelvePointFive(Type destinationType) 301public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_ThirtyTwoThousand(Type destinationType) 322public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_ThirtyTwoThousandPointOne(Type destinationType) 343public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_FrenchThirtyTwoThousandPointOne(Type destinationType) 369private static DefaultModelBindingContext GetBindingContext(Type modelType)
ModelBinding\Binders\FormCollectionModelBinderProviderTest.cs (2)
13public void Create_ThrowsException_ForFormCollectionModelType(Type modelType) 31public void Create_ForNonFormCollectionTypes_ReturnsNull(Type modelType)
ModelBinding\Binders\FormCollectionModelBinderTest.cs (1)
66private static DefaultModelBindingContext GetBindingContext(Type modelType, HttpContext httpContext)
ModelBinding\Binders\FormFileModelBinderProviderTest.cs (2)
16public void Create_ForUnsupportedTypes_ReturnsNull(Type modelType) 35public void Create_ForSupportedTypes_ReturnsBinder(Type modelType)
ModelBinding\Binders\FormFileModelBinderTest.cs (2)
256public async Task FormFileModelBinder_BindsFiles_ForCollectionsItCanCreate(Type destinationType) 445private static DefaultModelBindingContext GetBindingContext(Type modelType, HttpContext httpContext)
ModelBinding\Binders\HeaderModelBinderProviderTest.cs (7)
52public void Create_WhenBindingSourceIsFromHeader_ReturnsBinder_ForSimpleTypes(Type modelType) 75public void Create_WhenBindingSourceIsFromHeader_ReturnsBinder_ForNullableSimpleTypes(Type modelType) 101public void Create_WhenBindingSourceIsFromHeader_ReturnsBinder_ForCollectionOfSimpleTypes(Type modelType) 123public void Create_WhenBindingSourceIsFromHeader_ReturnsNull_ForNonSimpleModelType(Type modelType) 145Type modelType) 178private TestModelBinderProviderContext GetTestModelBinderProviderContext(Type modelType) 215public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
ModelBinding\Binders\HeaderModelBinderTests.cs (14)
21var type = typeof(string[]); 42var type = typeof(string); 68Type destinationType) 92var type = typeof(string[]); 106public static TheoryData<string, Type, object> BinderHeaderToSimpleTypesData 112return new TheoryData<string, Type, object>() 137Type modelType, 160public async Task HeaderBinder_DoesNotSetModel_ForHeaderNotPresentOnRequest(Type modelType) 177public async Task HeaderBinder_DoesNotCreateEmptyCollection_ForNonTopLevelObjects(Type modelType) 200public async Task HeaderBinder_BindsHeaders_ForCollectionsItCanCreate(Type destinationType) 280Type modelType, 303Type modelType, 323private static DefaultModelBindingContext CreateContext(Type modelType) 389private static ModelMetadata GetMetadataForType(Type modelType)
ModelBinding\Binders\KeyValuePairModelBinderProviderTest.cs (1)
15public void Create_ForNonKeyValuePair_ReturnsNull(Type modelType)
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (1)
215Type keyValuePairType)
ModelBinding\Binders\ServicesModelBinderTest.cs (2)
16var type = typeof(IService); 33private static DefaultModelBindingContext GetBindingContext(Type modelType)
ModelBinding\Binders\SimpleTypeModelBinderProviderTest.cs (2)
15public void Create_ForCollectionOrComplexTypes_ReturnsNull(Type modelType) 33public void Create_ForSimpleTypes_ReturnsBinder(Type modelType)
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (8)
65public static TheoryData<Type> ConvertibleTypeData 69var data = new TheoryData<Type> 92public async Task BindModel_ReturnsFailure_IfTypeCanBeConverted_AndConversionFails(Type destinationType) 112public async Task BindModel_CreatesError_WhenTypeConversionIsNull(Type destinationType) 286public static TheoryData<Type> BiggerNumericTypes 291return new TheoryData<Type> 308public async Task BindModel_ThousandsSeparators_LeadToErrors(Type type) 486private static DefaultModelBindingContext GetBindingContext(Type modelType)
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (9)
14public static TheoryData<Type> ConvertibleTypeData 18var data = new TheoryData<Type> 41public async Task BindModel_ReturnsFailure_IfTypeCanBeConverted_AndConversionFails(Type destinationType) 61public async Task BindModel_CreatesError_WhenTypeConversionIsNull(Type destinationType) 213public static TheoryData<Type> BiggerNumericTypes 220return new TheoryData<Type> 234public async Task BindModel_ThousandsSeparators_LeadToErrors(Type type) 491private static DefaultModelBindingContext GetBindingContext(Type modelType) 502private static IModelBinder CreateBinder(Type modelType, ILoggerFactory loggerFactory = null) =>
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (10)
665var type = typeof(DefaultConstructorType); 683var type = typeof(ParameterlessConstructorType); 701var type = typeof(NonPublicParameterlessConstructorType); 720var type = typeof(NonPublicParameterlessConstructorType); 737var type = typeof(RecordTypeWithPrimaryConstructor); 768public void GetBoundConstructor_ReturnsNull_ForRecordTypeWithParameterlessConstructor(Type type) 790var type = typeof(RecordTypeWithMultipleConstructors); 803var type = typeof(Model); 834var type = typeof(RecordTypeWithConformingSynthesizedConstructor); 862var type = typeof(RecordTypeWithNonConformingSynthesizedConstructor);
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (1)
64var modelType = typeof(ModelType);
ModelBinding\Metadata\DefaultModelMetadataTest.cs (29)
230public void ElementMetadata_ReturnsNull_ForNonCollections(Type modelType) 257public void ElementMetadata_ReturnsExpectedMetadata(Type modelType, Type elementType) 291public void IsBindingAllowed_ReturnsTrue_ForTypes(Type modelType) 318public void IsBindingRequired_ReturnsFalse_ForTypes(Type modelType) 351public void IsParseableType_ReturnsTrue_ForParseableTypes(Type modelType) 374public void IsParseableType_ReturnsFalse_ForNonParseableTypes(Type modelType) 395public void IsParseableType_ReturnsFalse_ForByRefTypes(Type modelType) 417public void IsRequired_ReturnsFalse_ForNullableTypes(Type modelType) 438public void IsRequired_ReturnsTrue_ForNonNullableTypes(Type modelType) 813public void ValidateChildren_SimpleTypes(Type modelType) 840public void ValidateChildren_ComplexAndEnumerableTypes(Type modelType) 1069var modelType = typeof(TypeWithProperties); 1094var modelType = typeof(TypeWithProperties); 1121var modelType = typeof(TypeWithProperties); 1145var modelType = typeof(TypeWithProperties); 1172var modelType = typeof(Employee); 1186var unitModel = typeof(BusinessUnit); 1213var modelType = typeof(Employee); 1227var unitModel = typeof(BusinessUnit); 1256var modelType = typeof(Employee); 1285var modelType = typeof(Employee); 1299var unitModel = typeof(BusinessUnit); 1330var modelType = typeof(SimpleRecordType); 1374var modelType = typeof(SimpleRecordType); 1419var modelType = typeof(SimpleRecordTypeWithProperty); 1464var modelType = typeof(SimpleRecordTypeWithProperty); 1509var modelType = typeof(SimpleRecordTypeWithProperty); 1554var modelType = typeof(SimpleRecordTypeWithProperty);
ModelBinding\Metadata\ModelAttributesTest.cs (7)
15var modelType = typeof(BaseViewModel); 33var modelType = typeof(BaseViewModel); 63var modelType = typeof(DerivedViewModel); 81var modelType = typeof(DerivedViewModel); 101var modelType = typeof(DerivedViewModel); 119var modelType = typeof(DerivedViewModel); 294var modelType = typeof(InvalidBaseViewModel);
ModelBinding\ModelBindingHelperTest.cs (11)
1004Type enumType, 1177public void ConvertToThrowsIfConverterThrows(Type destinationType) 1242public void ConvertTo_Throws_IfValueIsNotConvertible(Type destinationType) 1260var destinationType = typeof(MyClassWithoutConverter); 1274public void ConvertTo_ReturnsValue_IfCompatible(Type destinationType) 1289public void ConvertTo_ReusesArrayElements_IfCompatible(Type destinationType) 1343public void CanGetCompatibleCollection_ReturnsTrue(Type destinationType) 1364public void GetCompatibleCollection_ReturnsList(Type destinationType) 1380public void GetCompatibleCollection_ActivatesCollection(Type destinationType) 1481public void CanGetCompatibleCollection_ReturnsFalse(Type destinationType) 1521private static DefaultModelBindingContext GetBindingContext(Type modelType)
ModelBinding\TestModelBinderProviderContext.cs (2)
22public TestModelBinderProviderContext(Type modelType) 27public TestModelBinderProviderContext(Type modelType, BindingInfo bindingInfo)
ModelBinding\Validation\DefaultComplexObjectValidationStrategyTest.cs (1)
239public override IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType)
ModelBinding\Validation\DefaultObjectValidatorTests.cs (4)
867public static TheoryData<object, Type> ValidCollectionData 871return new TheoryData<object, Type>() 901public void Validate_IndexedCollectionTypes_Valid(object model, Type type) 1461private static DefaultObjectValidator CreateValidator(Type excludedType)
ProducesAttributeTests.cs (1)
135var personType = typeof(Person);
RequestFormLimitsAttributeTest.cs (1)
83private PropertyInfo[] GetProperties(Type type)
Routing\AttributeRoutingTest.cs (1)
113var controllerType = typeof(HomeController);
TestApplicationPart.cs (2)
27public TestApplicationPart(IEnumerable<Type> types) 32public TestApplicationPart(params Type[] types)
Microsoft.AspNetCore.Mvc.Core.TestCommon (2)
TestModelMetadataProvider.cs (2)
104public IMetadataBuilder ForType(Type type) 118public IMetadataBuilder ForProperty(Type containerType, string propertyName)
Microsoft.AspNetCore.Mvc.Cors (1)
CorsLoggerExtensions.cs (1)
11public static partial void NotMostEffectiveFilter(this ILogger logger, Type filterPolicy);
Microsoft.AspNetCore.Mvc.Cors.Test (1)
CorsApplicationModelProviderTest.cs (1)
211private static ApplicationModelProviderContext GetProviderContext(Type controllerType)
Microsoft.AspNetCore.Mvc.DataAnnotations (6)
DataAnnotationsMetadataProvider.cs (2)
96var containerType = context.Key.ContainerType ?? context.Key.ModelType; 159var underlyingType = Nullable.GetUnderlyingType(context.Key.ModelType) ?? context.Key.ModelType;
DataAnnotationsModelValidatorProvider.cs (1)
97public bool HasValidators(Type modelType, IList<object> validatorMetadata)
MvcDataAnnotationsLocalizationOptions.cs (1)
20public Func<Type, IStringLocalizerFactory, IStringLocalizer> DataAnnotationLocalizerProvider = null!;
NumericClientModelValidatorProvider.cs (1)
19var typeToValidate = context.ModelMetadata.UnderlyingOrModelType;
ValidationAttributeAdapterProvider.cs (1)
24var type = attribute.GetType();
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (47)
DataAnnotationsMetadataProviderTest.cs (31)
403.Setup(s => s.Create(It.IsAny<Type>())) 438.Setup(s => s.Create(It.IsAny<Type>())) 502.Setup(s => s.Create(It.IsAny<Type>())) 574.Setup(f => f.Create(It.IsAny<Type>())) 631public void CreateDisplayMetadata_IsEnum_ReflectsModelType(Type type, bool expectedIsEnum) 665public void CreateDisplayMetadata_IsFlagsEnum_ReflectsModelType(Type type, bool expectedIsFlagsEnum) 682public static TheoryData<Type, IReadOnlyDictionary<string, string>> EnumNamesData 686return new TheoryData<Type, IReadOnlyDictionary<string, string>> 796Type type, 828var type = typeof(EnumWithDisplayNames); 841.Setup(f => f.Create(It.IsAny<Type>())) 859public static TheoryData<Type, IEnumerable<KeyValuePair<EnumGroupAndName, string>>> EnumDisplayNamesData 863return new TheoryData<Type, IEnumerable<KeyValuePair<EnumGroupAndName, string>>> 974Type type, 1230var modelType = typeof(DerivedTypeWithAllNonNullProperties); 1249var modelType = typeof(DerivedTypeWithAllNonNullProperties_WithNullableProperties); 1268var modelType = typeof(DerivedTypeWithAllNonNullProperties_WithNullableProperties); 1289var modelType = typeof(DerivedTypeWithNullableProperties); 1309var modelType = typeof(DerivedTypeWithNullableProperties_WithNonNullProperties); 1328var modelType = typeof(DerivedTypeWithNullableProperties_ShadowedProperty); 1347var modelType = typeof(TypeImplementIInterfaceWithNonNullProperty); 1366var modelType = typeof(TypeImplementIInterfaceWithNonNullProperty_AsNullable); 1386var type = typeof(NullableReferenceTypes); 1407var type = typeof(NullableReferenceTypes); 1427var modelType = typeof(TypeWithAllNonNullProperties); 1583var type = typeof(NullableReferenceTypes); 1599var type = typeof(KeyValuePair<string, object>); 1616var type = typeof(KeyValuePair<string, object>); 1635var type = typeof(NullableReferenceTypes); 1651var type = typeof(NullableReferenceTypes); 1668var type = typeof(NullableReferenceTypes);
DataTypeClientModelValidatorProviderTest.cs (2)
20public void CreateValidators_GetsNumericValidator_ForNumericType(Type modelType) 68public void CreateValidators_DoesNotGetsNumericValidator_ForUnsupportedTypes(Type modelType)
ModelMetadataProviderTest.cs (11)
21var type = typeof(User); 50var type = typeof(User); 64var type = typeof(ScaffoldColumnModel); 77var type = typeof(ScaffoldColumnModel); 790var type = typeof(ClassWithPrivateGetProperty); 803var type = typeof(BindingBehaviorModel); 818var type = typeof(BindingBehaviorModel); 834var type = typeof(BindingBehaviorModel); 850var type = typeof(BindingBehaviorModel); 866var type = typeof(BindingBehaviorModel); 922public Type BinderType { get; set; }
ValidationAttributeAdapterProviderTest.cs (3)
13public static TheoryData<ValidationAttribute, Type> DataAnnotationAdapters 17return new TheoryData<ValidationAttribute, Type> 55Type expectedAdapterType)
Microsoft.AspNetCore.Mvc.Formatters.Xml (50)
EnumerableWrapperProvider.cs (2)
26Type sourceEnumerableOfT, 55public Type WrappingType
EnumerableWrapperProviderFactory.cs (1)
41var declaredType = context.DeclaredType;
IUnwrappable.cs (1)
16object Unwrap(Type declaredType);
IWrapperProvider.cs (1)
14Type WrappingType { get; }
ModelBinding\DataMemberRequiredBindingMetadataProvider.cs (1)
42var containerType = context.Key.ContainerType;
ProblemDetailsWrapper.cs (1)
172object IUnwrappable.Unwrap(Type declaredType)
ProblemDetailsWrapperProviderFactory.cs (2)
25public WrapperProvider(Type wrappingType, Func<object?, object?> wrapDelegate) 31public Type WrappingType { get; }
SerializableErrorWrapper.cs (1)
107public object Unwrap(Type declaredType)
SerializableErrorWrapperProvider.cs (1)
12public Type WrappingType => typeof(SerializableErrorWrapper);
ValidationProblemDetailsWrapper.cs (1)
109object IUnwrappable.Unwrap(Type declaredType)
WrapperProviderContext.cs (2)
17public WrapperProviderContext(Type declaredType, bool isSerialization) 29public Type DeclaredType { get; }
XmlDataContractSerializerInputFormatter.cs (8)
21private readonly ConcurrentDictionary<Type, object> _serializerCache = new ConcurrentDictionary<Type, object>(); 143var type = GetSerializableType(context.ModelType); 173protected override bool CanReadType(Type type) 199protected virtual Type GetSerializableType(Type declaredType) 214protected virtual DataContractSerializer? CreateSerializer(Type type) 235protected virtual DataContractSerializer GetCachedSerializer(Type type)
XmlDataContractSerializerOutputFormatter.cs (9)
25private readonly ConcurrentDictionary<Type, object> _serializerCache = new ConcurrentDictionary<Type, object>(); 119protected virtual Type GetSerializableType(Type type) 131protected override bool CanWriteType(Type? type) 146protected virtual DataContractSerializer? CreateSerializer(Type type) 228var valueType = context.ObjectType; 244var wrappingType = GetSerializableType(valueType); 293protected virtual DataContractSerializer GetCachedSerializer(Type type)
XmlSerializerInputFormatter.cs (10)
21private readonly ConcurrentDictionary<Type, object> _serializerCache = new ConcurrentDictionary<Type, object>(); 125var type = GetSerializableType(context.ModelType); 169protected override bool CanReadType(Type type) 181protected virtual Type GetSerializableType(Type declaredType) 196/// <param name="type">The <see cref="Type"/> that is to be deserialized.</param> 198protected virtual XmlReader CreateXmlReader(Stream readStream, Encoding encoding, Type type) 221protected virtual XmlSerializer? CreateSerializer(Type type) 240protected virtual XmlSerializer GetCachedSerializer(Type type)
XmlSerializerOutputFormatter.cs (9)
25private readonly ConcurrentDictionary<Type, object> _serializerCache = new ConcurrentDictionary<Type, object>(); 101protected virtual Type GetSerializableType(Type type) 113protected override bool CanWriteType(Type? type) 128protected virtual XmlSerializer? CreateSerializer(Type type) 207var valueType = context.ObjectType!; 221var wrappingType = GetSerializableType(valueType); 282protected virtual XmlSerializer GetCachedSerializer(Type type)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (42)
EnumerableWrapperProviderFactoryTest.cs (15)
8public static TheoryData<Type, object, Type> EnumerableOfTInterfaceData 15return new TheoryData<Type, object, Type> 44Type declaredType, 46Type expectedWrappingType) 61public static TheoryData<Type, object, Type> QueryableOfTInterfaceData 68return new TheoryData<Type, object, Type> 97Type declaredType, 99Type expectedWrappingType) 114public static TheoryData<Type, object> ConcreteEnumerableOfTData 121return new TheoryData<Type, object> 150Type declaredType,
EnumerableWrapperProviderTest.cs (6)
19public void Gets_DelegatingWrappingType(Type declaredEnumerableOfT, Type expectedType) 27var wrappingType = wrapperProvider.WrappingType; 38var declaredEnumerableOfT = typeof(IEnumerable<int>); 58var declaredEnumerableOfT = typeof(IEnumerable<int>); 77public void ThrowsArgumentExceptionFor_ConcreteEnumerableOfT(Type declaredType)
PersonWrapper.cs (1)
30public object Unwrap(Type declaredType)
PersonWrapperProvider.cs (1)
20public Type WrappingType
XmlDataContractSerializerInputFormatterTest.cs (5)
479var expectedException = typeof(XmlException); 503var expectedException = typeof(XmlException); 716private InputFormatterContext GetInputFormatterContext(byte[] contentBytes, Type modelType) 722private InputFormatterContext GetInputFormatterContext(HttpContext httpContext, Type modelType) 762protected override DataContractSerializer CreateSerializer(Type type)
XmlDataContractSerializerOutputFormatterTest.cs (4)
379public void CanWriteResult_ReturnsExpectedValueForObjectType(object input, Type declaredType, bool expectedOutput) 443public void GetSupportedContentTypes_ReturnsSupportedTypes(Type type, object expectedOutput) 790Type outputType, 817protected override DataContractSerializer CreateSerializer(Type type)
XmlSerializerInputFormatterTest.cs (6)
273public void CanRead_ReturnsFalse_ForAnyUnsupportedModelType(Type modelType, bool expectedCanRead) 497var expectedException = typeof(XmlException); 523var expectedException = typeof(XmlException); 652private InputFormatterContext GetInputFormatterContext(byte[] contentBytes, Type modelType) 658private InputFormatterContext GetInputFormatterContext(HttpContext httpContext, Type modelType) 697protected override XmlSerializer CreateSerializer(Type type)
XmlSerializerOutputFormatterTest.cs (4)
352public void CanWriteResult_ReturnsExpectedValueForObjectType(object input, Type declaredType, bool expectedOutput) 429public void XmlSerializer_GetSupportedContentTypes_Returns_SupportedTypes(Type type, object expectedOutput) 572Type outputType, 599protected override XmlSerializer CreateSerializer(Type type)
Microsoft.AspNetCore.Mvc.FunctionalTests (6)
AntiforgeryMiddlewareTest.cs (3)
271params Type[] controllerTypes) 280params Type[] controllerTypes) => mvcCoreBuilder 284internal class SelectedControllersApplicationParts(Type[] types) : ApplicationPart, IApplicationPartTypeProvider
ApiExplorerTest.cs (2)
945Type formatterType) 1535public async Task ApiAction_ForActionWithVoidResponseType(string path, Type type)
TempDataInCookiesTest.cs (1)
46var type = serializer.ImplementationType;
Microsoft.AspNetCore.Mvc.IntegrationTests (41)
ActionParametersIntegrationTest.cs (6)
390var parameterType = typeof(Class1); 423var parameterType = typeof(ActionParameter_DefaultValueConstructor); 451var parameterType = typeof(Class1); 485var parameterType = typeof(PointStruct); 543var parameterType = typeof(ActionParameter_MultipleConstructorsWithDefaultValues_NoParameterlessConstructorModel); 576var parameterType = typeof(ActionParameter_RecordTypeWithMultipleConstructors);
AuthorizeFilterIntegrationTest.cs (1)
165private static ApplicationModelProviderContext GetProviderContext(Type controllerType)
BodyValidationIntegrationTests.cs (1)
603Type modelType,
CollectionModelBinderIntegrationTest.cs (6)
724public static TheoryData<Type, Dictionary<string, StringValues>, Type> CollectionTypeData 728return new TheoryData<Type, Dictionary<string, StringValues>, Type> 931Type parameterType, 933Type expectedType)
ComplexObjectIntegrationTest.cs (1)
10protected override Type ExpectedModelBinderType => typeof(ComplexObjectModelBinder);
ComplexTypeIntegrationTestBase.cs (1)
26protected abstract Type ExpectedModelBinderType { get; }
ComplexTypeModelBinderIntegrationTest.cs (1)
13protected override Type ExpectedModelBinderType => typeof(ComplexTypeModelBinder);
DictionaryModelBinderIntegrationTest.cs (6)
1082public static TheoryData<Type, string, Type> DictionaryTypeData 1086return new TheoryData<Type, string, Type> 1155Type parameterType, 1157Type expectedType)
ExcludeBindingMetadataProviderIntegrationTest.cs (2)
123public Type Type { get; set; } 135if (context.Metadata.ModelType == typeof(Type))
HeaderModelBinderIntegrationTest.cs (2)
248public async Task BindParameterFromHeader_WithData_WithPrefix_ModelGetsBound(Type modelType, string value) 498public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
SimpleTypeModelBinderIntegrationTest.cs (5)
413var parameterType = typeof(int); 472public async Task BindParameter_WithEmptyData_DoesNotBind(Type parameterType) 514public async Task BindParameter_WithEmptyData_AndPerTypeMessage_AddsGivenMessage(Type parameterType) 569public async Task BindParameter_WithEmptyData_BindsReferenceAndNullableObjects(Type parameterType) 834public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
TestMvcOptions.cs (1)
28.Setup(s => s.Create(It.IsAny<Type>()))
ValidationIntegrationTests.cs (2)
2309var modelType = typeof(Validation_TopLevelPropertyController); 2363var modelType = typeof(Validation_TopLevelProperty_ValidationOnPropertyController);
ValidationWithRecordIntegrationTests.cs (6)
2100var modelType = typeof(Validation_TopLevelPropertyController); 2151var modelType = typeof(Validation_TopLevelProperty_ValidationOnPropertyController); 2305var modelType = typeof(RecordTypeWithValidatorsOnProperties); 2344var modelType = typeof(RecordTypeWithValidatorsOnPropertiesAndParameters); 2385var modelType = typeof(RecordTypeWithValidatorsOnMixOfPropertiesAndParameters); 2422var modelType = typeof(RecordTypeWithPropertiesAndParameters);
Microsoft.AspNetCore.Mvc.Localization (9)
HtmlLocalizerFactory.cs (3)
28/// Creates an <see cref="HtmlLocalizer"/> using the specified <see cref="Type"/>. 30/// <param name="resourceSource">The <see cref="Type"/> to load resources for.</param> 32public virtual IHtmlLocalizer Create(Type resourceSource)
HtmlLocalizerOfT.cs (1)
12/// <typeparam name="TResource">The <see cref="Type"/> to scope the resource names.</typeparam>
IHtmlLocalizerFactory.cs (4)
13/// <see cref="Type.FullName"/> of the specified <see cref="Type"/>. 15/// <param name="resourceSource">The <see cref="Type"/>.</param> 17IHtmlLocalizer Create(Type resourceSource);
IHtmlLocalizerOfT.cs (1)
9/// <typeparam name="TResource">The <see cref="System.Type"/> to scope the resource names.</typeparam>
Microsoft.AspNetCore.Mvc.Localization.Test (8)
MvcLocalizationMvcBuilderExtensionsTest.cs (2)
109var dataAnnotationLocalizerProvider = new Func<Type, IStringLocalizerFactory, IStringLocalizer>((type, factory) => 125private ServiceDescriptor GetService(IServiceCollection services, Type serviceType)
MvcLocalizationMvcCoreBuilderExtensionsTest.cs (2)
109var dataAnnotationLocalizerProvider = new Func<Type, IStringLocalizerFactory, IStringLocalizer>((type, factory) => 125private ServiceDescriptor GetService(IServiceCollection services, Type serviceType)
MvcLocalizationServiceCollectionExtensionsTest.cs (3)
53Type serviceType, 54Type implementationType) 132public IHtmlLocalizer Create(Type resourceSource)
ViewLocalizerTest.cs (1)
343public IHtmlLocalizer Create(Type resourceSource)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (39)
BsonTempDataSerializer.cs (13)
26private static readonly ConcurrentDictionary<Type, Func<JArray, object>> _arrayConverters = 27new ConcurrentDictionary<Type, Func<JArray, object>>(); 28private static readonly ConcurrentDictionary<Type, Func<JObject, object>> _dictionaryConverters = 29new ConcurrentDictionary<Type, Func<JObject, object>>(); 31private static readonly Dictionary<JTokenType, Type> _tokenTypeLookup = new Dictionary<JTokenType, Type>(8) 65if (_tokenTypeLookup.TryGetValue(arrayType, out var returnType)) 92if (_tokenTypeLookup.TryGetValue(jTokenType, out var valueType)) 156var itemType = item.GetType(); 164public override bool CanSerializeType(Type type) => CanSerializeType(type, out _); 166private static bool CanSerializeType(Type typeToSerialize, out string? errorMessage) 172Type? actualType = null; 237private static bool IsSimpleType(Type type)
NewtonsoftJsonInputFormatter.cs (1)
150var type = context.ModelType;
NewtonsoftJsonPatchInputFormatter.cs (1)
85var modelType = context.ModelType;
ProblemDetailsConverter.cs (2)
14public override bool CanConvert(Type objectType) 20public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
src\Mvc\Mvc.Core\src\Infrastructure\AsyncEnumerableReader.cs (4)
34private readonly ConcurrentDictionary<Type, Func<object, CancellationToken, Task<ICollection>>?> _asyncEnumerableConverters = new(); 52public bool TryGetReader(Type type, [NotNullWhen(true)] out Func<object, CancellationToken, Task<ICollection>>? reader) 56var enumerableType = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IAsyncEnumerable<>)); 65var enumeratedObjectType = enumerableType.GetGenericArguments()[0];
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (16)
19/// Determine whether <paramref name="queryType"/> is or implements a closed generic <see cref="Type"/> 22/// <param name="queryType">The <see cref="Type"/> of interest.</param> 23/// <param name="interfaceType">The open generic <see cref="Type"/> to match. Usually an interface.</param> 25/// The closed generic <see cref="Type"/> created from <paramref name="interfaceType"/> that 26/// <paramref name="queryType"/> is or implements. <c>null</c> if the two <see cref="Type"/>s have no such 34public static Type? ExtractGenericInterface([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 59private static bool IsGenericInstantiation(Type candidate, Type interfaceType) 66private static Type? GetGenericInstantiation([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 68Type? bestMatch = null; 70foreach (var @interface in interfaces) 96var baseType = queryType?.BaseType;
ValidationProblemDetailsConverter.cs (2)
14public override bool CanConvert(Type objectType) 20public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (16)
BsonTempDataSerializerTest.cs (6)
12public static TheoryData<object, Type> InvalidTypes 16return new TheoryData<object, Type> 29public void EnsureObjectCanBeSerialized_ThrowsException_OnInvalidType(object value, Type type) 41public static TheoryData<object, Type> InvalidDictionaryTypes 45return new TheoryData<object, Type> 57public void EnsureObjectCanBeSerialized_ThrowsException_OnInvalidDictionaryType(object value, Type type)
DependencyInjection\MvcNewtonsoftJsonOptionsExtensionsTest.cs (3)
22var expected = typeof(CamelCaseNamingStrategy); 166var expected = typeof(DefaultNamingStrategy); 265public JsonContract ResolveContract(Type type)
NewtonsoftJsonInputFormatterTest.cs (1)
670public override short ReadJson(JsonReader reader, Type objectType, short existingValue, bool hasExistingValue, JsonSerializer serializer)
NewtonsoftJsonPatchInputFormatterTest.cs (2)
178public void CanRead_ReturnsFalse_NonJsonPatchContentType(Type modelType) 241private InputFormatterContext CreateInputFormatterContext(Type modelType, HttpContext httpContext)
src\Mvc\Mvc.Core\test\Formatters\JsonInputFormatterTestBase.cs (2)
287protected async Task ReadAsync_ReadsValidArray_AsList(Type requestedType) 649Type modelType,
src\Mvc\Mvc.Core\test\Formatters\JsonOutputFormatterTestBase.cs (1)
176Type outputType,
src\Mvc\Mvc.Core\test\Infrastructure\AsyncEnumerableReaderTest.cs (1)
15public void TryGetReader_ReturnsFalse_IfTypeIsNotIAsyncEnumerable(Type type)
Microsoft.AspNetCore.Mvc.Razor (32)
ApplicationParts\RazorCompiledItemFeatureProvider.cs (6)
14private Dictionary<string, Type>? _hotReloadedViews; 40if (_hotReloadedViews is not null && _hotReloadedViews.TryGetValue(item.Identifier, out var hotReloadedType)) 52public void UpdateCache(Type[]? types) 59foreach (var type in types) 76public HotReloadRazorCompiledItem(RazorCompiledItem previous, Type type) 85public override Type Type { get; }
Compilation\CompiledViewDescriptor.cs (1)
98public Type? Type => Item?.Type;
Compilation\DefaultRazorPageFactoryProvider.cs (1)
41var viewType = viewDescriptor.Type;
Compilation\RazorViewAttribute.cs (2)
18public RazorViewAttribute(string path, Type viewType) 32public Type ViewType { get; }
DefaultTagHelperFactory.cs (3)
20private readonly ConcurrentDictionary<Type, PropertyActivator<ViewContext>[]> _injectActions; 21private readonly Func<Type, PropertyActivator<ViewContext>[]> _getPropertiesToActivate; 35_injectActions = new ConcurrentDictionary<Type, PropertyActivator<ViewContext>[]>();
DependencyInjection\TagHelpersAsServices.cs (1)
22foreach (var type in feature.TagHelpers.Select(t => t.AsType()))
IModelTypeProvider.cs (1)
8Type GetModelType();
Infrastructure\DefaultTagHelperActivator.cs (1)
26private static readonly ObjectFactory _objectFactory = ActivatorUtilities.CreateFactory(typeof(TTagHelper), Type.EmptyTypes);
RazorHotReload.cs (1)
57public void ClearCache(Type[]? changedTypes)
RazorPageActivator.cs (7)
69var pageType = page.GetType(); 70Type? providedModelType = null; 86var modelType = providedModelType; 106public CacheKey(Type pageType, Type? providedModelType) 112public Type PageType { get; } 114public Type? ProvidedModelType { get; }
RazorPageBase.cs (1)
179/// <param name="tagHelperTypeName">Full name of the tag helper <see cref="Type"/>.</param>
RazorPagePropertyActivator.cs (4)
21private readonly Type _viewDataDictionaryType; 25Type pageType, 26Type? declaredModelType, 33var viewDataDictionaryModelType = declaredModelType ?? typeof(object);
TagHelpers\TagHelperComponentPropertyActivator.cs (3)
18private readonly ConcurrentDictionary<Type, PropertyActivator<ViewContext>[]> _propertiesToActivate = new(); 19private readonly Func<Type, PropertyActivator<ViewContext>[]> _getPropertiesToActivate = GetPropertiesToActivate; 48private static PropertyActivator<ViewContext>[] GetPropertiesToActivate(Type type)
Microsoft.AspNetCore.Mvc.Razor.Test (15)
ApplicationParts\RazorCompiledItemFeatureProviderTest.cs (1)
169public override object[] GetCustomAttributes(Type attributeType, bool inherit)
RazorHotReloadTest.cs (3)
26hotReload.ClearCache(Type.EmptyTypes); 43hotReload.ClearCache(Type.EmptyTypes); 65hotReload.ClearCache(Type.EmptyTypes);
RazorPageActivatorTest.cs (2)
302public Type ModelType { get; set; } = typeof(Guid); 309public Type GetModelType() => ModelType;
RazorPageCreateModelExpressionTest.cs (4)
74var expectedType = typeof(RecursiveModel); 85var expectedType = typeof(RecursiveModel); 97var expectedType = typeof(object); 105Type expectedType)
RazorPageCreateTagHelperTest.cs (3)
82serviceProvider.Setup(mock => mock.GetService(It.Is<Type>(serviceType => 84.Returns<Type>(serviceType => 86var enumerableType = serviceType.GetGenericArguments().First();
TestApplicationPart.cs (2)
27public TestApplicationPart(IEnumerable<Type> types) 32public TestApplicationPart(params Type[] types)
Microsoft.AspNetCore.Mvc.RazorPages (42)
ApplicationModels\DefaultPageApplicationModelPartsProvider.cs (2)
119var declaringType = property.DeclaringType!; 194var declaringType = methodInfo.DeclaringType;
ApplicationModels\PageConventionCollection.cs (1)
237public void RemoveType(Type pageConventionType)
ApplicationModels\TempDataFilterPageApplicationModelProvider.cs (1)
31var handlerType = pageApplicationModel.HandlerType.AsType();
ApplicationModels\ViewDataAttributePageApplicationModelProvider.cs (1)
25var handlerType = context.PageApplicationModel.HandlerType.AsType();
Infrastructure\DefaultPageActivatorProvider.cs (2)
24var pageTypeInfo = actionDescriptor.PageTypeInfo?.AsType(); 65private static Func<PageContext, ViewContext, object> CreatePageFactory(Type pageTypeInfo)
Infrastructure\DefaultPageFactoryProvider.cs (1)
52var declaredModelType = actionDescriptor.DeclaredModelTypeInfo?.AsType() ?? actionDescriptor.PageTypeInfo.AsType();
Infrastructure\DefaultPageModelActivatorProvider.cs (2)
23var modelTypeInfo = actionDescriptor.ModelTypeInfo?.AsType(); 32var factory = ActivatorUtilities.CreateFactory(modelTypeInfo, Type.EmptyTypes);
Infrastructure\DynamicPageRouteValueTransformerMetadata.cs (2)
11public DynamicPageRouteValueTransformerMetadata(Type selectorType, object? state) 30public Type SelectorType { get; }
Infrastructure\ExecutorFactory.cs (1)
27var returnType = method.ReturnType;
Infrastructure\PageActionEndpointDataSource.cs (1)
74internal void AddDynamicPageEndpoint(IEndpointRouteBuilder endpoints, string pattern, Type transformerType, object? state, int? order = null)
Infrastructure\PageBinderFactory.cs (2)
28var handlerType = actionDescriptor.HandlerTypeInfo.AsType(); 94var handlerType = actionDescriptor.HandlerTypeInfo.AsType();
Infrastructure\RazorPageAdapter.cs (3)
18private readonly Type _modelType; 25public RazorPageAdapter(RazorPageBase page, Type modelType) 88Type IModelTypeProvider.GetModelType() => _modelType;
Infrastructure\RazorPageAttribute.cs (1)
20public RazorPageAttribute(string path, Type viewType, string routeTemplate)
Infrastructure\ServiceBasedPageModelActivatorProvider.cs (1)
18var modelType = descriptor.ModelTypeInfo?.AsType();
PageBase.cs (8)
1212/// Creates a <see cref="ViewComponentResult"/> by specifying the <see cref="Type"/> of a view component to 1215/// <param name="componentType">The view component <see cref="Type"/>.</param> 1217public virtual ViewComponentResult ViewComponent(Type componentType) 1247/// Creates a <see cref="ViewComponentResult"/> by specifying the <see cref="Type"/> of a view component to 1250/// <param name="componentType">The view component <see cref="Type"/>.</param> 1257public virtual ViewComponentResult ViewComponent(Type componentType, object? arguments) 1492Type modelType, 1528Type modelType,
PageLoggerExtensions.cs (5)
29var pageType = context.ActionDescriptor.PageTypeInfo.AsType(); 44var pageType = context.ActionDescriptor.PageTypeInfo.AsType(); 59var pageType = context.ActionDescriptor.PageTypeInfo.AsType(); 74var pageType = context.ActionDescriptor.PageTypeInfo.AsType(); 156public static partial void NotMostEffectiveFilter(this ILogger logger, Type filterPolicy);
PageModel.cs (8)
397Type modelType, 433Type modelType, 1570/// Creates a <see cref="ViewComponentResult"/> by specifying the <see cref="Type"/> of a view component to 1573/// <param name="componentType">The view component <see cref="Type"/>.</param> 1575public virtual ViewComponentResult ViewComponent(Type componentType) 1605/// Creates a <see cref="ViewComponentResult"/> by specifying the <see cref="Type"/> of a view component to 1608/// <param name="componentType">The view component <see cref="Type"/>.</param> 1615public virtual ViewComponentResult ViewComponent(Type componentType, object? arguments)
Microsoft.AspNetCore.Mvc.RazorPages.Test (33)
ApplicationModels\DefaultPageApplicationModelProviderTest.cs (7)
191var modelType = typeof(ModelWithPageModelAttribute); 331var modelType = typeof(TestPageModel); 373var modelType = typeof(ModelWithBindProperty); 420var modelType = typeof(TestPageModel); 575var modelType = typeof(ModelWithHandler); 673var baseType = typeof(TestSetPageModel); 724var baseType = typeof(TestSetPageModel);
ApplicationModels\TempDataFilterPageApplicationModelProviderTest.cs (7)
18var type = typeof(TestPageModel_NoTempDataProperties); 33var type = typeof(TestPageModel_PrivateSet); 48var type = typeof(TestPageModel_InvalidProperties); 65var type = typeof(TestPageModel_OneTempDataProperty); 81var type = typeof(TestPageModel_OneTempDataProperty); 103var type = typeof(TestPageModel_OneTempDataProperty); 120private static PageApplicationModelProviderContext CreateProviderContext(Type handlerType)
ApplicationModels\ViewDataAttributePageApplicationModelProviderTest.cs (3)
16var type = typeof(TestPageModel_NoViewDataProperties); 31var type = typeof(TestPageModel_ViewDataProperties); 46private static PageApplicationModelProviderContext CreateProviderContext(Type handlerType)
Filters\PageSaveTempDataPropertyFilterTest.cs (2)
95var pageType = typeof(TestPageModel); 197var pageModelType = typeof(TestPageModel);
Filters\PageViewDataAttributeFilterTest.cs (1)
58var type = typeof(TestModel);
Infrastructure\DefaultPageActivatorProviderTest.cs (3)
30public void CreateActivator_ReturnsFactoryForPage(Type type) 69public void CreateReleaser_ReturnsNullForPagesThatDoNotImplementDisposable(Type pageType) 89public void CreateAsyncReleaser_ReturnsNullForPagesThatDoNotImplementDisposable(Type pageType)
Infrastructure\DefaultPageModelActivatorProviderTest.cs (2)
93public void CreateReleaser_ReturnsNullForModelsThatDoNotImplementDisposable(Type pageType) 113public void CreateAsyncReleaser_ReturnsNullForModelsThatDoNotImplementDisposable(Type pageType)
Infrastructure\PageActionInvokerProviderTest.cs (2)
465Type pageType = null, 466Type modelType = null)
Infrastructure\PageBinderFactoryTest.cs (5)
579var type = typeof(PageModelWithExecutors); 622var type = typeof(PageModelWithExecutors); 659var type = typeof(PageModelWithExecutors); 709var type = typeof(PageModelWithExecutors); 754private static CompiledPageActionDescriptor GetActionDescriptorWithHandlerMethod(Type type, string method)
Infrastructure\ServiceBasedPageModelActivatorProviderTest.cs (1)
124public void CreateReleaser_ReturnsNullForPageModels(Type pageType)
Microsoft.AspNetCore.Mvc.TagHelpers (4)
ComponentTagHelper.cs (1)
53public Type ComponentType { get; set; }
InputTagHelper.cs (1)
538var fieldType = modelExplorer.ModelType;
OptionTagHelper.cs (1)
55/// <see cref="SelectTagHelper"/> <see cref="Type"/> entry and that entry is a non-<c>null</c>
SelectTagHelper.cs (1)
98var realModelType = For.ModelExplorer.ModelType;
Microsoft.AspNetCore.Mvc.TagHelpers.Test (24)
InputTagHelperTest.cs (4)
561public static TheoryData<object, Type, object, NameAndId, string> TestDataSet 587return new TheoryData<object, Type, object, NameAndId, string> 619Type containerType, 2389Type containerType,
LabelTagHelperTest.cs (3)
14public static TheoryData<object, Type, Func<object>, string, TagHelperOutputContent> TestDataSet 40return new TheoryData<object, Type, Func<object>, string, TagHelperOutputContent> 154Type containerType,
LinkTagHelperTest.cs (1)
1288public object ToType(Type conversionType, IFormatProvider provider)
SelectTagHelperTest.cs (13)
19public static TheoryData<object, Type, Func<object>, NameAndId, string> GeneratesExpectedDataSet 57return new TheoryData<object, Type, Func<object>, NameAndId, string> 143public static TheoryData<Type, object, bool> RealModelTypeDataSet 147return new TheoryData<Type, object, bool> 166Type containerType, 248entry => (Type)entry.Key == typeof(SelectTagHelper)); 255Type containerType, 347entry => (Type)entry.Key == typeof(SelectTagHelper)); 435Type containerType, 527entry => (Type)entry.Key == typeof(SelectTagHelper)); 621entry => (Type)entry.Key == typeof(SelectTagHelper)); 629Type modelType, 697entry => (Type)entry.Key == typeof(SelectTagHelper));
TextAreaTagHelperTest.cs (3)
15public static TheoryData<object, Type, object, NameAndId, string> TestDataSet 41return new TheoryData<object, Type, object, NameAndId, string> 82Type containerType,
Microsoft.AspNetCore.Mvc.Test (29)
MvcOptionsSetupTest.cs (1)
205Assert.Equal(typeof(Type), excludeFilter.Type);
MvcServiceCollectionExtensionsTest.cs (28)
64var mockType = typeof(Mock<>).MakeGenericType(serviceType.Key); 75foreach (var implementationType in serviceType.Value) 146foreach (var serviceType in SingleRegistrationServiceTypes) 148var mockType = typeof(Mock<>).MakeGenericType(serviceType); 155foreach (var singleRegistrationType in SingleRegistrationServiceTypes) 273var implementationType = service switch 418foreach (var serviceType in services.Select(d => d.ServiceType).Where(t => !t.IsGenericTypeDefinition).Distinct()) 455private IEnumerable<Type> SingleRegistrationServiceTypes 471private Dictionary<Type, Type[]> MultiRegistrationServiceTypes 475return new Dictionary<Type, Type[]>() 479new Type[] 488new Type[] 497new Type[] 504new Type[] 527new Type[] 534new Type[] 542new Type[] 550new Type[] 558new Type[] 565new Type[] 573new Type[] 586new Type[] 616Type serviceType, 631Type serviceType, 632Type implementationType) 646var implementations = new List<Type>();
Microsoft.AspNetCore.Mvc.Testing (4)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-alpha.1.24619.8\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (4)
97var programType = assembly?.EntryPoint?.DeclaringType; 191var hostType = host.GetType(); 353Type? publicHostAbortedExceptionType = Type.GetType("Microsoft.Extensions.Hosting.HostAbortedException, Microsoft.Extensions.Hosting.Abstractions", throwOnError: false);
Microsoft.AspNetCore.Mvc.ViewFeatures (99)
CachedExpressionCompiler.cs (1)
236var type = invokingExpression.Type;
Controller.cs (6)
222/// Creates a <see cref="ViewComponentResult"/> by specifying the <see cref="Type"/> of a view component to 225/// <param name="componentType">The view component <see cref="Type"/>.</param> 228public virtual ViewComponentResult ViewComponent(Type componentType) 259/// Creates a <see cref="ViewComponentResult"/> by specifying the <see cref="Type"/> of a view component to 262/// <param name="componentType">The view component <see cref="Type"/>.</param> 270public virtual ViewComponentResult ViewComponent(Type componentType, object? arguments)
DefaultHtmlGenerator.cs (5)
909var type = allowMultiple ? typeof(string[]) : typeof(string); 968var innerType = metadata.UnderlyingOrModelType; 989var valueType = value.GetType(); 1064internal static object GetModelStateValue(ViewContext viewContext, string key, Type destinationType) 1383private static Enum ConvertEnumFromInteger(object value, Type targetType)
DependencyInjection\MvcViewFeaturesMvcBuilderExtensions.cs (1)
48foreach (var viewComponent in feature.ViewComponents.Select(vc => vc.AsType()))
ExpressionHelper.cs (1)
244var declaringType = methodExpression.Method.DeclaringType;
ExpressionMetadataProvider.cs (1)
23Type containerType = null;
Filters\LifecycleProperty.cs (1)
20var propertyType = propertyInfo.PropertyType;
Filters\SaveTempDataPropertyFilterBase.cs (1)
84Type type)
Filters\TempDataApplicationModelProvider.cs (1)
34var modelType = controllerModel.ControllerType.AsType();
Filters\ValidateAntiforgeryTokenAuthorizationFilter.cs (1)
60public static partial void NotMostEffectiveFilter(ILogger logger, Type filterPolicy);
Filters\ViewDataAttributeApplicationModelProvider.cs (1)
26var controllerType = controllerModel.ControllerType.AsType();
Filters\ViewDataAttributePropertyProvider.cs (1)
11public static IReadOnlyList<LifecycleProperty> GetViewDataProperties(Type type)
HtmlAttributePropertyHelper.cs (4)
15private static readonly ConcurrentDictionary<Type, HtmlAttributePropertyHelper[]> ReflectionCache = 16new ConcurrentDictionary<Type, HtmlAttributePropertyHelper[]>(); 28public static void ClearCache(Type[] _) 35public static HtmlAttributePropertyHelper[] GetProperties(Type type)
HtmlHelper.cs (2)
368var type = typeof(TEnum); 383public IEnumerable<SelectListItem> GetEnumSelectList(Type enumType)
HtmlHelperOfT.cs (1)
70var runtimeType = viewContext.ViewData.ModelMetadata.ModelType;
Infrastructure\DefaultTempDataSerializer.cs (1)
217public override bool CanSerializeType(Type type)
Infrastructure\TempDataSerializer.cs (3)
29/// Defaults to returning <see langword="true"/> for all <see cref="Type"/> instances. 32/// <param name="type">The <see cref="Type"/>.</param> 34public virtual bool CanSerializeType(Type type) => true;
IViewComponentHelper.cs (2)
31/// <param name="componentType">The view component <see cref="Type"/>.</param> 39Task<IHtmlContent> InvokeAsync(Type componentType, object? arguments);
MemberExpressionCacheKey.cs (3)
11public MemberExpressionCacheKey(Type modelType, MemberExpression memberExpression) 18public MemberExpressionCacheKey(Type modelType, MemberInfo[] members) 41public Type ModelType { get; }
ModelExplorer.cs (11)
142public Type ModelType 301/// Gets a <see cref="ModelExplorer"/> for the provided model value and model <see cref="Type"/>. 303/// <param name="modelType">The model <see cref="Type"/>.</param> 308/// A <see cref="ModelExplorer"/> created by <see cref="GetExplorerForExpression(Type, object)"/> 316public ModelExplorer GetExplorerForExpression(Type modelType, object model) 325/// Gets a <see cref="ModelExplorer"/> for the provided model value and model <see cref="Type"/>. 349/// Gets a <see cref="ModelExplorer"/> for the provided model value and model <see cref="Type"/>. 351/// <param name="modelType">The model <see cref="Type"/>.</param> 357/// <see cref="GetExplorerForExpression(Type, Func{object, object})"/> 365public ModelExplorer GetExplorerForExpression(Type modelType, Func<object, object> modelAccessor) 374/// Gets a <see cref="ModelExplorer"/> for the provided model value and model <see cref="Type"/>.
ModelMetadataProviderExtensions.cs (2)
18/// <param name="modelType">The declared <see cref="Type"/> of the model object.</param> 25Type modelType,
Rendering\HtmlHelperComponentExtensions.cs (1)
51Type componentType,
Rendering\IHtmlHelper.cs (2)
388/// <param name="enumType"><see cref="Type"/> to generate a select list for.</param> 397IEnumerable<SelectListItem> GetEnumSelectList(Type enumType);
Rendering\ViewComponentHelperExtensions.cs (4)
33/// <param name="componentType">The view component <see cref="Type"/>.</param> 36public static Task<IHtmlContent> InvokeAsync(this IViewComponentHelper helper, Type componentType) 48/// <typeparam name="TComponent">The <see cref="Type"/> of the view component.</typeparam> 62/// <typeparam name="TComponent">The <see cref="Type"/> of the view component.</typeparam>
TemplateRenderer.cs (3)
162var fieldType = metadata.UnderlyingOrModelType; 169public static IEnumerable<string> GetTypeNames(ModelMetadata modelMetadata, Type fieldType) 202var type = fieldType;
TryGetValueProvider.cs (3)
15private static readonly Dictionary<Type, TryGetValueDelegate> _tryGetValueDelegateCache = 16new Dictionary<Type, TryGetValueDelegate>(); 28public static TryGetValueDelegate CreateInstance(Type targetType)
ViewComponentResult.cs (1)
36public Type? ViewComponentType { get; set; }
ViewComponentResultExecutor.cs (1)
167public static void ViewComponentResultExecuting(ILogger logger, Type viewComponentType)
ViewComponents\DefaultViewComponentDescriptorProvider.cs (1)
63private static MethodInfo FindMethod(Type componentType)
ViewComponents\DefaultViewComponentFactory.cs (3)
16private readonly Func<Type, PropertyActivator<ViewComponentContext>[]> _getPropertiesToActivate; 17private readonly ConcurrentDictionary<Type, PropertyActivator<ViewComponentContext>[]> _injectActions; 36_injectActions = new ConcurrentDictionary<Type, PropertyActivator<ViewComponentContext>[]>();
ViewComponents\DefaultViewComponentHelper.cs (2)
85public Task<IHtmlContent> InvokeAsync(Type componentType, object? arguments) 93private ViewComponentDescriptor SelectComponent(Type componentType)
ViewComponents\ServiceBasedViewComponentActivator.cs (1)
19var viewComponentType = context.ViewComponentDescriptor.TypeInfo.AsType();
ViewDataDictionary.cs (18)
24private readonly Type _declaredModelType; 51/// <see cref="Type"/> will not change e.g. when copying from a <see cref="ViewDataDictionary{TModel}"/> 85/// <see cref="Type"/> of <see cref="Model"/> values expected. Used to set <see cref="ModelMetadata"/>. 92Type declaredModelType) 106/// <see cref="Type"/> of <see cref="Model"/> values expected. Used to set <see cref="ModelMetadata"/>. 115Type declaredModelType) 136/// <see cref="Type"/> of <see cref="Model"/> values expected. Used to set <see cref="ModelMetadata"/>. 141/// <see cref="Model"/> <see cref="Type"/> is known but <see cref="Model"/> should be copied from the existing 148/// <see cref="ViewDataDictionary(ViewDataDictionary, object, Type)"/> to ignore <c>source.Model</c>. 151protected ViewDataDictionary(ViewDataDictionary source, Type declaredModelType) 164/// <see cref="Type"/> of <see cref="Model"/> values expected. Used to set <see cref="ModelMetadata"/>. 169/// <see cref="Model"/> <see cref="Type"/> and <see cref="Model"/> are known. 177protected ViewDataDictionary(ViewDataDictionary source, object? model, Type declaredModelType) 195var modelType = model?.GetType(); 196var modelOrDeclaredType = modelType ?? declaredModelType; 245Type declaredModelType, 279/// non-<c>null</c>), or the declared <see cref="Type"/>. 442var modelType = value?.GetType();
ViewDataDictionaryControllerPropertyActivator.cs (5)
16private readonly Func<Type, PropertyActivator<ControllerContext>[]> _getPropertiesToActivate; 18private ConcurrentDictionary<Type, PropertyActivator<ControllerContext>[]> _activateActions; 40var controllerType = controller.GetType(); 55var controllerType = actionDescriptor.ControllerTypeInfo?.AsType(); 78private PropertyActivator<ControllerContext>[] GetPropertiesToActivate(Type type)
ViewDataDictionaryFactory.cs (4)
12public static Func<IModelMetadataProvider, ModelStateDictionary, ViewDataDictionary> CreateFactory(Type modelType) 16var type = typeof(ViewDataDictionary<>).MakeGenericType(modelType); 33public static Func<ViewDataDictionary, ViewDataDictionary> CreateNestedFactory(Type modelType) 37var type = typeof(ViewDataDictionary<>).MakeGenericType(modelType);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (84)
ControllerTest.cs (3)
386public static TheoryData<object, Type> IncompatibleModelData 391return new TheoryData<object, Type> 405public void ViewDataModelSetter_DoesNotThrow(object model, Type expectedType)
DefaultEditorTemplatesTest.cs (1)
1520public IEnumerable<SelectListItem> GetEnumSelectList(Type enumType)
ExpressionHelperTest.cs (2)
23var modelType = typeof(TestModel); 64(Expression<Func<TestModel, Type>>)(model => modelType),
ExpressionMetadataProviderTest.cs (1)
120Type expectedType)
Filters\AntiforgeryApplicationModelProviderTest.cs (6)
49public void WorksWithAttributesOnController(Type controllerType, Type filterType) 76public void WorksWithAttributesOnDerivedController(Type controllerType, Type filterType) 128public void ThrowsIfMultipleAntiforgeryAttributesAreApplied(Type controllerType) 142private static ApplicationModelProviderContext CreateProviderContext(Type controllerType)
Filters\ControllerSaveTempDataPropertyFilterTest.cs (4)
28var controllerType = controller.GetType(); 73var controllerType = controller.GetType(); 117var controllerType = controller.GetType(); 156var controllerType = controller.GetType();
Filters\ControllerViewDataAttributeFilterTest.cs (1)
53var type = typeof(TestController);
Filters\TempDataApplicationModelProviderTest.cs (6)
18var type = typeof(TestController_NoTempDataProperties); 35var type = typeof(TestController_PrivateSet); 50var type = typeof(TestController_InvalidProperties); 67var type = typeof(TestController_OneTempDataProperty); 90var type = typeof(TestController_OneTempDataProperty); 112private static ApplicationModelProviderContext GetContext(Type type)
Filters\ViewDataAttributeApplicationModelProviderTest.cs (3)
17var type = typeof(TestController_NoViewDataProperties); 33var type = typeof(TestController_NullableNonPrimitiveViewDataProperty); 65private static ApplicationModelProviderContext GetContext(Type type)
Filters\ViewDataAttributePropertyProviderTest.cs (4)
12var type = typeof(TestController_NoViewDataProperties); 25var type = typeof(BaseController); 44var type = typeof(DerivedController); 60var type = typeof(PropertyWithKeyController);
ModelExplorerExtensionsTest.cs (3)
10public static TheoryData<object, Type, string> SimpleDisplayTextData 14return new TheoryData<object, Type, string> 47Type modelType,
ModelExplorerTest.cs (2)
18var modelType = modelExplorer.ModelType; 32var modelType = modelExplorer.ModelType;
Rendering\HtmlHelperSelectTest.cs (4)
1309.Setup(s => s.Create(It.IsAny<Type>())) 1402public static TheoryData<Type, IEnumerable<SelectListItem>> GetEnumSelectListData 1406return new TheoryData<Type, IEnumerable<SelectListItem>> 1490public void GetEnumSelectList_ReturnsExpectedItems(Type type, IEnumerable<SelectListItem> expected)
TemplateRendererTest.cs (3)
12public static TheoryData<Type, string[]> TypeNameData 16return new TheoryData<Type, string[]> 46public void GetTypeNames_ReturnsExpectedResults(Type fieldType, string[] expectedResult)
TestApplicationPart.cs (2)
27public TestApplicationPart(IEnumerable<Type> types) 32public TestApplicationPart(params Type[] types)
ViewComponentResultTest.cs (2)
410var helper = Mock.Of<IViewComponentHelper>(h => h.InvokeAsync(It.IsAny<Type>(), It.IsAny<object>()) == result); 452var helper = Mock.Of<IViewComponentHelper>(h => h.InvokeAsync(It.IsAny<Type>(), It.IsAny<object>()) == result);
ViewComponents\DefaultViewComponentActivatorTests.cs (3)
22.Setup(ta => ta.CreateInstance<object>(It.IsAny<IServiceProvider>(), It.IsAny<Type>())) 46.Setup(ta => ta.CreateInstance<object>(It.IsAny<IServiceProvider>(), It.IsAny<Type>())) 81private static ViewComponentContext CreateContext(Type componentType)
ViewComponents\DefaultViewComponentDescriptorProviderTest.cs (7)
15public void GetViewComponents_ThrowsIfTypeHasNoInvocationMethods(Type type) 30public void GetViewComponents_ThrowsIfTypeHasAmbiguousInvocationMethods(Type type) 46public void GetViewComponents_ThrowsIfInvokeAsyncDoesNotHaveCorrectReturnType(Type type) 60public void GetViewComponents_ThrowsIfInvokeReturnsATask(Type type) 75var type = typeof(VoidReturningInvokeViewComponent); 155private DefaultViewComponentDescriptorProvider CreateProvider(Type componentType) 163public FilteredViewComponentDescriptorProvider(params Type[] allowedTypes)
ViewComponents\DefaultViewComponentHelperTest.cs (3)
155private ViewComponentDescriptor CreateDescriptorForType(Type componentType) 176private DefaultViewComponentDescriptorProvider CreateProvider(Type componentType) 184public FilteredViewComponentDescriptorProvider(params Type[] allowedTypes)
ViewComponents\DefaultViewComponentSelectorTest.cs (2)
245public FilteredViewComponentDescriptorProvider(params Type[] allowedTypes) 250private static ApplicationPartManager GetApplicationPartManager(IEnumerable<Type> types)
ViewComponents\ViewComponentContextTest.cs (3)
60public static TheoryData<object, Type> IncompatibleModelData 65return new TheoryData<object, Type> 81Type expectedType)
ViewComponents\ViewComponentConventionsTest.cs (3)
46public void IsComponent(Type type, bool expected) 65public void GetComponentName(Type type, string expected) 84public void GetComponentFullName(Type type, string expected)
ViewComponents\ViewComponentFeatureProviderTest.cs (1)
49public TestPart(params Type[] types)
ViewDataDictionaryOfTModelTest.cs (4)
183var expectedType = typeof(string); 223public static TheoryData<object, Type> IncompatibleModelData 228return new TheoryData<object, Type> 245Type expectedType)
ViewDataDictionaryTest.cs (11)
115public static TheoryData<object, Type> IncompatibleModelData 120return new TheoryData<object, Type> 135public void SetModel_Throws_IfModelIncompatibleWithDeclaredType(object model, Type expectedType) 214public static TheoryData<Type, object> CopyModelMetadataData 220return new TheoryData<Type, object> 236public void CopyConstructor_CopiesModelMetadata(Type type, object instance) 273Type sourceType, 275Type expectedType) 299public void ModelSetter_PreservesSourceMetadata_IfModelCompatible(Type sourceType, object model) 345public void ModelSetter_DifferentType_UpdatesModelMetadata(Type originalMetadataType) 824public TestViewDataDictionary(IModelMetadataProvider metadataProvider, Type declaredModelType)
Microsoft.AspNetCore.Mvc.Views.TestCommon (4)
TestRazorCompiledItem.cs (4)
16public static RazorCompiledItem CreateForPage(Type type, string identifier, object[] metadata = null) 26public static RazorCompiledItem CreateForView(Type type, string identifier, object[] metadata = null) 31public TestRazorCompiledItem(Type type, string kind, string identifier, object[] metadata) 45public override Type Type { get; }
Microsoft.AspNetCore.OpenApi (116)
Extensions\JsonNodeSchemaExtensions.cs (3)
28private static readonly Dictionary<Type, OpenApiSchema> _simpleTypeToOpenApiSchema = new() 190var type = context.TypeInfo.Type; 191var underlyingType = Nullable.GetUnderlyingType(type);
Extensions\JsonTypeInfoExtensions.cs (4)
14private static readonly Dictionary<Type, string> _simpleTypeToName = new() 55var type = jsonTypeInfo.Type; 56var underlyingType = Nullable.GetUnderlyingType(type); 85internal static string GetSchemaReferenceId(this Type type, JsonSerializerOptions options)
Schemas\OpenApiJsonSchema.cs (1)
18public override OpenApiJsonSchema? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Services\OpenApiConstants.cs (1)
32internal static readonly List<Type> PrimitiveTypes =
Services\OpenApiDocumentService.cs (3)
680private static Type GetTargetType(ApiDescription description, ApiParameterDescription parameter) 685var parameterType = parameter.Type is not null 698var targetType = requiresModelMetadataFallbackForEnum || hasTryParse
Services\OpenApiGenerator.cs (8)
101var responseType = method.ReturnType; 113var defaultErrorType = errorMetadata?.Type; 118var eligibileAnnotations = new Dictionary<int, (Type?, MediaTypeCollection)>(); 124var discoveredTypeAnnotation = responseMetadata.Type; 155var discoveredTypeAnnotation = providerMetadata.Type; 220private static void GenerateDefaultContent(MediaTypeCollection discoveredContentTypeAnnotation, Type? discoveredTypeAnnotation) 239private static void GenerateDefaultResponses(Dictionary<int, (Type?, MediaTypeCollection)> eligibleAnnotations, Type responseType)
Services\Schemas\OpenApiSchemaKey.cs (1)
12internal record struct OpenApiSchemaKey(Type Type, ParameterInfo? ParameterInfo);
Services\Schemas\OpenApiSchemaService.cs (3)
61var type = context.TypeInfo.Type; 129internal async Task<OpenApiSchema> GetOrCreateSchemaAsync(Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, bool captureSchemaByRef = false, CancellationToken cancellationToken = default) 149internal async Task ApplySchemaTransformersAsync(OpenApiSchema schema, Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, CancellationToken cancellationToken = default)
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (9)
20public Type AwaiterType { get; } 25public Type ResultType { get; } 29Type awaiterType, 34Type resultType, 48Type type, 54var getAwaiterMethod = type.GetMethod("GetAwaiter", Everything, Type.EmptyTypes); 62var awaiterType = getAwaiterMethod.ReturnType; 65var isCompletedProperty = awaiterType.GetProperty("IsCompleted", Everything, binder: null, returnType: typeof(bool), types: Type.EmptyTypes, modifiers: null); 93var getResultMethod = awaiterType.GetMethod("GetResult", Everything, Type.EmptyTypes);
src\Shared\ObjectMethodExecutor\CoercedAwaitableInfo.cs (5)
15public Type CoercerResultType { get; } 25public CoercedAwaitableInfo(Expression coercerExpression, Type coercerResultType, AwaitableInfo coercedAwaitableInfo) 35[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type, 43out var nonGenericAwaitableType)) 61out var coercerResultType))
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (9)
68var isAwaitable = IsTaskType(MethodReturnType, out var resultType); 96public Type? AsyncResultType { get; } 99public Type MethodReturnType { get; internal set; } 281var postCoercionMethodReturnType = coercedAwaitableInfo.CoercerResultType ?? methodInfo.ReturnType; 398private static bool IsTaskType(Type methodReturnType, [NotNullWhen(true)] out Type? resultType) 412var currentType = methodReturnType; 437private static MethodExecutorAsync? GetExecutorAsyncTrimAotCompatible(MethodInfo methodInfo, Type asyncResultType) 439var methodReturnType = methodInfo.ReturnType;
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (20)
59Type possibleFSharpAsyncType, 61out Type awaitableType) 63var methodReturnGenericType = possibleFSharpAsyncType.IsGenericType 74var awaiterResultType = possibleFSharpAsyncType.GetGenericArguments().Single(); 98TryBuildCoercerFromUnitAwaitableToVoidAwaitable(awaitableType, out var coercerExpression, out var nonGenericAwaitableType) 132Type genericAwaitableType, 134out Type nonGenericAwaitableType) 152static Expression MakeTaskOfUnitToTaskExpression(Type type) 158static Expression MakeValueTaskOfUnitToValueTaskExpression(Type type) 172private static bool IsFSharpAsyncOpenGenericType(Type possibleFSharpAsyncType) => 176private static bool IsFSharpUnit(Type possibleFSharpUnitType) => 180private static bool IsCoerceableFSharpType(Type possibleFSharpType, string coerceableFSharpTypeName) 206private static bool TryPopulateFSharpValueCaches(Type possibleFSharpType) 209var fsharpOptionType = assembly.GetType(FSharpOptionTypeName); 210var fsharpAsyncType = assembly.GetType(FSharpAsyncTypeName); 211var fsharpAsyncGenericType = assembly.GetType(FSharpAsyncGenericTypeName); 219var fsharpOptionOfTaskCreationOptionsType = fsharpOptionType 225var fsharpOptionOfCancellationTokenType = fsharpOptionType 252private static bool TypesHaveSameIdentity(Type type1, Type type2)
src\Shared\ParameterBindingMethodCache.cs (29)
46private readonly ConcurrentDictionary<Type, Func<ParameterExpression, Expression, Expression>?> _stringMethodCallCache = new(); 47private readonly ConcurrentDictionary<Type, (Func<ParameterInfo, Expression>?, int)> _bindAsyncMethodCallCache = new(); 48private readonly ConcurrentDictionary<Type, (ConstructorInfo?, ConstructorParameter[])> _constructorCache = new(); 67public bool HasTryParseMethod(Type type) 69var nonNullableParameterType = Nullable.GetUnderlyingType(type) ?? type; 80public Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type type) 85Func<ParameterExpression, Expression, Expression>? Finder(Type type) 149Type t when t == typeof(DateTime) => DateTimeStyles.AdjustToUniversal | DateTimeStyles.AllowWhiteSpaces, 150Type t when t == typeof(DateTimeOffset) => DateTimeStyles.AssumeUniversal | DateTimeStyles.AllowWhiteSpaces, 218(Func<ParameterInfo, Expression>?, int) Finder(Type nonNullableParameterType) 240var valueTaskResultType = methodInfo.ReturnType.GetGenericArguments()[0]; 302var nonNullableParameterType = Nullable.GetUnderlyingType(parameter.ParameterType) ?? parameter.ParameterType; 313public (ConstructorInfo?, ConstructorParameter[]) FindConstructor(Type type) 315static (ConstructorInfo? constructor, ConstructorParameter[] parameters) Finder(Type type) 359private static ConstructorInfo? GetConstructor(Type type) 410private static MethodInfo? GetIBindableFromHttpContextMethod(Type type) 413foreach (var i in type.GetInterfaces()) 431private static bool TryGetExplicitIParsableTryParseMethod(Type type, out MethodInfo methodInfo) 442private MethodInfo? GetStaticMethodFromHierarchy(Type type, string name, Type[] parameterTypes, Func<MethodInfo, bool> validateReturnType) 456foreach (var implementedInterface in type.GetInterfaces()) 480private static MethodInfo? GetAnyMethodFromHierarchy(Type type, string name) 491foreach (var implementedInterface in type.GetInterfaces()) 513new[] { typeof(Type), typeof(string), typeof(object).MakeByRefType() }); 520new[] { typeof(string), Type.MakeGenericMethodParameter(0).MakeByRefType() }); 532private static bool TryGetDateTimeTryParseMethod(Type type, [NotNullWhen(true)] out MethodInfo? methodInfo) 568private static bool TryGetNumberStylesTryGetMethod(Type type, [NotNullWhen(true)] out MethodInfo? method, [NotNullWhen(true)] out NumberStyles? numberStyles) 709public ParameterLookupKey(string name, Type type) 716public Type Type { get; }
src\Shared\PropertyAsParameterInfo.cs (4)
140public override object[] GetCustomAttributes(Type attributeType, bool inherit) 187public override Type[] GetOptionalCustomModifiers() 190public override Type[] GetRequiredCustomModifiers() 193public override bool IsDefined(Type attributeType, bool inherit)
src\Shared\RoslynUtils\TypeHelper.cs (1)
22internal static bool IsCompilerGeneratedType(Type? type = null)
src\Shared\TypeNameHelper\TypeNameHelper.cs (9)
17private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 46/// <param name="type">The <see cref="Type"/>.</param> 52public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 59private static void ProcessType(StringBuilder builder, Type type, in DisplayNameOptions options) 93private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 95var innerType = type; 112private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
Transformers\TypeBasedOpenApiDocumentTransformer.cs (2)
14private readonly Type _transformerType; 17internal TypeBasedOpenApiDocumentTransformer([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type transformerType)
Transformers\TypeBasedOpenApiOperationTransformer.cs (2)
14private readonly Type _transformerType; 17internal TypeBasedOpenApiOperationTransformer([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type transformerType)
Transformers\TypeBasedOpenApiSchemaTransformer.cs (2)
14private readonly Type _transformerType; 17internal TypeBasedOpenApiSchemaTransformer([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type transformerType)
Microsoft.AspNetCore.OpenApi.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.OpenApi.Tests (7)
Extensions\JsonTypeInfoExtensionsTests.cs (1)
81public void GetSchemaReferenceId_Works(Type type, string referenceId)
Services\OpenApiDocumentServiceTestsBase.cs (4)
184public ControllerActionDescriptor CreateActionDescriptor(string methodName = null, Type controllerType = null) 287public object GetKeyedService(Type serviceType, object serviceKey) 305public object GetRequiredKeyedService(Type serviceType, object serviceKey) 323public object GetService(Type serviceType)
Services\OpenApiGeneratorTests.cs (1)
1025public bool IsService(Type serviceType) => serviceType == typeof(IInferredServiceInterface);
Services\OpenApiSchemaService\OpenApiSchemaService.ParameterSchemas.cs (1)
567public override CustomType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Microsoft.AspNetCore.OutputCaching (3)
OutputCachePolicyBuilder.cs (1)
46public OutputCachePolicyBuilder AddPolicy([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type policyType)
Policies\TypedPolicy.cs (2)
18private readonly Type _policyType; 24public TypedPolicy([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type policyType)
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
src\Shared\ThrowHelpers\ObjectDisposedThrowHelper.cs (1)
34public static void ThrowIf([DoesNotReturnIf(true)] bool condition, Type type)
Microsoft.AspNetCore.Owin (22)
OwinEnvironment.cs (6)
318public FeatureMap(Type featureInterface, Func<object, object> getter) 329public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory) 340public FeatureMap(Type featureInterface, Func<object, object> getter, Action<object, object> setter) 352public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory, Action<object, object> setter) 365public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory, Action<object, object> setter, Func<object> featureFactory) 374private Type FeatureInterface { get; set; }
OwinExtensions.cs (1)
185public object GetService(Type serviceType)
OwinFeatureCollection.cs (15)
337public object this[Type key] 343private bool SupportsInterface(Type key) 365public object Get(Type key) 375public void Set(Type key, object value) 398public IEnumerator<KeyValuePair<Type, object>> GetEnumerator() 400yield return new KeyValuePair<Type, object>(typeof(IHttpRequestFeature), this); 401yield return new KeyValuePair<Type, object>(typeof(IHttpResponseFeature), this); 402yield return new KeyValuePair<Type, object>(typeof(IHttpResponseBodyFeature), this); 403yield return new KeyValuePair<Type, object>(typeof(IHttpConnectionFeature), this); 404yield return new KeyValuePair<Type, object>(typeof(IHttpRequestIdentifierFeature), this); 405yield return new KeyValuePair<Type, object>(typeof(IHttpRequestLifetimeFeature), this); 406yield return new KeyValuePair<Type, object>(typeof(IHttpAuthenticationFeature), this); 407yield return new KeyValuePair<Type, object>(typeof(IOwinEnvironmentFeature), this); 412yield return new KeyValuePair<Type, object>(typeof(ITlsConnectionFeature), this); 416yield return new KeyValuePair<Type, object>(typeof(IHttpWebSocketFeature), this);
Microsoft.AspNetCore.Razor.Runtime (5)
Hosting\DefaultRazorCompiledItem.cs (2)
10public DefaultRazorCompiledItem(Type type, string kind, string identifier) 38public override Type Type { get; }
Hosting\RazorCompiledItem.cs (1)
35public abstract Type Type { get; }
Hosting\RazorCompiledItemAttribute.cs (2)
23public RazorCompiledItemAttribute(Type type, string kind, string identifier) 49public Type Type { get; }
Microsoft.AspNetCore.RequestDecompression.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.RequestDecompression.Tests (1)
DefaultRequestDecompressionProviderTests.cs (1)
25Type expectedProviderType)
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.ResponseCompression (4)
CompressionProviderCollection.cs (1)
33public void Add([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type providerType)
CompressionProviderFactory.cs (3)
15public CompressionProviderFactory([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type providerType) 21private Type ProviderType { get; } 27return (ICompressionProvider)ActivatorUtilities.CreateInstance(serviceProvider, ProviderType, Type.EmptyTypes);
Microsoft.AspNetCore.ResponseCompression.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.Routing (52)
Builder\EndpointFilterExtensions.cs (1)
45filterFactory = ActivatorUtilities.CreateFactory(typeof(TFilterType), Type.EmptyTypes);
Builder\EndpointRouteBuilderExtensions.cs (1)
471public object? GetService(Type serviceType) => null;
Builder\OpenApiRouteHandlerBuilderExtensions.cs (4)
73Type? responseType = null, 77if (responseType is Type && string.IsNullOrEmpty(contentType)) 255Type requestType, 274Type requestType,
DefaultInlineConstraintResolver.cs (1)
21private readonly IDictionary<string, Type> _inlineConstraintMap;
Matching\ILEmitTrieFactory.cs (3)
666types: new[] { Type.MakeGenericMethodParameter(0).MakeByRefType(), typeof(int), }, 680types: new[] { Type.MakeGenericMethodParameter(0).MakeByRefType(), }, 705types: new[] { typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), },
ParameterPolicyActivator.cs (7)
18IDictionary<string, Type> inlineParameterPolicyMap, 32out var parameterPolicyType)) 70IDictionary<string, Type> inlineParameterPolicyMap, 74[NotNullWhen(true)] out Type? policyType) 97private static IParameterPolicy CreateParameterPolicy(IServiceProvider? serviceProvider, Type parameterPolicyType, string? argumentString) 159private static ConstructorInfo GetLongestConstructor(List<ConstructorInfo> constructors, Type parameterPolicyType) 218var parameterType = parameter.ParameterType;
RegexInlineRouteConstraintSetup.cs (1)
14var existingRegexConstraintType = options.TrimmerSafeConstraintMap["regex"];
RouteGroupContext.cs (1)
43public object? GetService(Type serviceType) => null;
RouteOptions.cs (7)
23private IDictionary<string, Type> _constraintTypeMap = GetDefaultConstraintMap(); 81public IDictionary<string, Type> ConstraintMap 100internal IDictionary<string, Type> TrimmerSafeConstraintMap => _constraintTypeMap; 102private static IDictionary<string, Type> GetDefaultConstraintMap() 104var defaults = new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase); 163public void SetParameterPolicy(string token, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type) 173private static void AddConstraint<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TConstraint>(Dictionary<string, Type> constraintMap, string text) where TConstraint : IRouteConstraint
src\Shared\Json\JsonSerializerExtensions.cs (3)
16public static bool ShouldUseWith(this JsonTypeInfo jsonTypeInfo, [NotNullWhen(false)] Type? runtimeType) 19public static JsonTypeInfo GetReadOnlyTypeInfo(this JsonSerializerOptions options, Type type) 25public static JsonTypeInfo GetRequiredTypeInfo(this JsonSerializerContext context, Type type)
src\Shared\PropertyHelper\PropertyHelper.cs (21)
41private static readonly ConcurrentDictionary<Type, PropertyHelper[]> PropertiesCache = new(); 43private static readonly ConcurrentDictionary<Type, PropertyHelper[]> VisiblePropertiesCache = new(); 50/// This constructor does not cache the helper. For caching, use <see cref="GetProperties(Type)"/>. 123[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 144[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 244Type openGenericDelegateType, 248var typeInput = propertyGetMethod.DeclaringType!; 249var typeOutput = propertyGetMethod.ReturnType; 251var delegateType = openGenericDelegateType.MakeGenericType(typeInput, typeOutput); 290var typeInput = setMethod.DeclaringType!; 291var parameterType = parameters[0].ParameterType; 412Type type, 413ConcurrentDictionary<Type, PropertyHelper[]>? allPropertiesCache, 414ConcurrentDictionary<Type, PropertyHelper[]>? visiblePropertiesCache) 444var declaringType = propertyHelper.Property.DeclaringType; 457Type? currentType = type; 493Type type, 494ConcurrentDictionary<Type, PropertyHelper[]>? cache) 509foreach (var @interface in type.GetInterfaces()) 523[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 562public static void ClearCache(Type[]? _)
src\Shared\RoslynUtils\TypeHelper.cs (1)
22internal static bool IsCompilerGeneratedType(Type? type = null)
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
41var runtimeType = value?.GetType();
Microsoft.AspNetCore.Routing.Abstractions (21)
src\Shared\PropertyHelper\PropertyHelper.cs (21)
41private static readonly ConcurrentDictionary<Type, PropertyHelper[]> PropertiesCache = new(); 43private static readonly ConcurrentDictionary<Type, PropertyHelper[]> VisiblePropertiesCache = new(); 50/// This constructor does not cache the helper. For caching, use <see cref="GetProperties(Type)"/>. 123[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 144[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 244Type openGenericDelegateType, 248var typeInput = propertyGetMethod.DeclaringType!; 249var typeOutput = propertyGetMethod.ReturnType; 251var delegateType = openGenericDelegateType.MakeGenericType(typeInput, typeOutput); 290var typeInput = setMethod.DeclaringType!; 291var parameterType = parameters[0].ParameterType; 412Type type, 413ConcurrentDictionary<Type, PropertyHelper[]>? allPropertiesCache, 414ConcurrentDictionary<Type, PropertyHelper[]>? visiblePropertiesCache) 444var declaringType = propertyHelper.Property.DeclaringType; 457Type? currentType = type; 493Type type, 494ConcurrentDictionary<Type, PropertyHelper[]>? cache) 509foreach (var @interface in type.GetInterfaces()) 523[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 562public static void ClearCache(Type[]? _)
Microsoft.AspNetCore.Routing.Microbenchmarks (9)
EndpointMetadataCollectionBenchmark.cs (1)
20var seeds = new Type[]
src\Http\Routing\test\UnitTests\TestObjects\TestServiceProvider.cs (1)
8public object GetService(Type serviceType) => null;
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.Routing.Tests (11)
Builder\FallbackEndpointRouteBuilderExtensionsTest.cs (1)
51public object? GetService(Type serviceType) => null;
Builder\GroupTest.cs (1)
400public object? GetService(Type serviceType) => null;
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (1)
597public object? GetService(Type serviceType) => null;
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (4)
1106public TestConsumesAttribute(Type requestType, string contentType, params string[] otherContentTypes) 1125Type? IAcceptsMetadata.RequestType => _requestType; 1129Type? _requestType; 1173public object? GetService(Type serviceType)
EndpointMiddlewareTest.cs (1)
418public object GetService(Type serviceType)
RouterMiddlewareTest.cs (1)
149public object GetService(Type serviceType)
RoutingServiceCollectionExtensionsTests.cs (1)
80var regexRouteConstraintType = options.Value.ConstraintMap["regex"];
TestObjects\TestServiceProvider.cs (1)
8public object GetService(Type serviceType) => null;
Microsoft.AspNetCore.Security.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.Server.HttpSys (6)
StandardFeatureCollection.cs (6)
14private static readonly Dictionary<Type, Func<RequestContext, object?>> _featureFuncLookup = new() 70public object? this[Type key] 91return ((IEnumerable<KeyValuePair<Type, object>>)this).GetEnumerator(); 94IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() 101yield return new KeyValuePair<Type, object>(featureFunc.Key, feature);
Microsoft.AspNetCore.Server.HttpSys.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.Server.IIS (78)
Core\IISHttpContext.FeatureCollection.cs (9)
47private List<KeyValuePair<Type, object>>? MaybeExtra; 56private object? ExtraFeatureGet(Type key) 73private void ExtraFeatureSet(Type key, object? value) 94MaybeExtra = new List<KeyValuePair<Type, object>>(2); 100MaybeExtra[i] = new KeyValuePair<Type, object>(key, value); 104MaybeExtra.Add(new KeyValuePair<Type, object>(key, value)); 311object? IFeatureCollection.this[Type key] 431IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() => FastEnumerable().GetEnumerator();
Core\IISHttpContext.Features.cs (55)
8private static readonly Type IHttpRequestFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpRequestFeature); 9private static readonly Type IHttpRequestBodyDetectionFeature = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpRequestBodyDetectionFeature); 10private static readonly Type IHttpResponseFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpResponseFeature); 11private static readonly Type IHttpResponseBodyFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpResponseBodyFeature); 12private static readonly Type IHttpRequestIdentifierFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpRequestIdentifierFeature); 13private static readonly Type IServiceProvidersFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IServiceProvidersFeature); 14private static readonly Type IHttpRequestLifetimeFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpRequestLifetimeFeature); 15private static readonly Type IHttpConnectionFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpConnectionFeature); 16private static readonly Type IHttpAuthenticationFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.Authentication.IHttpAuthenticationFeature); 17private static readonly Type IQueryFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IQueryFeature); 18private static readonly Type IFormFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IFormFeature); 19private static readonly Type IHttpUpgradeFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpUpgradeFeature); 20private static readonly Type IResponseCookiesFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IResponseCookiesFeature); 21private static readonly Type IItemsFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IItemsFeature); 22private static readonly Type ITlsConnectionFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.ITlsConnectionFeature); 23private static readonly Type ITlsHandshakeFeatureType = typeof(global::Microsoft.AspNetCore.Connections.Features.ITlsHandshakeFeature); 24private static readonly Type IHttpWebSocketFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpWebSocketFeature); 25private static readonly Type ISessionFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.ISessionFeature); 26private static readonly Type IHttpBodyControlFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpBodyControlFeature); 27private static readonly Type IISHttpContextType = typeof(IISHttpContext); 28private static readonly Type IServerVariablesFeature = typeof(global::Microsoft.AspNetCore.Http.Features.IServerVariablesFeature); 29private static readonly Type IHttpMaxRequestBodySizeFeature = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpMaxRequestBodySizeFeature); 30private static readonly Type IHttpResponseTrailersFeature = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpResponseTrailersFeature); 31private static readonly Type IHttpResetFeature = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpResetFeature); 32private static readonly Type IConnectionLifetimeNotificationFeature = typeof(global::Microsoft.AspNetCore.Connections.Features.IConnectionLifetimeNotificationFeature); 33private static readonly Type IHttpActivityFeature = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpActivityFeature); 34private static readonly Type IHttpSysRequestInfoFeature = typeof(global::Microsoft.AspNetCore.Server.HttpSys.IHttpSysRequestInfoFeature); 35private static readonly Type IHttpSysRequestTimingFeature = typeof(global::Microsoft.AspNetCore.Server.HttpSys.IHttpSysRequestTimingFeature); 90internal object? FastFeatureGet(Type key) 208internal void FastFeatureSet(Type key, object? feature) 353private IEnumerable<KeyValuePair<Type, object>> FastEnumerable() 357yield return new KeyValuePair<Type, object>(IHttpRequestFeatureType, _currentIHttpRequestFeature); 361yield return new KeyValuePair<Type, object>(IHttpRequestBodyDetectionFeature, _currentIHttpRequestBodyDetectionFeature); 365yield return new KeyValuePair<Type, object>(IHttpResponseFeatureType, _currentIHttpResponseFeature); 369yield return new KeyValuePair<Type, object>(IHttpResponseBodyFeatureType, _currentIHttpResponseBodyFeature); 373yield return new KeyValuePair<Type, object>(IHttpRequestIdentifierFeatureType, _currentIHttpRequestIdentifierFeature); 377yield return new KeyValuePair<Type, object>(IServiceProvidersFeatureType, _currentIServiceProvidersFeature); 381yield return new KeyValuePair<Type, object>(IHttpRequestLifetimeFeatureType, _currentIHttpRequestLifetimeFeature); 385yield return new KeyValuePair<Type, object>(IHttpConnectionFeatureType, _currentIHttpConnectionFeature); 389yield return new KeyValuePair<Type, object>(IHttpAuthenticationFeatureType, _currentIHttpAuthenticationFeature); 393yield return new KeyValuePair<Type, object>(IQueryFeatureType, _currentIQueryFeature); 397yield return new KeyValuePair<Type, object>(IFormFeatureType, _currentIFormFeature); 401yield return new KeyValuePair<Type, object>(IHttpUpgradeFeatureType, _currentIHttpUpgradeFeature); 405yield return new KeyValuePair<Type, object>(IResponseCookiesFeatureType, _currentIResponseCookiesFeature); 409yield return new KeyValuePair<Type, object>(IItemsFeatureType, _currentIItemsFeature); 413yield return new KeyValuePair<Type, object>(ITlsConnectionFeatureType, _currentITlsConnectionFeature); 417yield return new KeyValuePair<Type, object>(ITlsHandshakeFeatureType, _currentITlsHandshakeFeature); 421yield return new KeyValuePair<Type, object>(IHttpWebSocketFeatureType, _currentIHttpWebSocketFeature); 425yield return new KeyValuePair<Type, object>(ISessionFeatureType, _currentISessionFeature); 429yield return new KeyValuePair<Type, object>(IHttpBodyControlFeatureType, _currentIHttpBodyControlFeature); 433yield return new KeyValuePair<Type, object>(IServerVariablesFeature, _currentIServerVariablesFeature); 437yield return new KeyValuePair<Type, object>(IHttpMaxRequestBodySizeFeature, _currentIHttpMaxRequestBodySizeFeature); 441yield return new KeyValuePair<Type, object>(IHttpResponseTrailersFeature, _currentIHttpResponseTrailersFeature); 445yield return new KeyValuePair<Type, object>(IHttpResponseTrailersFeature, _currentIHttpResetFeature); 449yield return new KeyValuePair<Type, object>(IHttpActivityFeature, _currentIHttpActivityFeature);
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (5)
84var type = method.DeclaringType; 116var parameterType = parameter.ParameterType; 161var type = method.DeclaringType; 196private static bool TryResolveStateMachineMethod(ref MethodBase method, out Type? declaringType) 203var parentType = declaringType.DeclaringType;
src\Shared\TypeNameHelper\TypeNameHelper.cs (9)
17private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 46/// <param name="type">The <see cref="Type"/>.</param> 52public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 59private static void ProcessType(StringBuilder builder, Type type, in DisplayNameOptions options) 93private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 95var innerType = type; 112private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
Microsoft.AspNetCore.Server.Kestrel.Core (45)
Internal\Http\HttpProtocol.Generated.cs (45)
81private List<KeyValuePair<Type, object>>? MaybeExtra; 131private object? ExtraFeatureGet(Type key) 148private void ExtraFeatureSet(Type key, object? value) 169MaybeExtra = new List<KeyValuePair<Type, object>>(2); 175MaybeExtra[i] = new KeyValuePair<Type, object>(key, value); 179MaybeExtra.Add(new KeyValuePair<Type, object>(key, value)); 187object? IFeatureCollection.this[Type key] 804private IEnumerable<KeyValuePair<Type, object>> FastEnumerable() 808yield return new KeyValuePair<Type, object>(typeof(IHttpRequestFeature), _currentIHttpRequestFeature); 812yield return new KeyValuePair<Type, object>(typeof(IHttpResponseFeature), _currentIHttpResponseFeature); 816yield return new KeyValuePair<Type, object>(typeof(IHttpResponseBodyFeature), _currentIHttpResponseBodyFeature); 820yield return new KeyValuePair<Type, object>(typeof(IRouteValuesFeature), _currentIRouteValuesFeature); 824yield return new KeyValuePair<Type, object>(typeof(IEndpointFeature), _currentIEndpointFeature); 828yield return new KeyValuePair<Type, object>(typeof(IServiceProvidersFeature), _currentIServiceProvidersFeature); 832yield return new KeyValuePair<Type, object>(typeof(IHttpActivityFeature), _currentIHttpActivityFeature); 836yield return new KeyValuePair<Type, object>(typeof(IHttpMetricsTagsFeature), _currentIHttpMetricsTagsFeature); 840yield return new KeyValuePair<Type, object>(typeof(IItemsFeature), _currentIItemsFeature); 844yield return new KeyValuePair<Type, object>(typeof(IQueryFeature), _currentIQueryFeature); 848yield return new KeyValuePair<Type, object>(typeof(IRequestBodyPipeFeature), _currentIRequestBodyPipeFeature); 852yield return new KeyValuePair<Type, object>(typeof(IFormFeature), _currentIFormFeature); 856yield return new KeyValuePair<Type, object>(typeof(IHttpAuthenticationFeature), _currentIHttpAuthenticationFeature); 860yield return new KeyValuePair<Type, object>(typeof(IHttpRequestIdentifierFeature), _currentIHttpRequestIdentifierFeature); 864yield return new KeyValuePair<Type, object>(typeof(IHttpConnectionFeature), _currentIHttpConnectionFeature); 868yield return new KeyValuePair<Type, object>(typeof(ISessionFeature), _currentISessionFeature); 872yield return new KeyValuePair<Type, object>(typeof(IResponseCookiesFeature), _currentIResponseCookiesFeature); 876yield return new KeyValuePair<Type, object>(typeof(IHttpRequestTrailersFeature), _currentIHttpRequestTrailersFeature); 880yield return new KeyValuePair<Type, object>(typeof(IHttpResponseTrailersFeature), _currentIHttpResponseTrailersFeature); 884yield return new KeyValuePair<Type, object>(typeof(ITlsConnectionFeature), _currentITlsConnectionFeature); 888yield return new KeyValuePair<Type, object>(typeof(IHttpExtendedConnectFeature), _currentIHttpExtendedConnectFeature); 892yield return new KeyValuePair<Type, object>(typeof(IHttpUpgradeFeature), _currentIHttpUpgradeFeature); 896yield return new KeyValuePair<Type, object>(typeof(IHttpWebSocketFeature), _currentIHttpWebSocketFeature); 900yield return new KeyValuePair<Type, object>(typeof(IHttpWebTransportFeature), _currentIHttpWebTransportFeature); 904yield return new KeyValuePair<Type, object>(typeof(IBadRequestExceptionFeature), _currentIBadRequestExceptionFeature); 908yield return new KeyValuePair<Type, object>(typeof(IHttpRequestTimeoutFeature), _currentIHttpRequestTimeoutFeature); 912yield return new KeyValuePair<Type, object>(typeof(IHttp2StreamIdFeature), _currentIHttp2StreamIdFeature); 916yield return new KeyValuePair<Type, object>(typeof(IHttpRequestLifetimeFeature), _currentIHttpRequestLifetimeFeature); 920yield return new KeyValuePair<Type, object>(typeof(IHttpMaxRequestBodySizeFeature), _currentIHttpMaxRequestBodySizeFeature); 924yield return new KeyValuePair<Type, object>(typeof(IHttpMinRequestBodyDataRateFeature), _currentIHttpMinRequestBodyDataRateFeature); 928yield return new KeyValuePair<Type, object>(typeof(IHttpMinResponseDataRateFeature), _currentIHttpMinResponseDataRateFeature); 932yield return new KeyValuePair<Type, object>(typeof(IHttpBodyControlFeature), _currentIHttpBodyControlFeature); 936yield return new KeyValuePair<Type, object>(typeof(IHttpRequestBodyDetectionFeature), _currentIHttpRequestBodyDetectionFeature); 940yield return new KeyValuePair<Type, object>(typeof(IHttpResetFeature), _currentIHttpResetFeature); 944yield return new KeyValuePair<Type, object>(typeof(IPersistentStateFeature), _currentIPersistentStateFeature); 956IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() => FastEnumerable().GetEnumerator();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (8)
Http1\Http1HttpProtocolFeatureCollectionTests.cs (4)
66Type type = feature.Key; 201var type = item.Key; 228Type type = featureIter.Key; 245Type type = feature.Key;
KestrelEventSourceTests.cs (1)
17var esType = typeof(KestrelServer).Assembly.GetType(
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
23public List<Type> IgnoredExceptions { get; } = new List<Type>();
src\Servers\Kestrel\shared\test\TestApplicationErrorLoggerLoggedTest.cs (1)
32public List<Type> IgnoredCriticalLogExceptions => TestApplicationErrorLogger.IgnoredExceptions;
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (34)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
144internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, long? expectedLastStreamId, Http3ErrorCode expectedErrorCode, Action<Type, string[]> matchExpectedErrorMessage = null, params string[] expectedErrorMessage) 177private void AssertConnectionError<TException>(Http3ErrorCode expectedErrorCode, Action<Type, string[]> matchExpectedErrorMessage = null, params string[] expectedErrorMessage) where TException : Exception
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
23public List<Type> IgnoredExceptions { get; } = new List<Type>();
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (23)
42private List<KeyValuePair<Type, object>>? MaybeExtra; 70private object? ExtraFeatureGet(Type key) 87private void ExtraFeatureSet(Type key, object? value) 108MaybeExtra = new List<KeyValuePair<Type, object>>(2); 114MaybeExtra[i] = new KeyValuePair<Type, object>(key, value); 118MaybeExtra.Add(new KeyValuePair<Type, object>(key, value)); 126object? IFeatureCollection.this[Type key] 391private IEnumerable<KeyValuePair<Type, object>> FastEnumerable() 395yield return new KeyValuePair<Type, object>(typeof(IConnectionIdFeature), _currentIConnectionIdFeature); 399yield return new KeyValuePair<Type, object>(typeof(IConnectionTransportFeature), _currentIConnectionTransportFeature); 403yield return new KeyValuePair<Type, object>(typeof(IConnectionItemsFeature), _currentIConnectionItemsFeature); 407yield return new KeyValuePair<Type, object>(typeof(IPersistentStateFeature), _currentIPersistentStateFeature); 411yield return new KeyValuePair<Type, object>(typeof(IMemoryPoolFeature), _currentIMemoryPoolFeature); 415yield return new KeyValuePair<Type, object>(typeof(IConnectionLifetimeFeature), _currentIConnectionLifetimeFeature); 419yield return new KeyValuePair<Type, object>(typeof(IConnectionSocketFeature), _currentIConnectionSocketFeature); 423yield return new KeyValuePair<Type, object>(typeof(IProtocolErrorCodeFeature), _currentIProtocolErrorCodeFeature); 427yield return new KeyValuePair<Type, object>(typeof(IStreamDirectionFeature), _currentIStreamDirectionFeature); 431yield return new KeyValuePair<Type, object>(typeof(IStreamIdFeature), _currentIStreamIdFeature); 435yield return new KeyValuePair<Type, object>(typeof(IStreamAbortFeature), _currentIStreamAbortFeature); 439yield return new KeyValuePair<Type, object>(typeof(IStreamClosedFeature), _currentIStreamClosedFeature); 443yield return new KeyValuePair<Type, object>(typeof(IConnectionMetricsTagsFeature), _currentIConnectionMetricsTagsFeature); 455IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() => FastEnumerable().GetEnumerator();
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (23)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (23)
42private List<KeyValuePair<Type, object>>? MaybeExtra; 70private object? ExtraFeatureGet(Type key) 87private void ExtraFeatureSet(Type key, object? value) 108MaybeExtra = new List<KeyValuePair<Type, object>>(2); 114MaybeExtra[i] = new KeyValuePair<Type, object>(key, value); 118MaybeExtra.Add(new KeyValuePair<Type, object>(key, value)); 126object? IFeatureCollection.this[Type key] 391private IEnumerable<KeyValuePair<Type, object>> FastEnumerable() 395yield return new KeyValuePair<Type, object>(typeof(IConnectionIdFeature), _currentIConnectionIdFeature); 399yield return new KeyValuePair<Type, object>(typeof(IConnectionTransportFeature), _currentIConnectionTransportFeature); 403yield return new KeyValuePair<Type, object>(typeof(IConnectionItemsFeature), _currentIConnectionItemsFeature); 407yield return new KeyValuePair<Type, object>(typeof(IPersistentStateFeature), _currentIPersistentStateFeature); 411yield return new KeyValuePair<Type, object>(typeof(IMemoryPoolFeature), _currentIMemoryPoolFeature); 415yield return new KeyValuePair<Type, object>(typeof(IConnectionLifetimeFeature), _currentIConnectionLifetimeFeature); 419yield return new KeyValuePair<Type, object>(typeof(IConnectionSocketFeature), _currentIConnectionSocketFeature); 423yield return new KeyValuePair<Type, object>(typeof(IProtocolErrorCodeFeature), _currentIProtocolErrorCodeFeature); 427yield return new KeyValuePair<Type, object>(typeof(IStreamDirectionFeature), _currentIStreamDirectionFeature); 431yield return new KeyValuePair<Type, object>(typeof(IStreamIdFeature), _currentIStreamIdFeature); 435yield return new KeyValuePair<Type, object>(typeof(IStreamAbortFeature), _currentIStreamAbortFeature); 439yield return new KeyValuePair<Type, object>(typeof(IStreamClosedFeature), _currentIStreamClosedFeature); 443yield return new KeyValuePair<Type, object>(typeof(IConnectionMetricsTagsFeature), _currentIConnectionMetricsTagsFeature); 455IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() => FastEnumerable().GetEnumerator();
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (40)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (23)
42private List<KeyValuePair<Type, object>>? MaybeExtra; 70private object? ExtraFeatureGet(Type key) 87private void ExtraFeatureSet(Type key, object? value) 108MaybeExtra = new List<KeyValuePair<Type, object>>(2); 114MaybeExtra[i] = new KeyValuePair<Type, object>(key, value); 118MaybeExtra.Add(new KeyValuePair<Type, object>(key, value)); 126object? IFeatureCollection.this[Type key] 391private IEnumerable<KeyValuePair<Type, object>> FastEnumerable() 395yield return new KeyValuePair<Type, object>(typeof(IConnectionIdFeature), _currentIConnectionIdFeature); 399yield return new KeyValuePair<Type, object>(typeof(IConnectionTransportFeature), _currentIConnectionTransportFeature); 403yield return new KeyValuePair<Type, object>(typeof(IConnectionItemsFeature), _currentIConnectionItemsFeature); 407yield return new KeyValuePair<Type, object>(typeof(IPersistentStateFeature), _currentIPersistentStateFeature); 411yield return new KeyValuePair<Type, object>(typeof(IMemoryPoolFeature), _currentIMemoryPoolFeature); 415yield return new KeyValuePair<Type, object>(typeof(IConnectionLifetimeFeature), _currentIConnectionLifetimeFeature); 419yield return new KeyValuePair<Type, object>(typeof(IConnectionSocketFeature), _currentIConnectionSocketFeature); 423yield return new KeyValuePair<Type, object>(typeof(IProtocolErrorCodeFeature), _currentIProtocolErrorCodeFeature); 427yield return new KeyValuePair<Type, object>(typeof(IStreamDirectionFeature), _currentIStreamDirectionFeature); 431yield return new KeyValuePair<Type, object>(typeof(IStreamIdFeature), _currentIStreamIdFeature); 435yield return new KeyValuePair<Type, object>(typeof(IStreamAbortFeature), _currentIStreamAbortFeature); 439yield return new KeyValuePair<Type, object>(typeof(IStreamClosedFeature), _currentIStreamClosedFeature); 443yield return new KeyValuePair<Type, object>(typeof(IConnectionMetricsTagsFeature), _currentIConnectionMetricsTagsFeature); 455IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() => FastEnumerable().GetEnumerator();
src\Servers\Kestrel\shared\TransportMultiplexedConnection.Generated.cs (17)
35private List<KeyValuePair<Type, object>>? MaybeExtra; 57private object? ExtraFeatureGet(Type key) 74private void ExtraFeatureSet(Type key, object? value) 95MaybeExtra = new List<KeyValuePair<Type, object>>(2); 101MaybeExtra[i] = new KeyValuePair<Type, object>(key, value); 105MaybeExtra.Add(new KeyValuePair<Type, object>(key, value)); 113object? IFeatureCollection.this[Type key] 277private IEnumerable<KeyValuePair<Type, object>> FastEnumerable() 281yield return new KeyValuePair<Type, object>(typeof(IConnectionIdFeature), _currentIConnectionIdFeature); 285yield return new KeyValuePair<Type, object>(typeof(IConnectionTransportFeature), _currentIConnectionTransportFeature); 289yield return new KeyValuePair<Type, object>(typeof(IConnectionItemsFeature), _currentIConnectionItemsFeature); 293yield return new KeyValuePair<Type, object>(typeof(IMemoryPoolFeature), _currentIMemoryPoolFeature); 297yield return new KeyValuePair<Type, object>(typeof(IConnectionLifetimeFeature), _currentIConnectionLifetimeFeature); 301yield return new KeyValuePair<Type, object>(typeof(IProtocolErrorCodeFeature), _currentIProtocolErrorCodeFeature); 305yield return new KeyValuePair<Type, object>(typeof(ITlsConnectionFeature), _currentITlsConnectionFeature); 317IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() => FastEnumerable().GetEnumerator();
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
23public List<Type> IgnoredExceptions { get; } = new List<Type>();
src\Servers\Kestrel\shared\test\TestApplicationErrorLoggerLoggedTest.cs (1)
32public List<Type> IgnoredCriticalLogExceptions => TestApplicationErrorLogger.IgnoredExceptions;
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (23)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (23)
42private List<KeyValuePair<Type, object>>? MaybeExtra; 70private object? ExtraFeatureGet(Type key) 87private void ExtraFeatureSet(Type key, object? value) 108MaybeExtra = new List<KeyValuePair<Type, object>>(2); 114MaybeExtra[i] = new KeyValuePair<Type, object>(key, value); 118MaybeExtra.Add(new KeyValuePair<Type, object>(key, value)); 126object? IFeatureCollection.this[Type key] 391private IEnumerable<KeyValuePair<Type, object>> FastEnumerable() 395yield return new KeyValuePair<Type, object>(typeof(IConnectionIdFeature), _currentIConnectionIdFeature); 399yield return new KeyValuePair<Type, object>(typeof(IConnectionTransportFeature), _currentIConnectionTransportFeature); 403yield return new KeyValuePair<Type, object>(typeof(IConnectionItemsFeature), _currentIConnectionItemsFeature); 407yield return new KeyValuePair<Type, object>(typeof(IPersistentStateFeature), _currentIPersistentStateFeature); 411yield return new KeyValuePair<Type, object>(typeof(IMemoryPoolFeature), _currentIMemoryPoolFeature); 415yield return new KeyValuePair<Type, object>(typeof(IConnectionLifetimeFeature), _currentIConnectionLifetimeFeature); 419yield return new KeyValuePair<Type, object>(typeof(IConnectionSocketFeature), _currentIConnectionSocketFeature); 423yield return new KeyValuePair<Type, object>(typeof(IProtocolErrorCodeFeature), _currentIProtocolErrorCodeFeature); 427yield return new KeyValuePair<Type, object>(typeof(IStreamDirectionFeature), _currentIStreamDirectionFeature); 431yield return new KeyValuePair<Type, object>(typeof(IStreamIdFeature), _currentIStreamIdFeature); 435yield return new KeyValuePair<Type, object>(typeof(IStreamAbortFeature), _currentIStreamAbortFeature); 439yield return new KeyValuePair<Type, object>(typeof(IStreamClosedFeature), _currentIStreamClosedFeature); 443yield return new KeyValuePair<Type, object>(typeof(IConnectionMetricsTagsFeature), _currentIConnectionMetricsTagsFeature); 455IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() => FastEnumerable().GetEnumerator();
Microsoft.AspNetCore.Shared.Tests (153)
ClosedGenericMatcherTest.cs (14)
15public static TheoryData<Type, Type, Type> ExtractGenericInterfaceDataSet 19return new TheoryData<Type, Type, Type> 166Type queryType, 167Type interfaceType, 168Type expectedResult) 171var result = ClosedGenericMatcher.ExtractGenericInterface(queryType, interfaceType); 182var type = typeof(TwoIEnumerableImplementationsInherited); 185var result = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IEnumerable<>)); 196var type = typeof(TwoIEnumerableImplementationsOnSameClass); 199var result = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IEnumerable<>));
PropertyHelperTest.cs (9)
186public void PropertyHelper_WorksForNullablePrimitiveAndEnumTypes(Type nullableType) 199var myType = typeof(MyStruct?); 323var type = typeof(DerivedClassWithNonReadableProperties); 339var type = typeof(string); 354var type = typeof(DerivedHiddenProperty); 371var type = typeof(DerivedHiddenProperty2); 388var type = typeof(string); 403var type = typeof(DerivedHiddenProperty); 420var type = typeof(DerivedHiddenProperty2);
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (3)
26[DynamicallyAccessedMembers(ActivatorAccessibility)] Type instanceType, 92[DynamicallyAccessedMembers(ActivatorAccessibility)] Type type) 116var givenType = givenParameters[givenIndex]?.GetType();
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (16)
19/// Determine whether <paramref name="queryType"/> is or implements a closed generic <see cref="Type"/> 22/// <param name="queryType">The <see cref="Type"/> of interest.</param> 23/// <param name="interfaceType">The open generic <see cref="Type"/> to match. Usually an interface.</param> 25/// The closed generic <see cref="Type"/> created from <paramref name="interfaceType"/> that 26/// <paramref name="queryType"/> is or implements. <c>null</c> if the two <see cref="Type"/>s have no such 34public static Type? ExtractGenericInterface([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 59private static bool IsGenericInstantiation(Type candidate, Type interfaceType) 66private static Type? GetGenericInstantiation([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 68Type? bestMatch = null; 70foreach (var @interface in interfaces) 96var baseType = queryType?.BaseType;
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (9)
20public Type AwaiterType { get; } 25public Type ResultType { get; } 29Type awaiterType, 34Type resultType, 48Type type, 54var getAwaiterMethod = type.GetMethod("GetAwaiter", Everything, Type.EmptyTypes); 62var awaiterType = getAwaiterMethod.ReturnType; 65var isCompletedProperty = awaiterType.GetProperty("IsCompleted", Everything, binder: null, returnType: typeof(bool), types: Type.EmptyTypes, modifiers: null); 93var getResultMethod = awaiterType.GetMethod("GetResult", Everything, Type.EmptyTypes);
src\Shared\ObjectMethodExecutor\CoercedAwaitableInfo.cs (5)
15public Type CoercerResultType { get; } 25public CoercedAwaitableInfo(Expression coercerExpression, Type coercerResultType, AwaitableInfo coercedAwaitableInfo) 35[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type, 43out var nonGenericAwaitableType)) 61out var coercerResultType))
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (9)
68var isAwaitable = IsTaskType(MethodReturnType, out var resultType); 96public Type? AsyncResultType { get; } 99public Type MethodReturnType { get; internal set; } 281var postCoercionMethodReturnType = coercedAwaitableInfo.CoercerResultType ?? methodInfo.ReturnType; 398private static bool IsTaskType(Type methodReturnType, [NotNullWhen(true)] out Type? resultType) 412var currentType = methodReturnType; 437private static MethodExecutorAsync? GetExecutorAsyncTrimAotCompatible(MethodInfo methodInfo, Type asyncResultType) 439var methodReturnType = methodInfo.ReturnType;
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (20)
59Type possibleFSharpAsyncType, 61out Type awaitableType) 63var methodReturnGenericType = possibleFSharpAsyncType.IsGenericType 74var awaiterResultType = possibleFSharpAsyncType.GetGenericArguments().Single(); 98TryBuildCoercerFromUnitAwaitableToVoidAwaitable(awaitableType, out var coercerExpression, out var nonGenericAwaitableType) 132Type genericAwaitableType, 134out Type nonGenericAwaitableType) 152static Expression MakeTaskOfUnitToTaskExpression(Type type) 158static Expression MakeValueTaskOfUnitToValueTaskExpression(Type type) 172private static bool IsFSharpAsyncOpenGenericType(Type possibleFSharpAsyncType) => 176private static bool IsFSharpUnit(Type possibleFSharpUnitType) => 180private static bool IsCoerceableFSharpType(Type possibleFSharpType, string coerceableFSharpTypeName) 206private static bool TryPopulateFSharpValueCaches(Type possibleFSharpType) 209var fsharpOptionType = assembly.GetType(FSharpOptionTypeName); 210var fsharpAsyncType = assembly.GetType(FSharpAsyncTypeName); 211var fsharpAsyncGenericType = assembly.GetType(FSharpAsyncGenericTypeName); 219var fsharpOptionOfTaskCreationOptionsType = fsharpOptionType 225var fsharpOptionOfCancellationTokenType = fsharpOptionType 252private static bool TypesHaveSameIdentity(Type type1, Type type2)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (2)
47Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType); 87private static object? CreateValueType(Type t) => RuntimeHelpers.GetUninitializedObject(t);
src\Shared\PropertyActivator\PropertyActivator.cs (7)
38Type type, 39Type activateAttributeType, 50Type type, 51Type activateAttributeType, 64Type type, 81Type type, 82Type activateAttributeType,
src\Shared\PropertyHelper\PropertyHelper.cs (21)
41private static readonly ConcurrentDictionary<Type, PropertyHelper[]> PropertiesCache = new(); 43private static readonly ConcurrentDictionary<Type, PropertyHelper[]> VisiblePropertiesCache = new(); 50/// This constructor does not cache the helper. For caching, use <see cref="GetProperties(Type)"/>. 123[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 144[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 244Type openGenericDelegateType, 248var typeInput = propertyGetMethod.DeclaringType!; 249var typeOutput = propertyGetMethod.ReturnType; 251var delegateType = openGenericDelegateType.MakeGenericType(typeInput, typeOutput); 290var typeInput = setMethod.DeclaringType!; 291var parameterType = parameters[0].ParameterType; 412Type type, 413ConcurrentDictionary<Type, PropertyHelper[]>? allPropertiesCache, 414ConcurrentDictionary<Type, PropertyHelper[]>? visiblePropertiesCache) 444var declaringType = propertyHelper.Property.DeclaringType; 457Type? currentType = type; 493Type type, 494ConcurrentDictionary<Type, PropertyHelper[]>? cache) 509foreach (var @interface in type.GetInterfaces()) 523[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) 562public static void ClearCache(Type[]? _)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (5)
84var type = method.DeclaringType; 116var parameterType = parameter.ParameterType; 161var type = method.DeclaringType; 196private static bool TryResolveStateMachineMethod(ref MethodBase method, out Type? declaringType) 203var parentType = declaringType.DeclaringType;
src\Shared\ThrowHelpers\ObjectDisposedThrowHelper.cs (1)
34public static void ThrowIf([DoesNotReturnIf(true)] bool condition, Type type)
src\Shared\TypeNameHelper\TypeNameHelper.cs (9)
17private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 46/// <param name="type">The <see cref="Type"/>.</param> 52public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 59private static void ProcessType(StringBuilder builder, Type type, in DisplayNameOptions options) 93private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 95var innerType = type; 112private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
TypeNameHelperTest.cs (23)
45public void Can_pretty_print_CLR_full_name(Type type, string expected) 54var type = typeof(ClassInGlobalNamespace<int>); 80public void Can_pretty_print_CLR_name(Type type, string expected) 102public void Returns_common_name_for_built_in_types(Type type, string expected) 115public void Can_pretty_print_array_name(Type type, bool fullName, string expected) 120public static TheoryData<Type, bool, string> GetOpenGenericsTestData() 122var openDictionaryType = typeof(Dictionary<,>); 125var closedDictionaryType = openDictionaryType.MakeGenericType(genArgsDictionary); 127var openLevelType = typeof(Level1<>.Level2<>.Level3<>); 130var closedLevelType = openLevelType.MakeGenericType(genArgsLevel); 132var openInnerType = typeof(OuterGeneric<>.InnerNonGeneric.InnerGeneric<,>.InnerGenericLeafNode<>); 135var closedInnerType = openInnerType.MakeGenericType(genArgsInnerType); 137return new TheoryData<Type, bool, string> 174public void Can_pretty_print_open_generics(Type type, bool fullName, string expected) 179public static TheoryData<Type, string> GetTypeDisplayName_IncludesGenericParameterNamesWhenOptionIsSetData => 180new TheoryData<Type, string> 190public void GetTypeDisplayName_IncludesGenericParameterNamesWhenOptionIsSet(Type type, string expected) 199public static TheoryData<Type, string> GetTypeDisplayName_WithoutFullName_IncludesGenericParameterNamesWhenOptionIsSetData => 200new TheoryData<Type, string> 210public void GetTypeDisplayName_WithoutFullName_IncludesGenericParameterNamesWhenOptionIsSet(Type type, string expected) 219public static TheoryData<Type, string> FullTypeNameData 223return new TheoryData<Type, string> 251public void Can_PrettyPrint_FullTypeName_WithoutGenericParametersAndNestedTypeDelimiter(Type type, string expectedTypeName)
Microsoft.AspNetCore.SignalR.Client.Core (45)
HubConnection.cs (14)
349public virtual IDisposable On(string methodName, Type[] parameterTypes, Func<object?[], object, Task<object?>> handler, object state) 382public virtual IDisposable On(string methodName, Type[] parameterTypes, Func<object?[], object, Task> handler, object state) 428public virtual async Task<ChannelReader<object?>> StreamAsChannelCoreAsync(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken = default) 450public virtual async Task<object?> InvokeCoreAsync(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken = default) 695private async Task<ChannelReader<object?>> StreamAsChannelCoreAsyncCore(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken) 849if (ReflectionHelper.TryGetStreamType(reader.GetType(), out var channelGenericType)) 870private void InvokeStreamMethod(MethodInfo methodInfo, Type[] genericTypes, ConnectionState connectionState, string streamId, object reader, CancellationTokenSource tokenSource) 1073private async Task<object?> InvokeCoreAsyncCore(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken) 2094public Type[] ParameterTypes { get; } 2099public InvocationHandler(Type[] parameterTypes, Func<object?[], object, Task> callback, object state) 2385Type IInvocationBinder.GetReturnType(string invocationId) 2395Type IInvocationBinder.GetStreamItemType(string invocationId) 2407IReadOnlyList<Type> IInvocationBinder.GetParameterTypes(string methodName) 2412return Type.EmptyTypes;
HubConnectionBuilder.cs (2)
84/// Gets the <see cref="Type"/> of the current instance. 87public new Type GetType()
HubConnectionExtensions.cs (4)
15private static IDisposable On(this HubConnection hubConnection, string methodName, Type[] parameterTypes, Action<object?[]> handler) 36return hubConnection.On(methodName, Type.EmptyTypes, args => handler()); 211public static IDisposable On(this HubConnection hubConnection, string methodName, Type[] parameterTypes, Func<object?[], Task> handler) 231return hubConnection.On(methodName, Type.EmptyTypes, args => handler());
HubConnectionExtensions.OnResult.cs (4)
18private static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Type[] parameterTypes, Func<object?[], TResult> handler) 37public static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Type[] parameterTypes, Func<object?[], Task<TResult>> handler) 59return hubConnection.On(methodName, Type.EmptyTypes, args => handler()); 75return hubConnection.On(methodName, Type.EmptyTypes, args => handler());
Internal\InvocationRequest.cs (6)
22public Type ResultType { get; } 28protected InvocationRequest(CancellationToken cancellationToken, Type resultType, string invocationId, ILogger logger, HubConnection hubConnection, Activity? activity) 48public static InvocationRequest Invoke(CancellationToken cancellationToken, Type resultType, string invocationId, ILoggerFactory loggerFactory, HubConnection hubConnection, Activity? activity, out Task<object?> result) 55public static InvocationRequest Stream(CancellationToken cancellationToken, Type resultType, string invocationId, 83public Streaming(CancellationToken cancellationToken, Type resultType, string invocationId, ILoggerFactory loggerFactory, HubConnection hubConnection, Activity? activity) 171public NonStreaming(CancellationToken cancellationToken, Type resultType, string invocationId, ILoggerFactory loggerFactory, HubConnection hubConnection, Activity? activity)
src\Shared\ThrowHelpers\ObjectDisposedThrowHelper.cs (1)
34public static void ThrowIf([DoesNotReturnIf(true)] bool condition, Type type)
src\SignalR\common\Shared\AsyncEnumerableAdapters.cs (3)
158var constructedIAsyncEnumerableInterface = ReflectionHelper.GetIAsyncEnumerableInterface(asyncEnumerable.GetType())!; 187var type = ReflectionHelper.GetIAsyncEnumeratorInterface(enumerator.GetType()); 215var type = channelReader.GetType();
src\SignalR\common\Shared\ReflectionHelper.cs (11)
16public static bool IsStreamingType(Type type, bool mustBeDirectType = false) 28public static bool TryGetStreamType(Type streamType, [NotNullWhen(true)] out Type? streamGenericType, bool mustBeDirectType = false) 30Type? nullableType = streamType; 48public static bool IsIAsyncEnumerable(Type type) => GetIAsyncEnumerableInterface(type) is not null; 55public static Type? GetIAsyncEnumerableInterface(Type type) 62foreach (Type typeToCheck in type.GetInterfaces()) 78public static Type GetIAsyncEnumeratorInterface(Type type) 85foreach (Type typeToCheck in type.GetInterfaces())
Microsoft.AspNetCore.SignalR.Client.Tests (23)
HubClientProxyGeneratorTests.cs (16)
77Array.Empty<Type>(), 85It.Is<Type[]>(t => t.Length == 1 && t[0] == typeof(int)), 93It.Is<Type[]>(t => t.Length == 3 && t[0] == typeof(int) && t[1] == typeof(float) && t[2] == typeof(int?)), 101Array.Empty<Type>(), 128Array.Empty<Type>(), 136It.Is<Type[]>(t => t.Length == 1 && t[0] == typeof(int)), 144It.Is<Type[]>(t => t.Length == 3 && t[0] == typeof(int) && t[1] == typeof(float) && t[2] == typeof(int?)), 152Array.Empty<Type>(), 181Array.Empty<Type>(), 185(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) => 197It.Is<Type[]>(t => t.Length == 1 && t[0] == typeof(int)), 201(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) => 213It.Is<Type[]>(t => t.Length == 3 && t[0] == typeof(int) && t[1] == typeof(float) && t[2] == typeof(int?)), 217(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) => 229Array.Empty<Type>(), 233(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) =>
HubConnectionTests.cs (7)
850mockConnection.Setup(c => c.On(It.IsAny<string>(), It.IsAny<Type[]>(), It.IsAny<Func<object[], object, Task>>(), It.IsAny<object>())); 852mockConnection.Setup(c => c.StreamAsChannelCoreAsync(It.IsAny<string>(), It.IsAny<Type>(), It.IsAny<object[]>(), It.IsAny<CancellationToken>())) 854mockConnection.Setup(c => c.InvokeCoreAsync(It.IsAny<string>(), It.IsAny<Type>(), It.IsAny<object[]>(), It.IsAny<CancellationToken>())).Returns(() => Task.FromResult(It.IsAny<object>())); 862_ = hubConnection.On("someMethod2", new Type[] { typeof(int) }, (args, obj) => Task.CompletedTask, 2); 871mockConnection.Verify(c => c.On("someMethod", It.IsAny<Type[]>(), It.IsAny<Func<object[], object, Task>>(), It.IsAny<object>()), Times.Once); 872mockConnection.Verify(c => c.On("someMethod2", It.IsAny<Type[]>(), It.IsAny<Func<object[], object, Task>>(), 2), Times.Once); 874mockConnection.Verify(c => c.StreamAsChannelCoreAsync("stream", It.IsAny<Type>(), It.IsAny<object[]>(), It.IsAny<CancellationToken>()), Times.Once);
Microsoft.AspNetCore.SignalR.Common (10)
IInvocationBinder.cs (10)
11/// Class used by <see cref="IHubProtocol"/>s to get the <see cref="Type"/>(s) expected by the hub message being deserialized. 16/// Gets the <see cref="Type"/> the invocation represented by the <paramref name="invocationId"/> is expected to contain. 19/// <returns>The <see cref="Type"/> the invocation is expected to contain.</returns> 20Type GetReturnType(string invocationId); 23/// Gets the list of <see cref="Type"/>s the method represented by <paramref name="methodName"/> takes as arguments. 26/// <returns>A list of <see cref="Type"/>s the method takes as arguments.</returns> 27IReadOnlyList<Type> GetParameterTypes(string methodName); 30/// Gets the <see cref="Type"/> the stream item is expected to contain. 33/// <returns>The <see cref="Type"/> of the item the stream contains.</returns> 34Type GetStreamItemType(string streamId);
Microsoft.AspNetCore.SignalR.Common.Tests (20)
Internal\Protocol\CompositeTestBinder.cs (3)
21public IReadOnlyList<Type> GetParameterTypes(string methodName) 27public Type GetReturnType(string invocationId) 41public Type GetStreamItemType(string streamId)
Internal\Protocol\JsonHubProtocolTests.cs (1)
52var binder = new TestBinder(Array.Empty<Type>(), typeof(object));
Internal\Protocol\JsonHubProtocolTestsBase.cs (4)
194var binder = new TestBinder(Array.Empty<Type>(), typeof(object)); 205var binder = new TestBinder(Array.Empty<Type>(), typeof(object)); 552public Type ResultType { get; } 555public ClientResultTestData(string name, string message, Type resultType, object result)
Internal\Protocol\MessagePackHubProtocolTests.cs (2)
277public Type ResultType { get; } 280public ClientResultTestData(string name, string message, Type resultType, object result)
Internal\Protocol\NewtonsoftJsonHubProtocolTests.cs (1)
50var binder = new TestBinder(Array.Empty<Type>(), typeof(object));
Internal\Protocol\TestBinder.cs (9)
13private readonly Type[] _paramTypes; 14private readonly Type _returnType; 36public TestBinder(Type[] paramTypes) : this(paramTypes, null) { } 37public TestBinder(Type returnType) : this(null, returnType) { } 38public TestBinder(Type[] paramTypes, Type returnType) 44public IReadOnlyList<Type> GetParameterTypes(string methodName) 53public Type GetReturnType(string invocationId) 62public Type GetStreamItemType(string streamId)
Microsoft.AspNetCore.SignalR.Core (143)
DefaultHubLifetimeManager.cs (1)
391public override bool TryGetReturnType(string invocationId, [NotNullWhen(true)] out Type? type)
HubLifetimeManager.cs (1)
169public virtual bool TryGetReturnType(string invocationId, [NotNullWhen(true)] out Type? type)
HubMetadata.cs (3)
14/// <param name="hubType">The <see cref="Type"/> of the <see cref="Hub"/>.</param> 15public HubMetadata(Type hubType) 23public Type HubType { get; }
HubOptionsExtensions.cs (1)
49public static void AddFilter(this HubOptions options, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type filterType)
Internal\DefaultHubActivator.cs (1)
13private static readonly Lazy<ObjectFactory> _objectFactory = new Lazy<ObjectFactory>(() => ActivatorUtilities.CreateFactory(typeof(THub), Type.EmptyTypes));
Internal\DefaultHubDispatcher.cs (3)
751var itemType = descriptor.StreamingParameters![streamPointer]; 768var hubType = typeof(THub); 813public override IReadOnlyList<Type> GetParameterTypes(string methodName)
Internal\DefaultHubDispatcherLog.cs (2)
30var resultType = objectMethodExecutor.AsyncResultType ?? objectMethodExecutor.MethodReturnType; 42var resultType = objectMethodExecutor.AsyncResultType ?? objectMethodExecutor.MethodReturnType;
Internal\DefaultHubProtocolResolver.cs (1)
50public static partial void RegisteredSignalRProtocol(ILogger logger, string protocolName, Type implementationType);
Internal\HubConnectionBinder.cs (4)
21public IReadOnlyList<Type> GetParameterTypes(string methodName) 26public Type GetReturnType(string invocationId) 28if (_hubLifetimeManager.TryGetReturnType(invocationId, out var type)) 36public Type GetStreamItemType(string streamId)
Internal\HubDispatcher.cs (1)
14public abstract IReadOnlyList<Type> GetParameterTypes(string name);
Internal\HubFilterFactory.cs (3)
14private readonly Type _filterType; 16public HubFilterFactory([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type filterType) 18_objectFactory = ActivatorUtilities.CreateFactory(filterType, Array.Empty<Type>());
Internal\HubMethodDescriptor.cs (17)
41var asyncEnumerableType = ReflectionHelper.GetIAsyncEnumerableInterface(NonAsyncReturnType); 49foreach (var returnType in NonAsyncReturnType.AllBaseTypes()) 73StreamingParameters = new List<Type>(); 159public List<Type>? StreamingParameters { get; private set; } 165public IReadOnlyList<Type> ParameterTypes { get; } 167public IReadOnlyList<Type>? OriginalParameterTypes { get; } 169public Type NonAsyncReturnType { get; } 173public Type? StreamReturnType { get; } 184public object GetService(IServiceProvider serviceProvider, int index, Type parameterType) 225private static Func<object, CancellationToken, IAsyncEnumerator<object?>> CompileConvertToEnumerator(MethodInfo adapterMethodInfo, Type streamReturnType) 254private static Func<object, CancellationToken, IAsyncEnumerator<object?>> ConvertToEnumeratorWithReflection(MethodInfo adapterMethodInfo, Type streamReturnType) 281private static Type GetServiceType(Type type) 286type.GetGenericTypeDefinition() is Type genericDefinition && 295private Type ValidateParameterStreamType(Type streamType, Type parameterType)
Internal\HubReflectionHelper.cs (3)
12public static IEnumerable<MethodInfo> GetHubMethods([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type hubType) 22var baseDefinition = methodInfo.GetBaseDefinition().DeclaringType!; 28var baseType = baseDefinition.IsGenericType ? baseDefinition.GetGenericTypeDefinition() : baseDefinition;
Internal\TypeBaseEnumerationExtensions.cs (3)
8public static IEnumerable<Type> AllBaseTypes(this Type type) 10var current = type;
Internal\TypedClientBuilder.cs (11)
23private static readonly Type[] ParameterTypes = new Type[] { typeof(IClientProxy) }; 43var clientType = GenerateInterfaceImplementation(moduleBuilder); 50private static Type GenerateInterfaceImplementation(ModuleBuilder moduleBuilder) 75private static IEnumerable<MethodInfo> GetAllInterfaceMethods([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType) 77foreach (var parent in interfaceType.GetInterfaces()) 124var returnType = interfaceMethodInfo.ReturnType; 180var singleClientProxyType = typeof(ISingleClientProxy); 192generator.Emit(OpCodes.Newobj, typeof(InvalidOperationException).GetConstructor(new Type[] { typeof(string) })!); 252private static void VerifyInterface([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType) 274foreach (var parent in interfaceType.GetInterfaces())
src\Shared\ClosedGenericMatcher\ClosedGenericMatcher.cs (16)
19/// Determine whether <paramref name="queryType"/> is or implements a closed generic <see cref="Type"/> 22/// <param name="queryType">The <see cref="Type"/> of interest.</param> 23/// <param name="interfaceType">The open generic <see cref="Type"/> to match. Usually an interface.</param> 25/// The closed generic <see cref="Type"/> created from <paramref name="interfaceType"/> that 26/// <paramref name="queryType"/> is or implements. <c>null</c> if the two <see cref="Type"/>s have no such 34public static Type? ExtractGenericInterface([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 59private static bool IsGenericInstantiation(Type candidate, Type interfaceType) 66private static Type? GetGenericInstantiation([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type queryType, Type interfaceType) 68Type? bestMatch = null; 70foreach (var @interface in interfaces) 96var baseType = queryType?.BaseType;
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (9)
20public Type AwaiterType { get; } 25public Type ResultType { get; } 29Type awaiterType, 34Type resultType, 48Type type, 54var getAwaiterMethod = type.GetMethod("GetAwaiter", Everything, Type.EmptyTypes); 62var awaiterType = getAwaiterMethod.ReturnType; 65var isCompletedProperty = awaiterType.GetProperty("IsCompleted", Everything, binder: null, returnType: typeof(bool), types: Type.EmptyTypes, modifiers: null); 93var getResultMethod = awaiterType.GetMethod("GetResult", Everything, Type.EmptyTypes);
src\Shared\ObjectMethodExecutor\CoercedAwaitableInfo.cs (5)
15public Type CoercerResultType { get; } 25public CoercedAwaitableInfo(Expression coercerExpression, Type coercerResultType, AwaitableInfo coercedAwaitableInfo) 35[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type, 43out var nonGenericAwaitableType)) 61out var coercerResultType))
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (9)
68var isAwaitable = IsTaskType(MethodReturnType, out var resultType); 96public Type? AsyncResultType { get; } 99public Type MethodReturnType { get; internal set; } 281var postCoercionMethodReturnType = coercedAwaitableInfo.CoercerResultType ?? methodInfo.ReturnType; 398private static bool IsTaskType(Type methodReturnType, [NotNullWhen(true)] out Type? resultType) 412var currentType = methodReturnType; 437private static MethodExecutorAsync? GetExecutorAsyncTrimAotCompatible(MethodInfo methodInfo, Type asyncResultType) 439var methodReturnType = methodInfo.ReturnType;
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (20)
59Type possibleFSharpAsyncType, 61out Type awaitableType) 63var methodReturnGenericType = possibleFSharpAsyncType.IsGenericType 74var awaiterResultType = possibleFSharpAsyncType.GetGenericArguments().Single(); 98TryBuildCoercerFromUnitAwaitableToVoidAwaitable(awaitableType, out var coercerExpression, out var nonGenericAwaitableType) 132Type genericAwaitableType, 134out Type nonGenericAwaitableType) 152static Expression MakeTaskOfUnitToTaskExpression(Type type) 158static Expression MakeValueTaskOfUnitToValueTaskExpression(Type type) 172private static bool IsFSharpAsyncOpenGenericType(Type possibleFSharpAsyncType) => 176private static bool IsFSharpUnit(Type possibleFSharpUnitType) => 180private static bool IsCoerceableFSharpType(Type possibleFSharpType, string coerceableFSharpTypeName) 206private static bool TryPopulateFSharpValueCaches(Type possibleFSharpType) 209var fsharpOptionType = assembly.GetType(FSharpOptionTypeName); 210var fsharpAsyncType = assembly.GetType(FSharpAsyncTypeName); 211var fsharpAsyncGenericType = assembly.GetType(FSharpAsyncGenericTypeName); 219var fsharpOptionOfTaskCreationOptionsType = fsharpOptionType 225var fsharpOptionOfCancellationTokenType = fsharpOptionType 252private static bool TypesHaveSameIdentity(Type type1, Type type2)
src\SignalR\common\Shared\AsyncEnumerableAdapters.cs (3)
158var constructedIAsyncEnumerableInterface = ReflectionHelper.GetIAsyncEnumerableInterface(asyncEnumerable.GetType())!; 187var type = ReflectionHelper.GetIAsyncEnumeratorInterface(enumerator.GetType()); 215var type = channelReader.GetType();
src\SignalR\common\Shared\ClientResultsManager.cs (8)
16private readonly ConcurrentDictionary<string, (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Complete)> _pendingInvocations = new(); 41public void AddInvocation(string invocationId, (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Complete) invocationInfo) 75public (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Completion)? RemoveInvocation(string invocationId) 81public bool TryGetType(string invocationId, [NotNullWhen(true)] out Type? type) 92public Type GetReturnType(string invocationId) 94if (TryGetType(invocationId, out var type)) 102public IReadOnlyList<Type> GetParameterTypes(string methodName) 108public Type GetStreamItemType(string streamId)
src\SignalR\common\Shared\ReflectionHelper.cs (11)
16public static bool IsStreamingType(Type type, bool mustBeDirectType = false) 28public static bool TryGetStreamType(Type streamType, [NotNullWhen(true)] out Type? streamGenericType, bool mustBeDirectType = false) 30Type? nullableType = streamType; 48public static bool IsIAsyncEnumerable(Type type) => GetIAsyncEnumerableInterface(type) is not null; 55public static Type? GetIAsyncEnumerableInterface(Type type) 62foreach (Type typeToCheck in type.GetInterfaces()) 78public static Type GetIAsyncEnumeratorInterface(Type type) 85foreach (Type typeToCheck in type.GetInterfaces())
StreamTracker.cs (7)
33public object AddStream(string streamId, Type itemType, Type targetType) 64public Type GetStreamItemType(string streamId) 100Type GetItemType(); 101object GetReaderAsObject(Type type); 115public Type GetItemType() 120public object GetReaderAsObject(Type type)
Microsoft.AspNetCore.SignalR.Microbenchmarks (16)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
TestBinder.cs (9)
10private readonly Type[] _paramTypes; 11private readonly Type _returnType; 33public TestBinder(Type[] paramTypes) : this(paramTypes, null) { } 34public TestBinder(Type returnType) : this(null, returnType) { } 35public TestBinder(Type[] paramTypes, Type returnType) 41public IReadOnlyList<Type> GetParameterTypes(string methodName) 50public Type GetReturnType(string invocationId) 59public Type GetStreamItemType(string streamId)
Microsoft.AspNetCore.SignalR.Protocols.Json (9)
Protocol\JsonHubProtocol.cs (8)
236var returnType = ProtocolHelper.TryGetReturnType(binder, invocationId); 278var itemType = binder.GetStreamItemType(id); 414var returnType = binder.GetStreamItemType(invocationId); 434var returnType = ProtocolHelper.TryGetReturnType(binder, invocationId); 814private object? BindType(ref Utf8JsonReader reader, ReadOnlySequence<byte> input, Type type) 830private object? BindType(ref Utf8JsonReader reader, Type type) => DeserializeObject(ref reader, type); 832private object?[] BindTypes(ref Utf8JsonReader reader, IReadOnlyList<Type> paramTypes) 921private object? DeserializeObject(ref Utf8JsonReader reader, Type type) => JsonSerializer.Deserialize(ref reader, type, _payloadSerializerOptions);
src\SignalR\common\Shared\TryGetReturnType.cs (1)
10internal static Type? TryGetReturnType(IInvocationBinder binder, string invocationId)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (19)
Protocol\DefaultMessagePackHubProtocolWorker.cs (2)
19protected override object? DeserializeObject(ref MessagePackReader reader, Type type, string field) 31protected override void Serialize(ref MessagePackWriter writer, Type type, object value)
Protocol\MessagePackHubProtocolWorker.cs (5)
148var itemType = binder.GetStreamItemType(invocationId); 178var itemType = ProtocolHelper.TryGetReturnType(binder, invocationId); 296private object?[] BindArguments(ref MessagePackReader reader, IReadOnlyList<Type> parameterTypes) 322protected abstract object? DeserializeObject(ref MessagePackReader reader, Type type, string field); 507protected abstract void Serialize(ref MessagePackWriter writer, Type type, object value);
src\Shared\TrimmingAttributes.cs (11)
184/// with the specified signature of a member on a <see cref="System.Type"/>. 187/// <param name="type">The <see cref="System.Type"/> containing <paramref name="memberSignature"/>.</param> 188public DynamicDependencyAttribute(string memberSignature, Type type) 210/// with the specified types of members on a <see cref="System.Type"/>. 213/// <param name="type">The <see cref="System.Type"/> containing the specified members.</param> 214public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type) 254/// Gets the <see cref="System.Type"/> containing the specified member. 260public Type? Type { get; } 286/// Indicates that certain members on a specified <see cref="Type"/> are accessed dynamically, 293/// This attribute is valid on members whose type is <see cref="Type"/> or <see cref="string"/>. 299/// can be accessed dynamically on <see cref="Type"/> instances returned from calling
src\SignalR\common\Shared\TryGetReturnType.cs (1)
10internal static Type? TryGetReturnType(IInvocationBinder binder, string invocationId)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (11)
Protocol\NewtonsoftJsonHubProtocol.cs (9)
214var returnType = ProtocolHelper.TryGetReturnType(binder, invocationId); 266var itemType = binder.GetStreamItemType(id); 404var itemType = binder.GetStreamItemType(invocationId); 424var returnType = ProtocolHelper.TryGetReturnType(binder, invocationId); 805private static bool ReadArgumentAsType(JsonTextReader reader, IReadOnlyList<Type> paramTypes, int paramIndex) 809var paramType = paramTypes[paramIndex]; 817private object?[] BindArguments(JsonTextReader reader, IReadOnlyList<Type> paramTypes) 895private object?[] BindArguments(JArray args, IReadOnlyList<Type> paramTypes) 915var paramType = paramTypes[i];
src\SignalR\common\Shared\JsonUtils.cs (1)
173public static bool ReadForType(JsonTextReader reader, Type type)
src\SignalR\common\Shared\TryGetReturnType.cs (1)
10internal static Type? TryGetReturnType(IInvocationBinder binder, string invocationId)
Microsoft.AspNetCore.SignalR.Specification.Tests (3)
src\SignalR\common\testassets\Tests.Utils\TestClient.cs (3)
366public IReadOnlyList<Type> GetParameterTypes(string methodName) 372public Type GetReturnType(string invocationId) 377public Type GetStreamItemType(string streamId)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (12)
RedisHubLifetimeManager.cs (4)
444public override bool TryGetReturnType(string invocationId, [NotNullWhen(true)] out Type? type) 718public IReadOnlyList<Type> GetParameterTypes(string methodName) 723public Type GetReturnType(string invocationId) 728public Type GetStreamItemType(string streamId)
src\SignalR\common\Shared\ClientResultsManager.cs (8)
16private readonly ConcurrentDictionary<string, (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Complete)> _pendingInvocations = new(); 41public void AddInvocation(string invocationId, (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Complete) invocationInfo) 75public (Type Type, string ConnectionId, object Tcs, Action<object, CompletionMessage> Completion)? RemoveInvocation(string invocationId) 81public bool TryGetType(string invocationId, [NotNullWhen(true)] out Type? type) 92public Type GetReturnType(string invocationId) 94if (TryGetType(invocationId, out var type)) 102public IReadOnlyList<Type> GetParameterTypes(string methodName) 108public Type GetStreamItemType(string streamId)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (2)
TestConnectionMultiplexer.cs (2)
425var redisSubscriberType = typeof(RedisChannel).Assembly.GetType("StackExchange.Redis.RedisSubscriber"); 428new Type[] { typeof(RedisChannel).MakeByRefType(), redisSubscriberType }, modifiers: null);
Microsoft.AspNetCore.SignalR.Tests (41)
DefaultTransportFactoryTests.cs (2)
52public void DefaultTransportFactoryCreatesRequestedTransportIfAvailable(HttpTransportType requestedTransport, Type expectedTransportType) 87public void DefaultTransportFactoryCreatesRequestedTransportIfAvailable_Win7(HttpTransportType requestedTransport, Type expectedTransportType)
HubConnectionHandlerTests.Activity.cs (1)
491private static void AssertHubMethodActivity<THub>(Activity activity, Activity parent, string methodName, Activity linkedActivity, Type exceptionType = null, string activityName = null)
HubConnectionHandlerTests.ClientResult.cs (7)
323public IReadOnlyList<Type> GetParameterTypes(string methodName) 325return new Type[] { typeof(int) }; 328public Type GetReturnType(string invocationId) 333public Type GetStreamItemType(string streamId) 521public IReadOnlyList<Type> GetParameterTypes(string methodName) => new[] { typeof(int) }; 522public Type GetReturnType(string invocationId) => typeof(ClientResults); 523public Type GetStreamItemType(string streamId) => throw new NotImplementedException();
HubConnectionHandlerTests.cs (13)
872public async Task HubMethodsAreCaseInsensitive(Type hubType) 1369public async Task BroadcastHubMethodSendsToAllClients(Type hubType) 1445public async Task SendToOthers(Type hubType) 1486public async Task SendToCaller(Type hubType) 1549public async Task SendToAllExcept(Type hubType) 1595public async Task SendToMultipleClients(Type hubType) 1643public async Task SendToMultipleUsers(Type hubType) 1688public async Task HubsCanAddAndSendToGroup(Type hubType) 1732public async Task SendToGroupExcept(Type hubType) 1785public async Task SendToOthersInGroup(Type hubType) 1836public async Task InvokeMultipleGroups(Type hubType) 1902public async Task HubsCanSendToUser(Type hubType) 1936public async Task HubsCanSendToConnection(Type hubType)
HubConnectionHandlerTestUtils\Hubs.cs (4)
963private static readonly IEnumerable<Type> _knownTypes = new List<Type>() 970public void BindToName(Type serializedType, out string assemblyName, out string typeName) 976public Type BindToType(string assemblyName, string typeName) =>
HubConnectionHandlerTestUtils\Utils.cs (7)
16public static Type GetConnectionHandlerType(Type hubType) 18var connectionHandlerType = typeof(HubConnectionHandler<>); 22public static Type GetGenericType(Type genericType, Type hubType) 75public static Connections.ConnectionHandler GetHubConnectionHandler(Type hubType, ILoggerFactory loggerFactory = null, Action<ServiceCollection> addServices = null)
HubReflectionHelperTests.cs (2)
23var hubType = typeof(BaseMethodHub); 35var hubType = typeof(InheritedMethodHub);
Internal\MessageBufferTests.cs (4)
559public IReadOnlyList<Type> GetParameterTypes(string methodName) 561var list = new List<Type> 568public Type GetReturnType(string invocationId) 573public Type GetStreamItemType(string streamId)
Internal\ReflectionHelperTests.cs (1)
17public void IsIAsyncEnumerableTests(Type type, bool expectedOutcome)
Microsoft.AspNetCore.SignalR.Tests.Utils (3)
TestClient.cs (3)
366public IReadOnlyList<Type> GetParameterTypes(string methodName) 372public Type GetReturnType(string invocationId) 377public Type GetStreamItemType(string streamId)
Microsoft.AspNetCore.TestHost (4)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-alpha.1.24619.8\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (4)
97var programType = assembly?.EntryPoint?.DeclaringType; 191var hostType = host.GetType(); 353Type? publicHostAbortedExceptionType = Type.GetType("Microsoft.Extensions.Hosting.HostAbortedException, Microsoft.Extensions.Hosting.Abstractions", throwOnError: false);
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
3194public object GetService(Type serviceType) => _inner.GetService(serviceType);
Microsoft.AspNetCore.WebSockets.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.Bcl.AsyncInterfaces (2)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\LibraryImportAttribute.cs (2)
57/// Gets or sets the <see cref="Type"/> used to control how string arguments to the method are marshalled. 63public Type? StringMarshallingCustomType { get; set; }
Microsoft.Bcl.Numerics (2)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\LibraryImportAttribute.cs (2)
57/// Gets or sets the <see cref="Type"/> used to control how string arguments to the method are marshalled. 63public Type? StringMarshallingCustomType { get; set; }
Microsoft.Build (166)
BackEnd\BuildManager\BuildManager.cs (1)
2989Type configurableLoggerType = typeof(ConfigurableForwardingLogger);
BackEnd\Components\Communications\TranslatorExtensions.cs (6)
23private static Lazy<ConcurrentDictionary<Type, ConstructorInfo>> parameterlessConstructorCache = new Lazy<ConcurrentDictionary<Type, ConstructorInfo>>(() => new ConcurrentDictionary<Type, ConstructorInfo>()); 73var type = Type.GetType(typeName); 87constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null, Type.EmptyTypes, null);
BackEnd\Components\ProjectCache\ProjectCacheService.cs (5)
226Type pluginType = GetTypeFromAssemblyPath(pluginAssemblyPath); 339private static ProjectCachePluginBase GetPluginInstanceFromType(Type pluginType) 352private static Type GetTypeFromAssemblyPath(string pluginAssemblyPath) 356var type = GetTypes<ProjectCachePluginBase>(assembly).FirstOrDefault(); 374IEnumerable<Type> GetTypes<T>(Assembly assembly)
BackEnd\Components\RequestBuilder\AssemblyLoadsTracker.cs (4)
33Type? initiator, 46Type? initiator, 60Type initiator, 105Type? initiatorType,
BackEnd\Components\RequestBuilder\IntrinsicTasks\IntrinsicTaskFactory.cs (2)
23public IntrinsicTaskFactory(Type intrinsicType) 39public Type TaskType
BackEnd\Components\RequestBuilder\TaskBuilder.cs (1)
836var type = taskException.GetType();
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (2)
224protected virtual IEnumerable<Type> GetResolverTypes(Assembly assembly) 284foreach (Type type in GetResolverTypes(assembly))
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (7)
705private bool SetValueParameter(TaskPropertyInfo parameter, Type parameterType, string expandedParameterValue) 725private bool SetParameterArray(TaskPropertyInfo parameter, Type parameterType, IList<TaskItem> taskItems, ElementLocation parameterLocation) 1034Type parameterType = null; 1038parameterType = Type.GetType( 1047parameterType = Type.GetType(parameter.PropertyType.AssemblyQualifiedName); 1133Type parameterType, 1257Type parameterType,
BuildCheck\Acquisition\BuildCheckAcquisitionModule.cs (3)
43IList<Type> availableTypes = assembly.GetExportedTypes(); 44IList<Type> checkTypes = availableTypes.Where(t => typeof(Check).IsAssignableFrom(t)).ToArray(); 46foreach (Type checkCandidate in checkTypes)
BuildCheck\Infrastructure\BuildCheckBuildEventHandler.cs (3)
18private Dictionary<Type, Action<BuildEventArgs>> _eventHandlers; 19private readonly Dictionary<Type, Action<BuildEventArgs>> _eventHandlersFull; 20private readonly Dictionary<Type, Action<BuildEventArgs>> _eventHandlersRestore;
BuildCheck\Infrastructure\BuildCheckForwardingLogger.cs (1)
32private HashSet<Type> _eventsToForward =
BuildEnvironmentHelper.cs (1)
399var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
Evaluation\Expander.cs (26)
2252internal static ItemTransformFunction GetItemTransformFunction(IElementLocation elementLocation, string functionName, Type itemType) 3159public Type ReceiverType { get; set; } 3227private Type _receiverType; 3272Type receiverType, 3377var receiverType = GetTypeForStaticMethod(typeName, functionBuilder.Name); 3429var receiverType = propertyValue?.GetType() ?? typeof(string); 3608functionResult = _receiverType.InvokeMember(_methodMethodName, _bindingFlags, Type.DefaultBinder, objectInstance, args, CultureInfo.InvariantCulture); 3714Type t = method.GetParameters()[i].ParameterType; 3738return _receiverType.InvokeMember(_methodMethodName, _bindingFlags, Type.DefaultBinder, objectInstance, args, CultureInfo.InvariantCulture) ?? "null"; 4590private bool ElementsOfType(object[] args, Type type) 5028private static Type GetTypeForStaticMethod(string typeName, string simpleMethodName) 5030Type receiverType; 5031Tuple<string, Type> cachedTypeInformation; 5059receiverType = Type.GetType(assemblyQualifiedTypeName, false /* do not throw TypeLoadException if not found */, true /* ignore case */); 5067AvailableStaticMethods.TryAdd(typeName, simpleMethodName, new Tuple<string, Type>(assemblyQualifiedTypeName, receiverType)); 5074receiverType = Type.GetType(typeName, false /* do not throw TypeLoadException if not found */, true /* ignore case */); 5108AvailableStaticMethods.TryAdd(typeName, new Tuple<string, Type>(typeName, receiverType)); 5118private static Type GetTypeFromAssemblyUsingNamespace(string typeName) 5136Type foundType = GetTypeFromAssembly(typeName, candidateAssemblyName); 5159private static Type GetTypeFromAssembly(string typeName, string candidateAssemblyName) 5161Type objectType = null; 5374Type enumType = parameters[n].ParameterType; 5486private static bool IsStaticMethodAvailable(Type receiverType, string methodName) 5523Type[] types = new Type[_arguments.Length]; 5647? Type.GetTypeCode(parameters[0].ParameterType)
Instance\ReflectableTaskPropertyInfo.cs (2)
27private Type _taskType; 34internal ReflectableTaskPropertyInfo(TaskPropertyInfo taskPropertyInfo, Type taskType)
Instance\TaskFactories\AssemblyTaskFactory.cs (1)
96public Type TaskType
Instance\TaskRegistry.cs (9)
645private static bool IsTaskFactoryClass(Type type, object unused) 1106private static readonly Func<Type, object, bool> s_taskFactoryTypeFilter = IsTaskFactoryClass; 1696Type paramType; 1703paramType = Type.GetType(expandedType + "," + typeof(ITaskItem).GetTypeInfo().Assembly.FullName, false /* don't throw on error */, true /* case-insensitive */) ?? 1704Type.GetType(expandedType); 1708paramType = Type.GetType(expandedType) ?? 1709Type.GetType(expandedType + "," + typeof(ITaskItem).GetTypeInfo().Assembly.FullName, false /* don't throw on error */, true /* case-insensitive */); 1804Type propertyType = Type.GetType(propertyTypeName);
LoadedType.cs (5)
30internal LoadedType(Type type, AssemblyLoadInfo assemblyLoadInfo, Assembly loadedAssembly, Type iTaskItemType, bool loadedViaMetadataLoadContext = false) 50Type t = type; 95Type pt = props[i].PropertyType; 164internal Type Type { get; private set; }
Logging\LoggerDescription.cs (4)
245private static readonly Func<Type, object, bool> s_forwardingLoggerClassFilter = IsForwardingLoggerClass; 250private static readonly Func<Type, object, bool> s_loggerClassFilter = IsLoggerClass; 257private static bool IsForwardingLoggerClass(Type type, object unused) 269private static bool IsLoggerClass(Type type, object unused)
LogMessagePacketBase.cs (4)
431Type eventDerivedType = _buildEvent.GetType(); 510Type eventDerivedType = _buildEvent.GetType(); 588private static Delegate CreateDelegateRobust(Type type, Object firstArgument, MethodInfo methodInfo) 679Type eventType = eventArg.GetType();
PrintLineDebugger.cs (1)
26var commonWriterType = typeof(ITask).Assembly.GetType("Microsoft.Build.Shared.Debugging.CommonWriter", true, false);
Resources\Constants.cs (44)
176private static ConcurrentDictionary<string, Tuple<string, Type>> s_availableStaticMethods; 199internal static bool TryAdd(string key, Tuple<string, Type> value) 211public static bool TryAdd(string typeFullName, string simpleMethodName, Tuple<string, Type> typeInformation) 219internal static bool TryGetValue(string key, out Tuple<string, Type> value) 227internal static Tuple<string, Type> GetValue(string key) 229Tuple<string, Type> typeInformation; 244internal static Tuple<string, Type> GetTypeInformationFromTypeCache(string typeFullName, string simpleMethodName) 288var availableStaticMethods = new ConcurrentDictionary<string, Tuple<string, Type>>(StringComparer.OrdinalIgnoreCase); 291var environmentType = new Tuple<string, Type>(null, typeof(Environment)); 292var directoryType = new Tuple<string, Type>(null, typeof(Directory)); 293var fileType = new Tuple<string, Type>(null, typeof(File)); 294var runtimeInformationType = new Tuple<string, Type>(null, typeof(RuntimeInformation)); 295var osPlatformType = new Tuple<string, Type>(null, typeof(OSPlatform)); 334availableStaticMethods.TryAdd("System.Globalization.CultureInfo::GetCultureInfo", new Tuple<string, Type>(null, typeof(CultureInfo))); // user request 335availableStaticMethods.TryAdd("System.Globalization.CultureInfo::new", new Tuple<string, Type>(null, typeof(CultureInfo))); // user request 336availableStaticMethods.TryAdd("System.Globalization.CultureInfo::CurrentUICulture", new Tuple<string, Type>(null, typeof(CultureInfo))); // user request 339availableStaticMethods.TryAdd("MSBuild", new Tuple<string, Type>(null, typeof(IntrinsicFunctions))); 340availableStaticMethods.TryAdd("System.Byte", new Tuple<string, Type>(null, typeof(Byte))); 341availableStaticMethods.TryAdd("System.Char", new Tuple<string, Type>(null, typeof(Char))); 342availableStaticMethods.TryAdd("System.Convert", new Tuple<string, Type>(null, typeof(Convert))); 343availableStaticMethods.TryAdd("System.DateTime", new Tuple<string, Type>(null, typeof(DateTime))); 344availableStaticMethods.TryAdd("System.DateTimeOffset", new Tuple<string, Type>(null, typeof(DateTimeOffset))); 345availableStaticMethods.TryAdd("System.Decimal", new Tuple<string, Type>(null, typeof(Decimal))); 346availableStaticMethods.TryAdd("System.Double", new Tuple<string, Type>(null, typeof(Double))); 347availableStaticMethods.TryAdd("System.Enum", new Tuple<string, Type>(null, typeof(Enum))); 348availableStaticMethods.TryAdd("System.Guid", new Tuple<string, Type>(null, typeof(Guid))); 349availableStaticMethods.TryAdd("System.Int16", new Tuple<string, Type>(null, typeof(Int16))); 350availableStaticMethods.TryAdd("System.Int32", new Tuple<string, Type>(null, typeof(Int32))); 351availableStaticMethods.TryAdd("System.Int64", new Tuple<string, Type>(null, typeof(Int64))); 352availableStaticMethods.TryAdd("System.IO.Path", new Tuple<string, Type>(null, typeof(Path))); 353availableStaticMethods.TryAdd("System.Math", new Tuple<string, Type>(null, typeof(Math))); 354availableStaticMethods.TryAdd("System.UInt16", new Tuple<string, Type>(null, typeof(UInt16))); 355availableStaticMethods.TryAdd("System.UInt32", new Tuple<string, Type>(null, typeof(UInt32))); 356availableStaticMethods.TryAdd("System.UInt64", new Tuple<string, Type>(null, typeof(UInt64))); 357availableStaticMethods.TryAdd("System.SByte", new Tuple<string, Type>(null, typeof(SByte))); 358availableStaticMethods.TryAdd("System.Single", new Tuple<string, Type>(null, typeof(Single))); 359availableStaticMethods.TryAdd("System.String", new Tuple<string, Type>(null, typeof(String))); 360availableStaticMethods.TryAdd("System.StringComparer", new Tuple<string, Type>(null, typeof(StringComparer))); 361availableStaticMethods.TryAdd("System.TimeSpan", new Tuple<string, Type>(null, typeof(TimeSpan))); 362availableStaticMethods.TryAdd("System.Text.RegularExpressions.Regex", new Tuple<string, Type>(null, typeof(Regex))); 363availableStaticMethods.TryAdd("System.UriBuilder", new Tuple<string, Type>(null, typeof(UriBuilder))); 364availableStaticMethods.TryAdd("System.Version", new Tuple<string, Type>(null, typeof(Version))); 365availableStaticMethods.TryAdd("Microsoft.Build.Utilities.ToolLocationHelper", new Tuple<string, Type>("Microsoft.Build.Utilities.ToolLocationHelper, Microsoft.Build.Utilities.Core, Version=" + MSBuildConstants.CurrentAssemblyVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", null)); 373var operatingSystemType = new Tuple<string, Type>("Microsoft.Build.Framework.OperatingSystem, Microsoft.Build.Framework, Version=" + MSBuildConstants.CurrentAssemblyVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", null);
TaskLoader.cs (2)
35internal static bool IsTaskClass(Type type, object unused) 138Type taskType = taskInstanceInOtherAppDomain.GetType();
TaskParameter.cs (4)
105Type wrappedParameterType = wrappedParameter.GetType(); 122TypeCode typeCode = Type.GetTypeCode(wrappedParameterType.GetElementType()); 168TypeCode typeCode = Type.GetTypeCode(wrappedParameterType); 621Type elementType = _parameterTypeCode switch
TaskParameterTypeVerifier.cs (6)
23internal static bool IsValidScalarInputParameter(Type parameterType) => 29internal static bool IsValidVectorInputParameter(Type parameterType) 40internal static bool IsAssignableToITask(Type parameterType) 50internal static bool IsValueTypeOutputParameter(Type parameterType) 62internal static bool IsValidInputParameter(Type parameterType) 70internal static bool IsValidOutputParameter(Type parameterType)
TypeLoader.cs (19)
34private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>(); 39private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfReflectionOnlyLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>(); 44private Func<Type, object, bool> _isDesiredType; 68internal TypeLoader(Func<Type, object, bool> isDesiredType) 241private LoadedType GetLoadedType(ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> cache, string typeName, AssemblyLoadInfo assembly, bool useTaskHost) 273private Func<Type, object, bool> _isDesiredType; 283private ConcurrentDictionary<string, Type> _typeNameToType; 288private Dictionary<string, Type> _publicTypeNameToType; 307internal AssemblyInfoToLoadedTypes(Func<Type, object, bool> typeFilter, AssemblyLoadInfo loadInfo) 315_publicTypeNameToType = new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase); 332Type type = _typeNameToType.GetOrAdd(typeName, (key) => 339Type t2 = Type.GetType(typeName + "," + _assemblyLoadInfo.AssemblyName, false /* don't throw on error */, true /* case-insensitive */); 365foreach (KeyValuePair<string, Type> desiredTypeInAssembly in _publicTypeNameToType) 387foreach (Type publicType in loadedAssembly.GetExportedTypes()) 417Type[] allPublicTypesInAssembly = _loadedAssembly.GetExportedTypes(); 418foreach (Type publicType in allPublicTypesInAssembly)
Utilities\NuGetFrameworkWrapper.cs (3)
66var NuGetFramework = NuGetAssembly.GetType("NuGet.Frameworks.NuGetFramework"); 67var NuGetFrameworkCompatibilityProvider = NuGetAssembly.GetType("NuGet.Frameworks.CompatibilityProvider"); 68var NuGetFrameworkDefaultCompatibilityProvider = NuGetAssembly.GetType("NuGet.Frameworks.DefaultCompatibilityProvider");
Microsoft.Build.BuildCheck.UnitTests (2)
EditorConfig_Tests.cs (1)
27var type = typeof(T);
TestAssemblyInfo.cs (1)
40var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
Microsoft.Build.CommandLine.UnitTests (1)
TestAssemblyInfo.cs (1)
40var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
Microsoft.Build.Engine.OM.UnitTests (9)
BuildEnvironmentHelper.cs (1)
399var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\ProjectElemetExportHelper.cs (6)
30public ElementInfo(Type type, Func<ProjectElement, bool> checker, ExporterFactory factory) 44public Type CanonicalType { get; } 84private static Dictionary<Type, ExporterFactory> knownTypes = new Dictionary<Type, ExporterFactory>(); 107var implType = xml.GetType(); 126var newKnown = new Dictionary<Type, ExporterFactory>(knownTypes);
PrintLineDebugger.cs (1)
26var commonWriterType = typeof(ITask).Assembly.GetType("Microsoft.Build.Shared.Debugging.CommonWriter", true, false);
TestAssemblyInfo.cs (1)
40var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
Microsoft.Build.Engine.UnitTests (28)
BackEnd\BinaryTranslator_Tests.cs (1)
259public void TestSerializationOfBuildExceptions(Type exceptionType)
BackEnd\BuildOMCompatibility_Tests.cs (2)
101private void VerifyPropertyExists(Type type, string propertyName) 109private void VerifyMethodExists(Type type, string propertyName)
BackEnd\EventSourceSink_Tests.cs (1)
300Type eventType = buildEventToRaise.GetType();
BackEnd\LoggingService_Tests.cs (2)
144Type exceptionType = typeof(LoggerException); 1104private void VerifyShutdownExceptions(ILogger logger, string className, Type expectedExceptionType)
BackEnd\SdkResolverLoader_Tests.cs (2)
459public Func<Assembly, IEnumerable<Type>> GetResolverTypesFunc { get; set; } 473protected override IEnumerable<Type> GetResolverTypes(Assembly assembly)
BackEnd\TaskBuilderTestTask.cs (3)
55public object ToType(Type conversionType, IFormatProvider provider) => Value.ToType(conversionType, provider); 1266private Type _type = typeof(TaskBuilderTestTask); 1288public Type TaskType
BackEnd\TaskExecutionHost_Tests.cs (2)
1057public void TaskExceptionHandlingTest(Type exceptionType, bool isCritical) 1220private static bool IsTaskFactoryClass(Type type, object unused)
BackEnd\TaskHostTaskComplete_Tests.cs (1)
239private void AssertInvalidConstructorThrows(Type expectedExceptionType, TaskCompleteType taskResult, Exception taskException, string taskExceptionMessage, string[] taskExceptionMessageArgs, IDictionary<string, object> taskOutputParameters, IDictionary<string, string> buildProcessEnvironment)
BackEnd\TaskRegistry_Tests.cs (5)
1708Type.GetType( 2113Type paramType = Type.GetType(type); 2118paramType = Type.GetType( 2336public Type TaskType => null;
BackEnd\TaskThatThrows.cs (2)
26Type exceptionType = string.IsNullOrWhiteSpace(ExceptionType) ? typeof(Exception) : Type.GetType(ExceptionType) ?? typeof(Exception);
BackEnd\TranslationHelpers.cs (1)
156internal static bool IsSimpleType(Type type)
Evaluation\Expander_Tests.cs (1)
3997Type expectedType;
Evaluation\ProjectSdkImplicitImport_Tests.cs (1)
512Type expectedOriginalElementType)
Evaluation\SimpleVersion_Tests.cs (1)
278public static void Parse_InvalidInput_ThrowsException(string input, Type exceptionType)
TaskParameter_Tests.cs (2)
59public void PrimitiveParameter(Type type, int expectedTypeCodeAsInt, string testValueAsString) 94public void PrimitiveArrayParameter(Type type, int expectedTypeCodeAsInt, string testValueAsString)
TestAssemblyInfo.cs (1)
40var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
Microsoft.Build.Framework (28)
BinaryTranslator.cs (1)
492Type enumType = value.GetType();
BuildException\BuildExceptionSerializationHelper.cs (5)
14public TypeConstructionTuple(Type type, Func<string, Exception?, BuildExceptionBase> factory) 20public Type Type { get; } 29internal static bool IsSupportedExceptionType(Type type) 53Type exceptionType = typeConstructionTuple.Type; 71internal static string GetExceptionSerializationKey(Type exceptionType)
ITaskFactory.cs (1)
25Type TaskType { get; }
TaskPropertyInfo.cs (3)
24public TaskPropertyInfo(string name, Type typeOfParameter, bool output, bool required) 30Type elementType = typeOfParameter.IsArray ? typeOfParameter.GetElementType() : typeOfParameter; 38public Type PropertyType { get; private set; }
ThrowHelper.cs (4)
101internal static void ThrowWrongKeyTypeArgumentException<T>(T key, Type targetType) 108internal static void ThrowWrongValueTypeArgumentException<T>(T value, Type targetType) 203private static ArgumentException GetWrongKeyTypeArgumentException(object? key, Type targetType) 208private static ArgumentException GetWrongValueTypeArgumentException(object? value, Type targetType)
XamlTypes\ContentType.cs (2)
132public IEnumerable<Type> GetSchemaObjectTypes() 140public IEnumerable<object> GetSchemaObjects(Type type)
XamlTypes\FileExtension.cs (2)
46public IEnumerable<Type> GetSchemaObjectTypes() 54public IEnumerable<object> GetSchemaObjects(Type type)
XamlTypes\IProjectSchemaNode.cs (2)
19IEnumerable<Type> GetSchemaObjectTypes(); 24IEnumerable<object> GetSchemaObjects(Type type);
XamlTypes\ItemType.cs (2)
85public IEnumerable<Type> GetSchemaObjectTypes() 93public IEnumerable<object> GetSchemaObjects(Type type)
XamlTypes\ProjectSchemaDefinitions.cs (2)
43public IEnumerable<Type> GetSchemaObjectTypes() 51public IEnumerable<object> GetSchemaObjects(Type type)
XamlTypes\Rule.cs (2)
538public IEnumerable<Type> GetSchemaObjectTypes() 546public IEnumerable<object> GetSchemaObjects(Type type)
XamlTypes\RuleBag.cs (2)
75public IEnumerable<Type> GetSchemaObjectTypes() 83public IEnumerable<object> GetSchemaObjects(Type type)
Microsoft.Build.Framework.UnitTests (1)
TestAssemblyInfo.cs (1)
40var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
Microsoft.Build.Tasks.CodeAnalysis (15)
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
30return !(Type.GetType("Mono.Runtime") is null); 50return !(Type.GetType("Mono.RuntimeStructs", throwOnError: false) is null);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (13)
16private static readonly Type Missing = typeof(void); 18public static Type? TryGetType(string assemblyQualifiedName) 23return Type.GetType(assemblyQualifiedName, throwOnError: false); 31public static Type? TryGetType([NotNull] ref Type? lazyType, string assemblyQualifiedName) 42/// Find a <see cref="Type"/> instance by first probing the contract name and then the name as it 45public static Type? GetTypeFromEither(string contractName, string desktopName) 47var type = TryGetType(contractName); 57public static Type? GetTypeFromEither([NotNull] ref Type? lazyType, string contractName, string desktopName) 67public static T? FindItem<T>(IEnumerable<T> collection, params Type[] paramTypes) 97internal static MethodInfo? GetDeclaredMethod(this TypeInfo typeInfo, string name, params Type[] paramTypes) 102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (4)
TargetTests.cs (1)
1006public Type TaskType { get => typeof(DummyTaskFactory); }
TestUtilities\ErrorLoggerEngine.cs (3)
27var formattingClass = assembly.GetType("Microsoft.Build.Shared.EventArgsFormatting") ?? throw new Exception("Could not find EventArgsFormatting type"); 29new Type[] { typeof(BuildErrorEventArgs) }, null) ?? throw new Exception("Could not find FormatEventMessage(BuildErrorEventArgs)."); 31new Type[] { typeof(BuildWarningEventArgs) }, null) ?? throw new Exception("Could not find FormatEventMessage(BuildWarningEventArgs).");
Microsoft.Build.Tasks.Core (36)
BuildEnvironmentHelper.cs (1)
399var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
CodeTaskFactory.cs (1)
1029public Type TaskType { get; } = null;
GenerateApplicationManifest.cs (1)
123protected override Type GetObjectType()
GenerateDeploymentManifest.cs (1)
165protected override Type GetObjectType()
GenerateManifestBase.cs (3)
42protected abstract Type GetObjectType(); 283Type manifestType = GetObjectType(); 423private bool InitializeManifest(Type manifestType)
ManifestUtil\ManifestReader.cs (2)
239Type t = Type.GetType(tn);
ManifestUtil\XmlUtil.cs (1)
139public override Object GetEntity(Uri uri, string role, Type t)
PrintLineDebugger.cs (1)
26var commonWriterType = typeof(ITask).Assembly.GetType("Microsoft.Build.Shared.Debugging.CommonWriter", true, false);
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (4)
118/// Gets the <see cref="Type"/> of the compiled task. 120public Type TaskType { get; private set; } 172Type[] exportedTypes = assembly.GetExportedTypes(); 618private static CodeMemberProperty CreateProperty(CodeTypeDeclaration codeTypeDeclaration, string name, Type type, object defaultValue = null)
system.design\stronglytypedresourcebuilder.cs (3)
89internal ResourceData(Type type, String valueAsString) 105internal Type Type { get; } 526if (data.Type is Type type)
WriteCodeFragment.cs (14)
259Lazy<Type> attributeType = new( 260() => Type.GetType(attribute.Name, throwOnError: false) ?? NamespaceImports.Select(x => Type.GetType($"{x}.{attribute.Name}", throwOnError: false)).FirstOrDefault(), 393Lazy<Type> attributeType, 397Type[] constructorParameterTypes = null; 472private Type[] FindPositionalParameterTypes(Type attributeType, IReadOnlyList<AttributeParameter> positionalParameters) 479List<Type[]> candidates = attributeType 525return positionalParameters.Select(x => default(Type)).ToArray(); 534var parameterType = Type.GetType(typeName, throwOnError: false); 562private CodeExpression ConvertParameterValueToInferredType(Type inferredType, string rawValue, string parameterName) 589private CodeExpression ConvertToCodeExpression(string value, Type targetType) 591if (targetType == typeof(Type))
XamlTaskFactory\XamlTaskFactory.cs (1)
246public Type TaskType { get; } = null;
XslTransformation.cs (3)
504private static Type FindType(string assemblyPath, string typeName) 514var types = new List<Type>(); 515foreach (Type type in loadedAssembly.GetTypes())
Microsoft.Build.Tasks.UnitTests (2)
Exec_Tests.cs (1)
539Type execType = typeof(Exec);
TestAssemblyInfo.cs (1)
40var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
Microsoft.Build.Utilities.Core (2)
BuildEnvironmentHelper.cs (1)
399var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
PrintLineDebugger.cs (1)
26var commonWriterType = typeof(ITask).Assembly.GetType("Microsoft.Build.Shared.Debugging.CommonWriter", true, false);
Microsoft.Build.Utilities.UnitTests (2)
StringExtensions_Tests.cs (1)
68public void ReplaceWithStringComparerExceptionCases(string aString, string oldValue, string newValue, StringComparison stringComparison, Type expectedException)
TestAssemblyInfo.cs (1)
40var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
Microsoft.Cci.Extensions (2)
Extensions\CustomAttributeProvider.cs (2)
21|| Type.GetType(type) == typeof(Type); // encountered as serialized to reflection notation
Microsoft.CodeAnalysis (66)
CodeGen\BasicBlock.cs (2)
645var visType = System.Type.GetType("Roslyn.Test.Utilities.ILBuilderVisualizer, Roslyn.Test.Utilities", false);
CodeGen\ILBuilder.cs (2)
1268var visType = Type.GetType("Roslyn.Test.Utilities.ILBuilderVisualizer, Roslyn.Test.Utilities", false);
CommandLine\CommonCompiler.cs (5)
149internal abstract Type Type { get; } 159internal static string GetProductVersion(Type type) 178private static string? GetInformationalVersionWithoutHash(Type type) 185private static string? GetShortCommitHash(Type type) 869var type = generator.GetGeneratorType();
Compilation\Compilation.cs (6)
229internal static void ValidateScriptCompilationParameters(Compilation? previousScriptCompilation, Type? returnType, ref Type? globalsType) 526internal Type? SubmissionReturnType => ScriptCompilationInfo?.ReturnTypeOpt; 528internal static bool IsValidSubmissionReturnType(Type type) 536internal Type? HostObjectType => ScriptCompilationInfo?.GlobalsType; 538internal static bool IsValidHostObjectType(Type type)
Compilation\DeterministicKeyBuilder.cs (2)
90protected void WriteType(JsonWriter writer, string key, Type? type) 96protected void WriteType(JsonWriter writer, Type? type)
Compilation\ScriptCompilationInfo.cs (5)
11internal Type? ReturnTypeOpt { get; } 12public Type ReturnType => ReturnTypeOpt ?? typeof(object); 13public Type? GlobalsType { get; } 15internal ScriptCompilationInfo(Type? returnType, Type? globalsType)
Diagnostic\CommonMessageProvider.cs (1)
75public abstract Type ErrorCodeType { get; }
Diagnostic\DiagnosticInfo.cs (1)
108var type = arg.GetType();
Diagnostic\LocalizableResourceString.cs (3)
21private readonly Type _resourceSource; 30public LocalizableResourceString(string nameOfLocalizableResource, ResourceManager resourceManager, Type resourceSource) 42public LocalizableResourceString(string nameOfLocalizableResource, ResourceManager resourceManager, Type resourceSource, params string[] formatArguments)
DiagnosticAnalyzer\AnalyzerFileReference.cs (5)
223private static ImmutableSortedDictionary<string, ImmutableHashSet<string>> GetAnalyzerTypeNameMap(string fullPath, Type attributeType, AttributeLanguagesFunc languagesFunc) 257private static ImmutableArray<string> GetSupportedLanguages(TypeDefinition typeDef, PEModule peModule, Type attributeType, AttributeLanguagesFunc languagesFunc) 370private readonly Type _attributeType; 378internal Extensions(AnalyzerFileReference reference, Type attributeType, AttributeLanguagesFunc languagesFunc, bool allowNetFramework, Func<object?, TExtension?>? coerceFunction = null) 595Type? type;
DiaSymReader\SymUnmanagedFactory.cs (4)
33private static Type s_lazySymReaderComType, s_lazySymWriterComType; 153private static Type GetComTypeType(ref Type lazyType, Guid clsid) 226var comType = createReader ?
Generated\Operations.Generated.cs (1)
2054/// Represents an operation that gets <see cref="System.Type" /> for the given <see cref="TypeOperand" />.
InternalSpecialType.cs (2)
34/// Indicates that the type is <see cref="System.Type"/> from the COR library. 37/// Check for this special type cannot be used to find the "canonical" definition of <see cref="System.Type"/>
InternalUtilities\FatalError.cs (1)
78var targetType = assembly.GetType(typeof(FatalError).FullName!, throwOnError: true)!;
InternalUtilities\PlatformInformation.cs (2)
30return !(Type.GetType("Mono.Runtime") is null); 50return !(Type.GetType("Mono.RuntimeStructs", throwOnError: false) is null);
InternalUtilities\ReflectionUtilities.cs (13)
16private static readonly Type Missing = typeof(void); 18public static Type? TryGetType(string assemblyQualifiedName) 23return Type.GetType(assemblyQualifiedName, throwOnError: false); 31public static Type? TryGetType([NotNull] ref Type? lazyType, string assemblyQualifiedName) 42/// Find a <see cref="Type"/> instance by first probing the contract name and then the name as it 45public static Type? GetTypeFromEither(string contractName, string desktopName) 47var type = TryGetType(contractName); 57public static Type? GetTypeFromEither([NotNull] ref Type? lazyType, string contractName, string desktopName) 67public static T? FindItem<T>(IEnumerable<T> collection, params Type[] paramTypes) 97internal static MethodInfo? GetDeclaredMethod(this TypeInfo typeInfo, string name, params Type[] paramTypes) 102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes)
InternalUtilities\UICultureUtilities.cs (3)
25var type = Type.GetType(cultureInfoTypeNameGlobalization) ?? typeof(object).GetTypeInfo().Assembly.GetType(cultureInfoTypeName); 63var type = typeof(object).GetTypeInfo().Assembly.GetType(threadTypeName);
SourceGeneration\GeneratorDriver.cs (1)
442var type = generator.GetGeneratorType();
SourceGeneration\GeneratorExtensions.cs (2)
23public static Type GetGeneratorType(this ISourceGenerator generator) 37public static Type GetGeneratorType(this IIncrementalGenerator generator)
SourceGeneration\GeneratorTimerExtensions.cs (1)
35var type = generator.GetGeneratorType();
src\Dependencies\Collections\Internal\ThrowHelper.cs (4)
115internal static void ThrowWrongKeyTypeArgumentException<T>(T key, Type targetType) 122internal static void ThrowWrongValueTypeArgumentException<T>(T value, Type targetType) 217private static ArgumentException GetWrongKeyTypeArgumentException(object? key, Type targetType) 222private static ArgumentException GetWrongValueTypeArgumentException(object? value, Type targetType)
Microsoft.CodeAnalysis.CodeStyle (29)
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
66if (parentProperty is not nameof(System.Type.Name))
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
78var targetType = assembly.GetType(typeof(FatalError).FullName!, throwOnError: true)!;
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
30return !(Type.GetType("Mono.Runtime") is null); 50return !(Type.GetType("Mono.RuntimeStructs", throwOnError: false) is null);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (13)
16private static readonly Type Missing = typeof(void); 18public static Type? TryGetType(string assemblyQualifiedName) 23return Type.GetType(assemblyQualifiedName, throwOnError: false); 31public static Type? TryGetType([NotNull] ref Type? lazyType, string assemblyQualifiedName) 42/// Find a <see cref="Type"/> instance by first probing the contract name and then the name as it 45public static Type? GetTypeFromEither(string contractName, string desktopName) 47var type = TryGetType(contractName); 57public static Type? GetTypeFromEither([NotNull] ref Type? lazyType, string contractName, string desktopName) 67public static T? FindItem<T>(IEnumerable<T> collection, params Type[] paramTypes) 97internal static MethodInfo? GetDeclaredMethod(this TypeInfo typeInfo, string name, params Type[] paramTypes) 102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes)
src\Dependencies\Collections\Internal\ThrowHelper.cs (4)
115internal static void ThrowWrongKeyTypeArgumentException<T>(T key, Type targetType) 122internal static void ThrowWrongValueTypeArgumentException<T>(T value, Type targetType) 217private static ArgumentException GetWrongKeyTypeArgumentException(object? key, Type targetType) 222private static ArgumentException GetWrongValueTypeArgumentException(object? value, Type targetType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\ChainedFormattingRules.cs (4)
20private static readonly ConcurrentDictionary<(Type type, string name), Type?> s_typeImplementingMethod = []; 87var type = GetTypeImplementingMethod(rule, name); 102private static Type? GetTypeImplementingMethod(object obj, string name)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (3)
66public abstract Type Type { get; } 90public static bool IsSupportedOptionType(Type type) 122public override Type Type
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
169var type = value.GetType();
Microsoft.CodeAnalysis.CodeStyle.Fixes (14)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (6)
139var wantedType = typeof(TSyntaxNode); 141var expressionType = typeof(TExpressionSyntax); 142var argumentType = typeof(TArgumentSyntax); 143var expressionStatementType = typeof(TExpressionStatementSyntax); 149static bool IsAEqualOrSubclassOfB(Type a, Type b)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (2)
20public static string GetAssemblyQualifiedServiceTypeName(Type type, string argName) 24Type serviceType,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (3)
26private ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 27= ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)>.Empty; 129private bool TryGetService(Type serviceType, [NotNullWhen(true)] out Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, out bool usesFactory)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (3)
28private ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 29= ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)>.Empty; 138private bool TryGetService(Type serviceType, [NotNullWhen(true)] out Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, out bool usesFactory)
Microsoft.CodeAnalysis.Collections.Package (4)
Internal\ThrowHelper.cs (4)
115internal static void ThrowWrongKeyTypeArgumentException<T>(T key, Type targetType) 122internal static void ThrowWrongValueTypeArgumentException<T>(T value, Type targetType) 217private static ArgumentException GetWrongKeyTypeArgumentException(object? key, Type targetType) 222private static ArgumentException GetWrongValueTypeArgumentException(object? value, Type targetType)
Microsoft.CodeAnalysis.CSharp (20)
CommandLine\CSharpCompiler.cs (1)
305internal override Type Type
Compilation\CSharpCompilation.cs (10)
382Type? returnType = null, 383Type? globalsType = null) 405Type? returnType, 406Type? hostObjectType, 456Type? submissionReturnType, 457Type? hostObjectType, 473Type? submissionReturnType, 474Type? hostObjectType, 1759internal TypeSymbol GetTypeByReflectionType(Type type, BindingDiagnosticBag diagnostics) 1772private static CSDiagnosticInfo CreateReflectionTypeNotFoundError(Type type)
Compilation\CSharpScriptCompilationInfo.cs (2)
14internal CSharpScriptCompilationInfo(CSharpCompilation? previousCompilationOpt, Type? returnType, Type? globalsType)
Errors\MessageProvider.cs (1)
82public override Type ErrorCodeType
SymbolDisplay\ObjectDisplay.cs (1)
48Type type = obj.GetType();
Symbols\AssemblySymbol.cs (5)
743/// Resolves <see cref="System.Type"/> to a <see cref="TypeSymbol"/> available in this assembly 748internal TypeSymbol? GetTypeByReflectionType(Type type) 784Type[] genericArguments = typeInfo.GenericTypeArguments; 852Type[] genericArguments = typeInfo.GenericTypeArguments; 859private NamedTypeSymbol? ApplyGenericArguments(NamedTypeSymbol symbol, Type[] typeArguments, ref int currentTypeArgument)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Lightup\NullableSyntaxAnnotationEx.cs (1)
21var nullableSyntaxAnnotation = typeof(Workspace).Assembly.GetType("Microsoft.CodeAnalysis.CodeGeneration.NullableSyntaxAnnotation", throwOnError: false);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Interactive\CSharpInteractiveEvaluatorLanguageInfoProvider.cs (1)
53public override Type ReplServiceProviderType
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (67)
Completion\ArgumentProviders\ContextVariableArgumentProviderTests.cs (1)
16internal override Type GetArgumentProviderType()
Completion\ArgumentProviders\DefaultArgumentProviderTests.cs (1)
16internal override Type GetArgumentProviderType()
Completion\ArgumentProviders\OutVariableArgumentProviderTests.cs (1)
41internal override Type GetArgumentProviderType()
Completion\CompletionProviders\AttributeNamedParameterCompletionProviderTests.cs (1)
21internal override Type GetCompletionProviderType()
Completion\CompletionProviders\AwaitCompletionProviderTests.cs (1)
25internal override Type GetCompletionProviderType() => typeof(AwaitCompletionProvider);
Completion\CompletionProviders\ConversionCompletionProviderTests.cs (1)
20internal override Type GetCompletionProviderType()
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
27internal override Type GetCompletionProviderType()
Completion\CompletionProviders\DeclarationNameCompletionProviderTests.cs (1)
331internal override Type GetCompletionProviderType()
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProviderTests.cs (1)
17internal override Type GetCompletionProviderType()
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProviderTests.cs (1)
17internal override Type GetCompletionProviderType()
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProviderTests.cs (1)
17internal override Type GetCompletionProviderType()
Completion\CompletionProviders\ExtensionMethodImportCompletionProviderTests.cs (1)
32internal override Type GetCompletionProviderType()
Completion\CompletionProviders\ExternAliasCompletionProviderTests.cs (1)
19internal override Type GetCompletionProviderType()
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProviderTests.cs (1)
18internal override Type GetCompletionProviderType() => typeof(FunctionPointerUnmanagedCallingConventionCompletionProvider);
Completion\CompletionProviders\IndexerCompletionProviderTests.cs (1)
18internal override Type GetCompletionProviderType()
Completion\CompletionProviders\KeywordCompletionProviderTests.cs (1)
19internal override Type GetCompletionProviderType()
Completion\CompletionProviders\LoadDirectiveCompletionProviderTests.cs (1)
25internal override Type GetCompletionProviderType()
Completion\CompletionProviders\NamedParameterCompletionProviderTests.cs (1)
19internal override Type GetCompletionProviderType()
Completion\CompletionProviders\ObjectCreationCompletionProviderTests.cs (1)
20internal override Type GetCompletionProviderType()
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (1)
22internal override Type GetCompletionProviderType()
Completion\CompletionProviders\OperatorCompletionProviderTests.cs (1)
20internal override Type GetCompletionProviderType()
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (1)
29internal override Type GetCompletionProviderType()
Completion\CompletionProviders\OverrideCompletionProviderTests_ExpressionBody.cs (1)
23internal override Type GetCompletionProviderType()
Completion\CompletionProviders\PartialMethodCompletionProviderTests.cs (1)
22internal override Type GetCompletionProviderType()
Completion\CompletionProviders\PartialTypeCompletionProviderTests.cs (1)
18internal override Type GetCompletionProviderType()
Completion\CompletionProviders\PropertySubPatternCompletionProviderTests.cs (1)
19internal override Type GetCompletionProviderType()
Completion\CompletionProviders\ReferenceDirectiveCompletionProviderTests.cs (1)
28internal override Type GetCompletionProviderType()
Completion\CompletionProviders\SemanticSnippetCompletionProviderTests.cs (1)
22internal override Type GetCompletionProviderType()
Completion\CompletionProviders\SnippetCompletionProviderTests.cs (1)
29internal override Type GetCompletionProviderType()
Completion\CompletionProviders\SpeculativeTCompletionProviderTests.cs (1)
19internal override Type GetCompletionProviderType()
Completion\CompletionProviders\SuggestionModeCompletionProviderTests.cs (1)
22internal override Type GetCompletionProviderType()
Completion\CompletionProviders\SymbolCompletionProviderTests.cs (1)
24internal override Type GetCompletionProviderType()
Completion\CompletionProviders\SymbolCompletionProviderTests_NoInteractive.cs (1)
27internal override Type GetCompletionProviderType()
Completion\CompletionProviders\TupleNameCompletionProviderTests.cs (1)
19internal override Type GetCompletionProviderType() => typeof(TupleNameCompletionProvider);
Completion\CompletionProviders\TypeImportCompletionProviderTests.cs (1)
23internal override Type GetCompletionProviderType()
Completion\CompletionProviders\XmlDocumentationCommentCompletionProviderTests.cs (1)
23internal override Type GetCompletionProviderType()
Completion\CompletionServiceTests.cs (1)
93public Type Type => typeof(int);
KeywordHighlighting\AsyncAnonymousFunctionHighlighterTests.cs (1)
18internal override Type GetHighlighterType()
KeywordHighlighting\AsyncLocalFunctionHighlighterTests.cs (1)
17internal override Type GetHighlighterType()
KeywordHighlighting\AsyncMethodHighlighterTests.cs (1)
18internal override Type GetHighlighterType()
KeywordHighlighting\AwaitHighlighterTests.cs (1)
19internal override Type GetHighlighterType()
KeywordHighlighting\CheckedExpressionHighlighterTests.cs (1)
18internal override Type GetHighlighterType()
KeywordHighlighting\CheckedStatementHighlighterTests.cs (1)
18internal override Type GetHighlighterType()
KeywordHighlighting\ConditionalPreprocessorHighlighterTests.cs (1)
18internal override Type GetHighlighterType()
KeywordHighlighting\IfStatementHighlighterTests.cs (1)
18internal override Type GetHighlighterType()
KeywordHighlighting\LockStatementHighlighterTests.cs (1)
17internal override Type GetHighlighterType()
KeywordHighlighting\LoopHighlighterTests.cs (1)
18internal override Type GetHighlighterType()
KeywordHighlighting\RegionHighlighterTests.cs (1)
18internal override Type GetHighlighterType()
KeywordHighlighting\ReturnStatementHighlighterTests.cs (1)
18internal override Type GetHighlighterType()
KeywordHighlighting\SwitchStatementHighlighterTests.cs (1)
19internal override Type GetHighlighterType()
KeywordHighlighting\TryStatementHighlighterTests.cs (1)
18internal override Type GetHighlighterType()
KeywordHighlighting\UnsafeStatementHighlighterTests.cs (1)
17internal override Type GetHighlighterType()
KeywordHighlighting\UsingStatementHighlighterTests.cs (1)
17internal override Type GetHighlighterType()
KeywordHighlighting\YieldStatementHighlighterTests.cs (1)
18internal override Type GetHighlighterType()
LanguageServer\CSharpLspBuildOnlyDiagnosticsTests.cs (2)
16protected override Type ErrorCodeType => typeof(ErrorCode); 18protected override Type LspBuildOnlyDiagnosticsType => typeof(CSharpLspBuildOnlyDiagnostics);
SignatureHelp\AttributeSignatureHelpProviderTests.cs (1)
22internal override Type GetSignatureHelpProviderType()
SignatureHelp\ConstructorInitializerSignatureHelpProviderTests.cs (1)
21internal override Type GetSignatureHelpProviderType()
SignatureHelp\ElementAccessExpressionSignatureHelpProviderTests.cs (2)
21internal override Type GetSignatureHelpProviderType() 868internal override Type GetSignatureHelpProviderType()
SignatureHelp\GenericNamePartiallyWrittenSignatureHelpProviderTests.cs (1)
22internal override Type GetSignatureHelpProviderType()
SignatureHelp\GenericNameSignatureHelpProviderTests.cs (1)
24internal override Type GetSignatureHelpProviderType()
SignatureHelp\InitializerExpressionSignatureHelpProviderTests.cs (1)
21internal override Type GetSignatureHelpProviderType()
SignatureHelp\InvocationExpressionSignatureHelpProviderTests.cs (1)
20internal override Type GetSignatureHelpProviderType()
SignatureHelp\ObjectCreationExpressionSignatureHelpProviderTests.cs (1)
21internal override Type GetSignatureHelpProviderType()
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProviderTests.cs (1)
21internal override Type GetSignatureHelpProviderType()
SignatureHelp\TupleConstructionSignatureHelpProviderTests.cs (1)
21internal override Type GetSignatureHelpProviderType()
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\KeywordRecommenderTests.cs (1)
22foreach (var recommenderType in typeof(AbstractSyntacticSingleKeywordRecommender).Assembly.GetTypes())
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
CodeGen\CodeGenFunctionPointersTests.cs (4)
99var funcPtr = m.ReturnType; 121var funcPtr = m.ReturnType; 194var returnType = m.ReturnType; 645var returnType = m.ReturnType;
CodeGen\CodeGenIncrementTests.cs (1)
1006Type type = typeof(T);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\EditAndContinue\EditAndContinueTests.cs (1)
12768public void SymReaderErrors(Type exceptionType)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (1)
src\Compilers\CSharp\Portable\SymbolDisplay\ObjectDisplay.cs (1)
48Type type = obj.GetType();
Microsoft.CodeAnalysis.CSharp.Features (2)
Structure\CSharpBlockStructureProvider.cs (2)
16private static ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> CreateDefaultNodeProviderMap() 18var builder = ImmutableDictionary.CreateBuilder<Type, ImmutableArray<AbstractSyntaxStructureProvider>>();
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
ConvertToRecord\ConvertToRecordCodeRefactoringTests.cs (1)
4709protected override IEnumerable<Type> GetSourceGenerators()
Microsoft.CodeAnalysis.CSharp.Scripting (11)
CSharpScript.cs (8)
33public static Script<T> Create<T>(string code, ScriptOptions options = null, Type globalsType = null, InteractiveAssemblyLoader assemblyLoader = null) 50public static Script<T> Create<T>(Stream code, ScriptOptions options = null, Type globalsType = null, InteractiveAssemblyLoader assemblyLoader = null) 65public static Script<object> Create(string code, ScriptOptions options = null, Type globalsType = null, InteractiveAssemblyLoader assemblyLoader = null) 81public static Script<object> Create(Stream code, ScriptOptions options = null, Type globalsType = null, InteractiveAssemblyLoader assemblyLoader = null) 98public static Task<ScriptState<T>> RunAsync<T>(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken)) 112public static Task<ScriptState<object>> RunAsync(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken)) 128public static Task<T> EvaluateAsync<T>(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken)) 143public static Task<object> EvaluateAsync(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken))
Hosting\CommandLine\Csi.cs (1)
32internal override Type Type => typeof(CSharpInteractiveCompiler);
Hosting\CSharpReplServiceProvider.cs (1)
27public override Script<T> CreateScript<T>(string code, ScriptOptions options, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoader)
Hosting\ObjectFormatter\CSharpTypeNameFormatter.cs (1)
52public override string FormatTypeName(Type type, CommonTypeNameFormatterOptions options)
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (3)
InteractiveSessionReferencesTests.cs (2)
455var s1 = s0.ContinueWith<Type>("System.Type.GetType(x.GetType().AssemblyQualifiedName, true)"); 573var globalsType = libAssembly.GetType("C");
ObjectFormatterTests.cs (1)
116var c = a.GetType("C");
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (3)
InteractiveSessionTests.cs (2)
275Type c = CSharpScript.EvaluateAsync<Type>(source, ScriptOptions).Result;
ScriptTests.cs (1)
405AssertEx.Equal(new Type[] { typeof(char), typeof(uint), typeof(decimal), typeof(decimal), typeof(int) }, state.Variables.Select(v => v.Type));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\SemanticErrorTests.cs (2)
1807var integralTypes = new Type[] 1818foreach (Type t in integralTypes)
SourceGeneration\GeneratorDriverTests.cs (2)
4262var type = incrementalGenerator.GetGeneratorType(); 4284var type = sourceGenerator.GetGeneratorType();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (7)
Compilation\CompilationAPITests.cs (4)
2395var genericParameter = typeof(List<>).GetGenericArguments()[0]; 2396var open = typeof(Dictionary<,>).MakeGenericType(typeof(int), genericParameter); 2397var ptr = typeof(int).MakePointerType(); 2398var byref = typeof(int).MakeByRefType();
Symbols\AnonymousTypesSymbolTests.cs (2)
238Type type = refAsm.GetType("<>f__AnonymousType0`2"); 246private void CheckField(FieldInfo field, Type fieldType)
Symbols\Metadata\PE\LoadingAttributes.cs (1)
472var stringType = typeof(string);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxFactoryTests.cs (1)
121Type exceptionType;
Microsoft.CodeAnalysis.CSharp.Test.Utilities (7)
CSharpTestBase.cs (4)
1459Type returnType = null, 1460Type hostObjectType = null) 1482Type returnType = null, 1483Type hostObjectType = null)
Extensions.cs (3)
455var expType = expected as Type; 469private static bool IsEqual(TypeSymbol typeSym, Type expType)
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Classification\SyntaxClassification\DiscardSyntaxClassifier.cs (1)
18public override ImmutableArray<Type> SyntaxNodeTypes { get; } = [typeof(DiscardDesignationSyntax), typeof(DiscardPatternSyntax), typeof(ParameterSyntax), typeof(IdentifierNameSyntax)];
Classification\SyntaxClassification\FunctionPointerUnmanagedCallingConventionClassifier.cs (1)
19public override ImmutableArray<Type> SyntaxNodeTypes { get; } = [typeof(FunctionPointerUnmanagedCallingConventionSyntax)];
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
36public override ImmutableArray<Type> SyntaxNodeTypes { get; } =
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.cs (1)
18public override ImmutableArray<Type> SyntaxNodeTypes { get; } =
Classification\SyntaxClassification\UsingDirectiveSyntaxClassifier.cs (1)
32public override ImmutableArray<Type> SyntaxNodeTypes { get; } = [typeof(UsingDirectiveSyntax)];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Lightup\NullableSyntaxAnnotationEx.cs (1)
21var nullableSyntaxAnnotation = typeof(Workspace).Assembly.GetType("Microsoft.CodeAnalysis.CodeGeneration.NullableSyntaxAnnotation", throwOnError: false);
Workspace\LanguageServices\CSharpCompilationFactoryService.cs (1)
33Compilation ICompilationFactoryService.CreateSubmissionCompilation(string assemblyName, CompilationOptions options, Type? hostObjectType)
Microsoft.CodeAnalysis.EditorFeatures (8)
Editor\EditorLayerExtensionManager.cs (1)
62var providerType = provider.GetType();
EditorConfigSettings\Data\CodeStyleSetting`1.cs (1)
41public override Type Type
EditorConfigSettings\Data\EnumFlagsSetting.cs (1)
31public override Type Type
EditorConfigSettings\Data\Setting.cs (1)
28public abstract Type Type { get; }
EditorConfigSettings\Data\Setting`1.cs (1)
23public override Type Type
Extensibility\Commands\ExportInteractiveCommandAttribute.cs (1)
15internal class ExportInteractiveAttribute(Type t, params string[] contentTypes) : ExportAttribute(t)
ExternalAccess\VSTypeScript\Api\ExportTypeScriptLspRequestHandlerProviderAttribute.cs (1)
12internal class ExportTypeScriptLspServiceFactoryAttribute(Type handlerType) : ExportLspServiceFactoryAttribute(handlerType, ProtocolConstants.TypeScriptLanguageContract)
Interactive\InteractiveEvaluatorLanguageInfoProvider.cs (1)
18public abstract Type ReplServiceProviderType { get; }
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (17)
Completion\AbstractArgumentProviderTests`1.cs (1)
41internal abstract Type GetArgumentProviderType();
Completion\AbstractCompletionProviderTests.cs (1)
493internal abstract Type GetCompletionProviderType();
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
28internal abstract Type GetHighlighterType();
LanguageServer\AbstractLspBuildOnlyDiagnosticsTests.cs (2)
18protected abstract Type ErrorCodeType { get; } 19protected abstract Type LspBuildOnlyDiagnosticsType { get; }
SignatureHelp\AbstractSignatureHelpProviderTests.cs (4)
34internal abstract Type GetSignatureHelpProviderType(); 130var signatureHelpProviderType = GetSignatureHelpProviderType(); 173var signatureHelpProviderType = GetSignatureHelpProviderType(); 383var signatureHelpProviderType = GetSignatureHelpProviderType();
Threading\ConditionalWpfFactAttribute.cs (1)
13public ConditionalWpfFactAttribute(Type skipCondition)
Threading\ConditionalWpfTheoryAttribute.cs (1)
13public ConditionalWpfTheoryAttribute(Type skipCondition)
Threading\WpfTestCaseRunner.cs (1)
35protected override XunitTestRunner CreateTestRunner(ITest test, IMessageBus messageBus, Type testClass, object[] constructorArguments, MethodInfo testMethod, object[] testMethodArguments, string skipReason, IReadOnlyList<BeforeAfterTestAttribute> beforeAfterAttributes, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource)
Threading\WpfTestRunner.cs (1)
40Type testClass,
Threading\WpfTheoryTestCaseRunner.cs (1)
35protected override XunitTestRunner CreateTestRunner(ITest test, IMessageBus messageBus, Type testClass, object[] constructorArguments, MethodInfo testMethod, object[] testMethodArguments, string skipReason, IReadOnlyList<BeforeAfterTestAttribute> beforeAfterAttributes, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource)
Workspaces\EditorTestHostProject.cs (1)
24Type? hostObjectType = null,
Workspaces\EditorTestWorkspace.cs (1)
86Type? hostObjectType = null,
Workspaces\TestWorkspaceFixture.cs (1)
118var textFormattingRunPropertiesType = typeof(VisualStudio.Text.Formatting.TextFormattingRunProperties);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (26)
CodeActions\CodeChangeProviderMetadataTests.cs (7)
27public void TestNameMetadataIsPresent(Type providerType) 54public void TestNameMetadataIsUniqueAmongProviders(Type providerType, string language) 89public void TestNameMetadataIsInPredefinedNames(Type providerType, Type predefinedNamesType) 116public void TestAllPredefinedNamesUsedAsNameMetadata(Type providerType, Type predefinedNamesType) 152private static ImmutableHashSet<string> GetPredefinedNamesFromType(Type namesType)
CodeGeneration\CodeGenerationTests.cs (14)
138Type returnType = null, 183Type returnType = null, 223Type returnType = null, 265Type toType, 341Type returnType = null, 375Type type = null, 416Type type = null, 532Type attributeClass, 549Type attributeClass) where T : SyntaxNode 655internal static Func<SemanticModel, IParameterSymbol> Parameter(Type type, string name, bool hasDefaultValue = false, object defaultValue = null, bool isParams = false) 669private static ITypeSymbol GetTypeSymbol(Compilation compilation, Type type) 684internal static Func<SemanticModel, ITypeSymbol> CreateArrayType(Type type, int rank = 1) 712internal static Func<SemanticModel, ISymbol> CreateField(Accessibility accessibility, Editing.DeclarationModifiers modifiers, Type type, string name) 719private static Func<SemanticModel, INamedTypeSymbol> GetTypeSymbol(Type type)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
41private static AdhocWorkspace CreateWorkspace(Type[] additionalParts = null)
Diagnostics\IDEDiagnosticIDUniquenessTest.cs (1)
19var type = typeof(IDEDiagnosticIds);
EditAndContinue\EditAndContinueLanguageServiceTests.cs (1)
46private TestWorkspace CreateEditorWorkspace(out Solution solution, out EditAndContinueService service, out EditAndContinueLanguageService languageService, Type[] additionalParts = null)
Options\GlobalOptionsTests.cs (2)
109static void Recurse(Type type, object options, object defaultOptions, string? language) 134var propertyType = Nullable.GetUnderlyingType(property.PropertyType) ?? property.PropertyType;
Microsoft.CodeAnalysis.EditorFeatures.Wpf (27)
artifacts\obj\Microsoft.CodeAnalysis.EditorFeatures.Wpf\Release\net472\GeneratedInternalTypeHelper.g.cs (2)
24protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) { 46protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
artifacts\obj\Microsoft.CodeAnalysis.EditorFeatures.Wpf\Release\net472\InlineRename\UI\Adornment\RenameFlyout.g.cs (1)
156internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
artifacts\obj\Microsoft.CodeAnalysis.EditorFeatures.Wpf\Release\net472\InlineRename\UI\Dashboard\RenameDashboard.g.cs (1)
186internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
Lightup\ISmartRenameSessionFactoryWrapper.cs (1)
17private static readonly Type s_wrappedType;
Lightup\ISmartRenameSessionWrapper.cs (3)
22private static readonly Type s_wrappedType; 23private static readonly Type? s_wrappedRenameContextType; 72var immutableArrayOfRenameContextType = typeof(ImmutableArray<>).MakeGenericType(s_wrappedRenameContextType);
Lightup\LightupHelpers.cs (17)
15private static readonly ConcurrentDictionary<Type, ConcurrentDictionary<Type, bool>> s_supportedObjectWrappers = new(); 17internal static bool CanWrapObject(object obj, Type underlyingType) 31var wrappedObject = s_supportedObjectWrappers.GetOrAdd(underlyingType, static _ => new ConcurrentDictionary<Type, bool>()); 58public static Func<T, TResult> CreatePropertyAccessor<T, TResult>(Type? type, string propertyName, TResult defaultValue) 110public static Action<T> CreateActionAccessor<T>(Type? type, string methodName) 166public static Action<T, TArg> CreateActionAccessor<T, TArg>(Type? type, string methodName, Type? argType) 239public static Func<T, TResult> CreateGenericFunctionAccessor<T, TResult>(Type? type, string methodName, Type genericArgumentType, TResult defaultValue) 294public static Func<T, TResult> CreateFunctionAccessor<T, TResult>(Type? type, string methodName, TResult defaultValue) 353public static Func<T, TArg, TResult> CreateFunctionAccessor<T, TArg, TResult>(Type? type, string methodName, Type? argType, TResult defaultValue) 434public static Func<T, TArg0, TArg1, TResult> CreateFunctionAccessor<T, TArg0, TArg1, TResult>(Type? type, string methodName, Type? arg0Type, Type? arg1Type, TResult defaultValue) 500private static string GenerateParameterName(Type parameterType)
QuickInfo\OnTheFlyDocsViewStateVisibilityConverter.cs (2)
17public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 20public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
ExpressionEvaluatorFatalError.cs (1)
24var registryType = typeof(object).GetTypeInfo().Assembly.GetType("Microsoft.Win32.Registry");
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (15)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
78var targetType = assembly.GetType(typeof(FatalError).FullName!, throwOnError: true)!;
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (13)
16private static readonly Type Missing = typeof(void); 18public static Type? TryGetType(string assemblyQualifiedName) 23return Type.GetType(assemblyQualifiedName, throwOnError: false); 31public static Type? TryGetType([NotNull] ref Type? lazyType, string assemblyQualifiedName) 42/// Find a <see cref="Type"/> instance by first probing the contract name and then the name as it 45public static Type? GetTypeFromEither(string contractName, string desktopName) 47var type = TryGetType(contractName); 57public static Type? GetTypeFromEither([NotNull] ref Type? lazyType, string contractName, string desktopName) 67public static T? FindItem<T>(IEnumerable<T> collection, params Type[] paramTypes) 97internal static MethodInfo? GetDeclaredMethod(this TypeInfo typeInfo, string name, params Type[] paramTypes) 102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes)
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\ExpressionEvaluatorFatalError.cs (1)
24var registryType = typeof(object).GetTypeInfo().Assembly.GetType("Microsoft.Win32.Registry");
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (50)
Debugger\Engine\DkmClrAppDomain.cs (2)
31internal ConcurrentDictionary<Type, ReadOnlyCollection<DkmClrEvalAttribute>> TypeToEvalAttributesMap { get; } 36TypeToEvalAttributesMap = new ConcurrentDictionary<Type, ReadOnlyCollection<DkmClrEvalAttribute>>();
Debugger\Engine\DkmClrModuleInstance.cs (2)
49var type = this.Assembly.GetType(typeName); 91foreach (var type in _assembly.GetTypes())
Debugger\Engine\DkmClrRuntimeInstance.cs (3)
73internal DkmClrType GetType(System.Type type) 80internal DkmClrType GetType(string typeName, params System.Type[] typeArguments) 85var type = assembly.GetType(typeName);
Debugger\Engine\DkmClrType.cs (12)
74internal System.Type UnderlyingType 169private static System.Type GetProxyType(System.Type type) 193var reflectionType = ((TypeImpl)type).Type; 199static ReadOnlyCollection<DkmClrEvalAttribute> getEvalAttributesCore(System.Type reflectionType, Type type) 203var proxyType = GetProxyType(reflectionType); 265private static DkmClrDebuggerDisplayAttribute GetDebuggerDisplayAttribute(System.Type type) 281private static DkmClrDebuggerVisualizerAttribute[] GetDebuggerVisualizerAttributes(System.Type type) 293var argValueTypeBuilder = ArrayBuilder<System.Type>.GetInstance(); 298System.Type argValueType = null; 308argValueType = typedArg.Value as System.Type; 336System.Type debuggeeSideType = argValueTypeBuilder[1];
Debugger\Engine\DkmClrValue.cs (2)
293var type = ((TypeImpl)this.Type.GetLmrType()).Type; 768var destinationType = elementType.IsPointer
Debugger\Engine\DkmReportNonFatalWatsonExceptionAttribute.cs (1)
26public Type ExcludeExceptionType { get; set; }
Debugger\MemberInfo\TypeImpl.cs (7)
20internal readonly System.Type Type; 22internal TypeImpl(System.Type type) 28public static explicit operator TypeImpl(System.Type type) 394return new PropertyInfoImpl(Type.GetProperty(name, (System.Reflection.BindingFlags)bindingAttr, binder: null, returnType: null, types: new System.Type[0], modifiers: new System.Reflection.ParameterModifier[0])); 399return (TypeCode)System.Type.GetTypeCode(this.Type); 454var t = this.Type; 456foreach (var @interface in t.GetInterfaces())
ReflectionUtilities.cs (1)
22internal static object Instantiate(this Type type, params object[] args)
ResultProviderTestBase.cs (5)
27var exceptionType = typeof(Microsoft.CSharp.RuntimeBinder.RuntimeBinderException).Assembly.GetType( 61Type type = null, 122internal string FormatValue(object value, Type type, bool useHexadecimal = false) 139internal bool HasUnderlyingString(object value, Type type) 151internal DkmClrValue GetValueForUnderlyingString(object value, Type type)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
78var targetType = assembly.GetType(typeof(FatalError).FullName!, throwOnError: true)!;
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (13)
16private static readonly Type Missing = typeof(void); 18public static Type? TryGetType(string assemblyQualifiedName) 23return Type.GetType(assemblyQualifiedName, throwOnError: false); 31public static Type? TryGetType([NotNull] ref Type? lazyType, string assemblyQualifiedName) 42/// Find a <see cref="Type"/> instance by first probing the contract name and then the name as it 45public static Type? GetTypeFromEither(string contractName, string desktopName) 47var type = TryGetType(contractName); 57public static Type? GetTypeFromEither([NotNull] ref Type? lazyType, string contractName, string desktopName) 67public static T? FindItem<T>(IEnumerable<T> collection, params Type[] paramTypes) 97internal static MethodInfo? GetDeclaredMethod(this TypeInfo typeInfo, string name, params Type[] paramTypes) 102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes)
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\ExpressionEvaluatorFatalError.cs (1)
24var registryType = typeof(object).GetTypeInfo().Assembly.GetType("Microsoft.Win32.Registry");
Microsoft.CodeAnalysis.ExternalAccess.Copilot (3)
Internal\Analyzer\CSharp\CSharpCopilotCodeAnalysisService.ReflectionWrapper.cs (3)
43private readonly Type? _analyzerType; 58var analyzerType = assembly.GetType(InternalCSharpCopilotAnalyzerTypeFullName); 83private T? CreateDelegate<T>(string methodName, Type[] types) where T : Delegate
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.UnitTests (2)
EnumTests.cs (2)
26public void AssertEnumsInSync(Type internalType, Type externalType)
Microsoft.CodeAnalysis.ExternalAccess.Razor (12)
Cohost\ExportCohostLspServiceFactoryAttribute.cs (1)
12internal class ExportCohostLspServiceFactoryAttribute(Type handlerType) : ExportLspServiceFactoryAttribute(handlerType, ProtocolConstants.RoslynLspLanguagesContract, WellKnownLspServerKinds.AlwaysActiveVSLspServer);
Cohost\ExportCohostStatelessLspServiceAttribute.cs (1)
12internal sealed class ExportCohostStatelessLspServiceAttribute(Type handlerType) : ExportStatelessLspServiceAttribute(handlerType, ProtocolConstants.RoslynLspLanguagesContract, WellKnownLspServerKinds.AlwaysActiveVSLspServer);
RazorDocumentServiceProviderWrapper.cs (1)
32var serviceType = typeof(TService);
Remote\RazorRemoteServiceCallbackDispatcherRegistry.cs (4)
14public static readonly RazorRemoteServiceCallbackDispatcherRegistry Empty = new(Array.Empty<(Type, RazorRemoteServiceCallbackDispatcher)>()); 16private readonly ImmutableDictionary<Type, RazorRemoteServiceCallbackDispatcher> _lazyDispatchers; 18public RazorRemoteServiceCallbackDispatcherRegistry(IEnumerable<(Type serviceType, RazorRemoteServiceCallbackDispatcher dispatcher)> lazyDispatchers) 23IRemoteServiceCallbackDispatcher IRemoteServiceCallbackDispatcherProvider.GetDispatcher(Type serviceType)
Remote\RazorServiceDescriptorsWrapper.cs (5)
30IEnumerable<(Type serviceInterface, Type? callbackInterface)> interfaces) 40IEnumerable<(Type serviceInterface, Type? callbackInterface)> interfaces) 46public ServiceJsonRpcDescriptor GetDescriptorForServiceFactory(Type serviceInterface)
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (4)
RazorPredefinedProviderNameTests.cs (4)
21internal void RoslynNamesExistAndValuesMatchInRazorNamesClass(Type roslynProviderNamesType, Type razorProviderNamesType) 49private static ImmutableDictionary<string, string> GetPredefinedNamesFromFields(Type namesType) 56private static ImmutableDictionary<string, string> GetPredefinedNamesFromProperties(Type namesType)
Microsoft.CodeAnalysis.ExternalAccess.Xaml (3)
External\ExportXamlLspServiceFactoryAttribute.cs (2)
18public ExportXamlLspServiceFactoryAttribute(Type type, WellKnownLspServerKinds serverKind) 23public ExportXamlLspServiceFactoryAttribute(Type type)
External\ExportXamlStatelessLspServiceAttribute.cs (1)
17public ExportXamlStatelessLspServiceAttribute(Type handlerType) : base(handlerType, ProtocolConstants.RoslynLspLanguagesContract)
Microsoft.CodeAnalysis.Features (21)
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.cs (1)
121else if (defaultValue.Value?.GetType() is Type t && t.IsEnum)
Diagnostics\DiagnosticAnalyzerTelemetry.cs (4)
45private ImmutableDictionary<Type, Data> _analyzerInfoMap; 48=> _analyzerInfoMap = ImmutableDictionary<Type, Data>.Empty; 60ImmutableDictionary<Type, Data> map; 64_analyzerInfoMap = ImmutableDictionary<Type, Data>.Empty;
EmbeddedLanguages\ExportEmbeddedLanguageFeatureServiceAttribute.cs (2)
42Type contractType, string name, string[] languages, params string[] identifiers) 48Type contractType, string name, string[] languages, bool supportsUnannotatedAPIs, params string[] identifiers)
FindUsages\AbstractFindUsagesService_FindReferences.cs (1)
239tokenValue, Type.GetTypeCode(tokenValue.GetType()), solution, progressAdapter, cancellationToken).ConfigureAwait(false);
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (1)
122var type = codeAction.GetType();
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
541Compilation compilation, SyntaxGenerator generator, Type type)
Organizing\AbstractOrganizingService.cs (2)
35var map = new ConcurrentDictionary<Type, IEnumerable<ISyntaxOrganizer>>(); 36IEnumerable<ISyntaxOrganizer> getter(Type t1)
Organizing\Organizers\AbstractSyntaxNodeOrganizer.cs (1)
16public IEnumerable<Type> SyntaxNodeTypes => [typeof(TSyntaxNode)];
Organizing\Organizers\ISyntaxOrganizer.cs (1)
18IEnumerable<Type> SyntaxNodeTypes { get; }
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
66if (parentProperty is not nameof(System.Type.Name))
Structure\Syntax\AbstractBlockStructureProvider.cs (2)
21private readonly ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> _nodeProviderMap; 25ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> defaultNodeOutlinerMap,
Structure\Syntax\BlockSpanCollector.cs (3)
16private readonly ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> _nodeProviderMap; 22ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> nodeOutlinerMap, 35ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>> nodeOutlinerMap,
Structure\Syntax\BlockStructureExtensions.cs (1)
15this ImmutableDictionary<Type, ImmutableArray<AbstractSyntaxStructureProvider>>.Builder builder)
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
BrokeredServices\MockServiceBroker.cs (1)
16public Func<Type, object>? CreateService;
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
69internal TestWorkspace CreateWorkspace(out Solution solution, out EditAndContinueService service, Type[]? additionalParts = null)
Microsoft.CodeAnalysis.InteractiveHost (7)
Interactive\Core\InteractiveHost.cs (2)
47private readonly Type _replServiceProviderType; 73Type replServiceProviderType,
Interactive\Core\InteractiveHost.Service.cs (2)
170var replServiceProviderType = Type.GetType(replServiceProviderTypeName);
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
78var targetType = assembly.GetType(typeof(FatalError).FullName!, throwOnError: true)!;
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
30return !(Type.GetType("Mono.Runtime") is null); 50return !(Type.GetType("Mono.RuntimeStructs", throwOnError: false) is null);
Microsoft.CodeAnalysis.LanguageServer (4)
ExtensionTypeRefResolver.cs (3)
15protected override Type? ResolveCore(TypeRef typeRef) 19var result = Type.GetType(
Services\StarredCompletions\StarredCompletionsAssemblyHelper.cs (1)
125var completionHelperType = assembly.GetType(className);
Microsoft.CodeAnalysis.LanguageServer.Protocol (90)
LspServices\AbstractExportLspServiceAttribute.cs (3)
57Type serviceType, string contractName, Type contractType, bool isStateless, WellKnownLspServerKinds serverKind) 82private static string?[] CreateMethodHandlerData(Type handlerType)
LspServices\BaseService.cs (3)
15public abstract Type Type { get; } 29public override Type Type => typeof(T); 40public override Type Type => typeof(T);
LspServices\ExportCSharpVisualBasicLspServiceFactoryAttribute.cs (1)
16public ExportCSharpVisualBasicLspServiceFactoryAttribute(Type type, WellKnownLspServerKinds serverKind = WellKnownLspServerKinds.Any) : base(type, ProtocolConstants.RoslynLspLanguagesContract, serverKind)
LspServices\ExportCSharpVisualBasicStatelessLspServiceAttribute.cs (1)
13public ExportCSharpVisualBasicStatelessLspServiceAttribute(Type type, WellKnownLspServerKinds serverKind = WellKnownLspServerKinds.Any) : base(type, ProtocolConstants.RoslynLspLanguagesContract, serverKind)
LspServices\ExportLspServiceFactoryAttribute.cs (1)
21Type serviceType, string contractName, WellKnownLspServerKinds serverKind = WellKnownLspServerKinds.Any)
LspServices\ExportStatelessLspServiceAttribute.cs (1)
21Type serviceType, string contractName, WellKnownLspServerKinds serverKind = WellKnownLspServerKinds.Any)
LspServices\LspServices.cs (2)
121public bool TryGetService(Type type, [NotNullWhen(true)] out object? service) 177var handlerType = handler.GetType();
Protocol\Converters\DocumentUriConverter.cs (1)
16public override Uri Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Protocol\Converters\FormattingOptionsConverter.cs (1)
19public override FormattingOptions? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Protocol\Converters\InitializeParamsWorkspaceFoldersConverter.cs (1)
29public override WorkspaceFolder[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Protocol\Converters\NaturalObjectConverter.cs (2)
15public override object? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 20var runtimeType = value.GetType();
Protocol\Converters\ParameterInformationConverter.cs (1)
16public override ParameterInformation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Protocol\Converters\StringEnumConverter.cs (3)
38public override TStringEnumType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 59/// This is required to support <see cref="DefaultValueAttribute(Type, string)"/>. 65public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Protocol\Converters\SumConverter.cs (15)
18public override bool CanConvert(Type typeToConvert) 23public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) 25var converterType = typeof(SumConverter<>).MakeGenericType(typeToConvert); 44public SumTypeInfoCache(Type sumTypeType) 56foreach (var parameterType in parameterTypes) 118private static Type NormalizeToNonNullable(Type sumTypeType) 128private static readonly Type[] expressionLambdaMethodTypes = [typeof(Type), typeof(Expression), typeof(ParameterExpression[])]; 139private static readonly Type[] jsonSerializerDeserializeMethodTypes = [typeof(Utf8JsonReader).MakeByRefType(), typeof(JsonSerializerOptions)]; 150public UnionTypeInfo(Type type, ConstructorInfo constructor, KindAttribute? kindAttribute) 169public Type Type { get; } 183private static readonly ConcurrentDictionary<Type, SumConverter.SumTypeInfoCache> SumTypeCache = new ConcurrentDictionary<Type, SumConverter.SumTypeInfoCache>(); 186public override T Read(ref Utf8JsonReader reader, Type objectType, JsonSerializerOptions options)
Protocol\Converters\TextDocumentSyncConverter.cs (1)
14public override TextDocumentSyncOptions Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Protocol\Extensions\Converters\VSExtensionConverter.cs (1)
23public override TBase? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Protocol\Extensions\Converters\VSExtensionUtilities.cs (1)
47var existingConverterType = converters[i].GetType();
Protocol\Internal\Converters\ClassifiedTextElementConverter.cs (1)
16public override ClassifiedTextElement Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Protocol\Internal\Converters\ClassifiedTextRunConverter.cs (1)
15public override ClassifiedTextRun? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Protocol\Internal\Converters\ContainerElementConverter.cs (1)
19public override ContainerElement Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Protocol\Internal\Converters\ImageElementConverter.cs (1)
16public override ImageElement Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Protocol\Internal\Converters\ImageIdConverter.cs (1)
15public override ImageId Read(ref Utf8JsonReader reader, Type objectType, JsonSerializerOptions options)
Protocol\Internal\Converters\ObjectContentConverter.cs (1)
38public override object? Read(ref Utf8JsonReader reader, Type objectType, JsonSerializerOptions options)
Protocol\Internal\Converters\RegexConverter.cs (1)
18public override Regex? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Protocol\Internal\Converters\VSInternalExtensionUtilities.cs (1)
60var existingConverterType = converters[i].GetType();
Protocol\Internal\Efficiency\OptimizedVSCompletionListJsonConverter.cs (1)
19public override OptimizedVSCompletionList Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => throw new NotImplementedException();
Protocol\SumType.cs (1)
880public static void ValidateTypeParameter(Type type)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\AbstractTypeRefResolver.cs (4)
15private readonly ConcurrentDictionary<TypeRef, Type?> _typeRefToTypeMap = []; 17public Type? Resolve(TypeRef typeRef) 19if (_typeRefToTypeMap.TryGetValue(typeRef, out var result)) 28protected abstract Type? ResolveCore(TypeRef typeRef);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\HandlerProvider.cs (2)
80var handlerType = handler.GetType(); 107var handlerType = typeRefResolver.Resolve(handlerTypeRef)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\ILspServices.cs (1)
19bool TryGetService(Type type, [NotNullWhen(true)] out object? service);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\MethodHandlerDetails.cs (21)
31public static ImmutableArray<MethodHandlerDetails> From(Type handlerType) 57private static ImmutableArray<(Type? RequestType, Type? ResponseType, Type RequestContextType)> GetAllHandlerDetails(Type handlerType) 59var builder = ImmutableArray.CreateBuilder<(Type? RequestType, Type? ResponseType, Type RequestContextType)>(); 61foreach (var interfaceType in handlerType.GetInterfaces()) 68var genericDefinition = interfaceType.GetGenericTypeDefinition(); 100private static (string name, IEnumerable<string> languages) GetRequestHandlerMethod(Type handlerType, Type? requestType, Type contextType, Type? responseType) 116static LanguageServerEndpointAttribute? GetMethodAttributeFromHandlerMethod(Type handlerType, Type? requestType, Type contextType, Type? responseType) 162static bool TypesMatch(MethodInfo methodInfo, Type?[] types) 178static LanguageServerEndpointAttribute? GetMethodAttributeFromClassOrInterface(Type type) 185foreach (var @interface in interfaces)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (3)
99var noValueType = NoValue.Instance.GetType(); 110var requestType = metadata.RequestTypeRef is TypeRef requestTypeRef 113var responseType = metadata.ResponseTypeRef is TypeRef responseTypeRef
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\TypeRef.cs (7)
14/// Helper that avoids loading a <see cref="Type"/> by its full assembly-qualified name until needed. 98/// Constructs a <see cref="TypeRef"/> from a <see cref="Type"/>. 100/// <param name="type">The <see cref="Type"/> to use.</param> 101public static TypeRef From(Type type) 119/// Constructs a <see cref="TypeRef"/> from a <see cref="Type"/> or returns <see langword="null"/> 121/// <param name="type">The <see cref="Type"/> to use, or <see langword="null"/>.</param> 122public static TypeRef? FromOrNull(Type? type)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\TypeRef.DefaultResolver.cs (3)
22protected override Type? ResolveCore(TypeRef typeRef) 25private static Type LoadType(string typeName) 26=> Type.GetType(typeName)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (4)
Configuration\DidChangeConfigurationNotificationHandlerTest.cs (3)
263var type = option.Type; 294var enumType = Nullable.GetUnderlyingType(type)!; 306object GetDifferentEnumValue(Type enumType, object enumValue)
Diagnostics\BuildOnlyDiagnosticIdsHandlerTests.cs (1)
71var compilerBuildOnlyDiagnosticsType = languageName switch
Microsoft.CodeAnalysis.Rebuild.UnitTests (4)
BasicDeterministicKeyBuilderTests.cs (1)
65var type = typeof(T);
CSharpDeterministicKeyBuilderTests.cs (1)
64var type = typeof(T);
RoundTripUtil.cs (2)
218var type = originalOptions.GetType(); 258var type = originalOptions.GetType();
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Services\BrokeredServiceBase.FactoryBase.cs (2)
29Type ServiceType { get; } 87Type IFactory.ServiceType => typeof(TService);
Microsoft.CodeAnalysis.Remote.Workspaces (28)
BrokeredServiceDescriptors.cs (1)
28public ClientServiceDescriptor(ServiceMoniker serviceMoniker, Type? clientInterface = null)
ExternalAccess\Pythia\Api\PythiaRemoteServiceCallbackDispatcherRegistry.cs (4)
14public static readonly PythiaRemoteServiceCallbackDispatcherRegistry Empty = new(Array.Empty<(Type, PythiaRemoteServiceCallbackDispatcher)>()); 16private readonly ImmutableDictionary<Type, PythiaRemoteServiceCallbackDispatcher> _lazyDispatchers; 18public PythiaRemoteServiceCallbackDispatcherRegistry(IEnumerable<(Type serviceType, PythiaRemoteServiceCallbackDispatcher dispatcher)> lazyDispatchers) 23IRemoteServiceCallbackDispatcher IRemoteServiceCallbackDispatcherProvider.GetDispatcher(Type serviceType)
ExternalAccess\Pythia\Api\PythiaServiceDescriptorsWrapper.cs (3)
24IEnumerable<(Type serviceInterface, Type? callbackInterface)> interfaces) 30public ServiceJsonRpcDescriptor GetDescriptorForServiceFactory(Type serviceInterface)
ExternalAccess\UnitTesting\Api\UnitTestingRemoteServiceCallbackDispatcherRegistry.cs (4)
14public static readonly UnitTestingRemoteServiceCallbackDispatcherRegistry Empty = new(Array.Empty<(Type, UnitTestingRemoteServiceCallbackDispatcher)>()); 16private readonly ImmutableDictionary<Type, UnitTestingRemoteServiceCallbackDispatcher> _lazyDispatchers; 18public UnitTestingRemoteServiceCallbackDispatcherRegistry(IEnumerable<(Type serviceType, UnitTestingRemoteServiceCallbackDispatcher dispatcher)> lazyDispatchers) 23IRemoteServiceCallbackDispatcher IRemoteServiceCallbackDispatcherProvider.GetDispatcher(Type serviceType)
ExternalAccess\UnitTesting\Api\UnitTestingServiceDescriptorsWrapper.cs (3)
24IEnumerable<(Type serviceInterface, Type? callbackInterface)> interfaces) 30public ServiceJsonRpcDescriptor GetDescriptorForServiceFactory(Type serviceInterface)
ServiceDescriptor.cs (2)
45Type? clientInterface) 63public static ServiceDescriptor CreateRemoteServiceDescriptor(string componentName, string simpleName, string suffix, RemoteSerializationOptions options, Func<string, string> featureDisplayNameProvider, Type? clientInterface)
ServiceDescriptors.cs (11)
56public static readonly ServiceDescriptors Instance = new(ComponentName, GetFeatureDisplayName, RemoteSerializationOptions.Default, new (Type, Type?)[] 93private readonly ImmutableDictionary<Type, (ServiceDescriptor descriptorCoreClr64, ServiceDescriptor descriptorCoreClr64ServerGC)> _descriptors; 101IEnumerable<(Type serviceInterface, Type? callbackInterface)> interfaces) 109internal static string GetSimpleName(Type serviceInterface) 119private (ServiceDescriptor descriptorCoreClr64, ServiceDescriptor descriptorCoreClr64ServerGC) CreateDescriptors(Type serviceInterface, Type? callbackInterface) 134public ServiceDescriptor GetServiceDescriptorForServiceFactory(Type serviceType) 137public ServiceDescriptor GetServiceDescriptor(Type serviceType, RemoteProcessConfiguration configuration) 169public ImmutableDictionary<Type, (ServiceDescriptor descriptorCoreClr64, ServiceDescriptor descriptorCoreClr64ServerGC)> Descriptors
Microsoft.CodeAnalysis.Scripting (31)
Hosting\CommonMemberFilter.cs (3)
33var type = method.DeclaringType; 79private static bool IsTaskAwaiter(Type type) 88var genericDef = type.GetTypeInfo().GetGenericTypeDefinition();
Hosting\ObjectFormatter\CommonObjectFormatter.cs (1)
117var declaringType = method.DeclaringType;
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (1)
95Type type = obj.GetType();
Hosting\ObjectFormatter\CommonPrimitiveFormatter.cs (1)
55var type = obj.GetType();
Hosting\ObjectFormatter\CommonTypeNameFormatter.cs (9)
33public virtual string FormatTypeName(Type type, CommonTypeNameFormatterOptions options) 92public virtual string FormatTypeArguments(Type[] typeArguments, CommonTypeNameFormatterOptions options) 110foreach (var typeArgument in typeArguments) 132public virtual string FormatArrayTypeName(Type arrayType, Array arrayOpt, CommonTypeNameFormatterOptions options) 142Type elementType = arrayType.GetElementType(); 151Type type = arrayType; 221private void AppendArrayRank(StringBuilder sb, Type arrayType) 239Type[] genericArguments = typeInfo.IsGenericTypeDefinition ? typeInfo.GenericTypeParameters : typeInfo.GenericTypeArguments; 284Type[] genericArguments,
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (5)
36if (type.GetDeclaredMethod("ToString", Type.EmptyTypes) != null) 114var proxyType = Type.GetType(debuggerTypeProxy.ProxyTypeName, throwOnError: false, ignoreCase: false); 161var method = currentType.GetDeclaredMethod(memberName, Type.EmptyTypes); 276internal static SpecialType GetPrimitiveSpecialType(Type type)
Hosting\ReplServiceProvider.cs (1)
21public abstract Script<T> CreateScript<T>(string code, ScriptOptions options, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoader);
Script.cs (8)
40internal Script(ScriptCompiler compiler, ScriptBuilder builder, SourceText sourceText, ScriptOptions options, Type globalsTypeOpt, Script previousOpt) 55internal static Script<T> CreateInitialScript<T>(ScriptCompiler compiler, SourceText sourceText, ScriptOptions optionsOpt, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoaderOpt) 85public Type GlobalsType { get; } 90public abstract Type ReturnType { get; } 345internal Script(ScriptCompiler compiler, ScriptBuilder builder, SourceText sourceText, ScriptOptions options, Type globalsTypeOpt, Script previousOpt) 350public override Type ReturnType => typeof(T); 511var globalsType = GlobalsType; 587private static void ValidateGlobals(object globals, Type globalsType)
ScriptVariable.cs (1)
39public Type Type => _field.FieldType;
src\Compilers\Shared\GlobalAssemblyCacheHelpers\GlobalAssemblyCache.cs (1)
22if (Type.GetType("Mono.Runtime") != null)
Microsoft.CodeAnalysis.Test.Utilities (39)
Assert\AssertEx.cs (1)
45var type = typeof(T);
Assert\ConditionalFactAttribute.cs (7)
83public ConditionalFactAttribute(params Type[] skipConditions) 85foreach (var skipCondition in skipConditions) 123public ConditionalTheoryAttribute(params Type[] skipConditions) 125foreach (var skipCondition in skipConditions) 161public static bool IsMonoDesktop => Type.GetType("Mono.Runtime") != null; 163public static bool IsMonoCore => Type.GetType("Mono.RuntimeStructs") != null; 169public static bool RuntimeSupportsCovariantReturnsOfClasses => Type.GetType("System.Runtime.CompilerServices.RuntimeFeature")?.GetField("CovariantReturnsOfClasses") != null;
Assert\EqualityUtil`1.cs (2)
133var type = typeof(T); 134var targetType = typeof(IEquatable<T>);
Compilation\RuntimeUtilities.cs (1)
75internal static string GetAssemblyLocation(Type type)
Diagnostics\DiagnosticDescription.cs (3)
37private readonly Type _errorCodeType; 80Type errorCodeType = null, 105Type errorCodeType = null,
Mocks\TestMessageProvider.cs (1)
16public override Type ErrorCodeType
Platform\Custom\MetadataSignatureHelper.cs (12)
41private static void AppendType(Type type, StringBuilder sb, bool showGenericConstraints = false) 57foreach (var genericConstraint in genericConstraints) 124foreach (var modreq in parameter.GetRequiredCustomModifiers()) 130foreach (var modopt in parameter.GetOptionalCustomModifiers()) 437foreach (var typeParameter in method.GetGenericArguments()) 476foreach (var typeParameter in constructor.GetGenericArguments()) 530foreach (var modreq in property.GetRequiredCustomModifiers()) 536foreach (var modopt in property.GetOptionalCustomModifiers()) 594foreach (var modreq in field.GetRequiredCustomModifiers()) 600foreach (var modopt in field.GetOptionalCustomModifiers()) 669var type = assembly.GetType(fullyQualifiedTypeName); 716var type = assembly.GetType(fullyQualifiedTypeName);
ReflectionAssert.cs (1)
15public static void AssertPublicAndInternalFieldsAndProperties(Type targetType, params string[] expectedFieldsAndProperties)
Syntax\NodeHelpers.cs (4)
149var typeObject = node.GetType(); 160var typeObject = token.GetType(); 171var typeObject = trivia.GetType(); 183var typeObject = prop.PropertyType;
Syntax\NodeInfo.FieldInfo.cs (3)
18private readonly Type _fieldType; 28public Type FieldType 44public FieldInfo(string propertyName, Type fieldType, object value)
TargetFrameworkUtil.cs (1)
421var type = assembly.GetType(assemblyName, throwOnError: true);
TestHelpers.cs (3)
34public static IEnumerable<Type> GetAllTypesWithStaticFieldsImplementingType(Assembly assembly, Type type) 47var valueType = value.GetType();
Microsoft.CodeAnalysis.UnitTests (40)
AnalyzerAssemblyLoaderTests.cs (1)
220var type = typeof(AnalyzerAssemblyLoaderTests).Assembly.GetType(typeName, throwOnError: false)!;
Collections\DebuggerAttributes.cs (19)
55internal static DebuggerAttributeInfo ValidateDebuggerTypeProxyProperties(Type type, object obj) 60internal static DebuggerAttributeInfo ValidateDebuggerTypeProxyProperties(Type type, Type[] genericTypeArguments, object obj) 62Type proxyType = GetProxyType(type, genericTypeArguments); 79public static IEnumerable<FieldInfo> GetDebuggerVisibleFields(Type debuggerAttributeType) 87public static IEnumerable<PropertyInfo> GetDebuggerVisibleProperties(Type debuggerAttributeType) 97public static Type GetProxyType(object obj) => GetProxyType(obj.GetType()); 99public static Type GetProxyType(Type type) => GetProxyType(type, type.GenericTypeArguments); 101private static Type GetProxyType(Type type, Type[] genericTypeArguments) 114Type? proxyType = cad.ConstructorArguments[0].ArgumentType == typeof(Type) ? 115(Type?)cad.ConstructorArguments[0].Value : 116Type.GetType((string)cad.ConstructorArguments[0].Value!); 131var objType = obj.GetType(); 237for (Type? t = obj.GetType(); t != null; t = t.GetTypeInfo().BaseType) 250for (Type? t = obj.GetType(); t != null; t = t.GetTypeInfo().BaseType)
Collections\ImmutableSegmentedDictionaryBuilderTest.cs (1)
261Type proxyType = DebuggerAttributes.GetProxyType(ImmutableSegmentedDictionary.Create<string, int>());
Collections\ImmutableSegmentedDictionaryTest.cs (1)
261Type proxyType = DebuggerAttributes.GetProxyType(ImmutableSegmentedDictionary.Create<string, int>());
Collections\ImmutableSegmentedHashSetTest.cs (1)
197Type proxyType = DebuggerAttributes.GetProxyType(ImmutableSegmentedHashSet.Create<string>());
Collections\ImmutableSegmentedListBuilderTest.cs (1)
371Type proxyType = DebuggerAttributes.GetProxyType(ImmutableSegmentedList.CreateBuilder<string>());
Collections\ImmutableSegmentedListTest.cs (1)
786Type proxyType = DebuggerAttributes.GetProxyType(ImmutableSegmentedList.Create<double>());
Collections\List\ICollection.Generic.Tests.cs (1)
68protected virtual Type ICollection_Generic_CopyTo_IndexLargerThanArrayCount_ThrowType => typeof(ArgumentException);
Collections\List\ICollection.NonGeneric.Tests.cs (6)
58protected virtual Type ICollection_NonGeneric_CopyTo_ArrayOfEnumType_ThrowType => typeof(InvalidCastException); 65protected virtual Type ICollection_NonGeneric_CopyTo_ArrayOfIncorrectReferenceType_ThrowType => typeof(ArgumentException); 72protected virtual Type ICollection_NonGeneric_CopyTo_ArrayOfIncorrectValueType_ThrowType => typeof(ArgumentException); 80protected virtual Type ICollection_NonGeneric_CopyTo_NonZeroLowerBound_ThrowType => typeof(ArgumentException); 98protected virtual Type ICollection_NonGeneric_CopyTo_IndexLargerThanArrayCount_ThrowType => typeof(ArgumentException); 104protected virtual Type ICollection_NonGeneric_CopyTo_TwoDimensionArray_ThrowType => typeof(ArgumentException);
Collections\List\IList.Generic.Tests.cs (1)
104protected virtual Type IList_Generic_Item_InvalidIndex_ThrowType => typeof(ArgumentOutOfRangeException);
Collections\List\IList.NonGeneric.Tests.cs (1)
80protected virtual Type IList_NonGeneric_Item_InvalidIndex_ThrowType => typeof(ArgumentOutOfRangeException);
Collections\SegmentedArrayHelperTests.cs (5)
73public void ExplicitSizesAreCorrect(Type type) 80public void GetSegmentSize(Type type) 88public void GetSegmentShift(Type type) 97public void GetOffsetMask(Type type) 104private static int InvokeUnsafeSizeOf(Type type)
PEWriter\InstructionOperandTypesTests.cs (1)
24var typeOfOpCode = typeof(OpCode);
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
ExpressionTrees\Sources\QueryHelper.vb (1)
23Public ReadOnly Property ElementType As System.Type Implements System.Linq.IQueryable.ElementType
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Semantics\Conversions.vb (1)
1369Select Case System.Type.GetTypeCode(value.GetType())
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (1)
Syntax\SyntaxFactoryTests.vb (1)
103Dim factoryType As System.Type = GetType(SyntaxFactory)
Microsoft.CodeAnalysis.Workspaces (98)
Classification\SyntaxClassification\AbstractSyntaxClassifier.cs (1)
30public virtual ImmutableArray<Type> SyntaxNodeTypes
Classification\SyntaxClassification\ISyntaxClassifier.cs (1)
19ImmutableArray<Type> SyntaxNodeTypes { get; }
CodeActions\CodeAction.cs (6)
34private static readonly Dictionary<Type, bool> s_isNonProgressGetChangedSolutionAsyncOverridden = []; 35private static readonly Dictionary<Type, bool> s_isNonProgressComputeOperationsAsyncOverridden = []; 106private bool IsNonProgressApiOverridden(Dictionary<Type, bool> dictionary, Func<CodeAction, bool> computeResult) 108var type = this.GetType(); 189private Type? _providerTypeForTelemetry; 216var type = isFactoryGenerated && _providerTypeForTelemetry != null
Diagnostics\Extensions.cs (6)
72var type = analyzer.GetType(); 77/// Cache of a <see cref="Type"/> to its <see cref="Type.AssemblyQualifiedName"/>. We cache this as the latter 80private static ImmutableSegmentedDictionary<Type, string> s_typeToAssemblyQualifiedName = ImmutableSegmentedDictionary<Type, string>.Empty; 82private static string GetAssemblyQualifiedName(Type type)
ExtensionManager\IExtensionManagerExtensions.cs (3)
91this IExtensionManager extensionManager, IEnumerable<TExtension> extensions, Func<TExtension, ImmutableArray<Type>> nodeTypeGetter) 93var map = new Dictionary<Type, ImmutableArray<TExtension>>(); 102foreach (var type in types)
Options\IOption.cs (1)
14Type Type { get; }
Options\Option.cs (1)
27public Type Type => _optionDefinition.Type;
Options\PerLanguageOption.cs (1)
23public Type Type => _optionDefinition.Type;
Remote\ExportRemoteServiceCallbackDispatcherAttribute.cs (2)
15public Type ServiceInterface { get; } 17public ExportRemoteServiceCallbackDispatcherAttribute(Type serviceInterface)
Remote\IRemoteServiceCallbackDispatcherProvider.cs (1)
11IRemoteServiceCallbackDispatcher GetDispatcher(Type serviceType);
Remote\RemoteServiceCallbackDispatchers.cs (5)
16public Type ServiceInterface { get; } 18public ExportMetadata(Type serviceInterface) 25ServiceInterface = (Type)serviceInterface; 29private readonly ImmutableDictionary<Type, Lazy<IRemoteServiceCallbackDispatcher, ExportMetadata>> _callbackDispatchers = dispatchers.ToImmutableDictionary(d => d.Metadata.ServiceInterface); 31public IRemoteServiceCallbackDispatcher GetDispatcher(Type serviceType)
Shared\Extensions\TelemetryExtensions.cs (3)
15public static Guid GetTelemetryId(this Type type, short scope = 0, string? additionalSuffixString = null) 38public static Type GetTypeForTelemetry(this Type type)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
78var targetType = assembly.GetType(typeof(FatalError).FullName!, throwOnError: true)!;
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
30return !(Type.GetType("Mono.Runtime") is null); 50return !(Type.GetType("Mono.RuntimeStructs", throwOnError: false) is null);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (13)
16private static readonly Type Missing = typeof(void); 18public static Type? TryGetType(string assemblyQualifiedName) 23return Type.GetType(assemblyQualifiedName, throwOnError: false); 31public static Type? TryGetType([NotNull] ref Type? lazyType, string assemblyQualifiedName) 42/// Find a <see cref="Type"/> instance by first probing the contract name and then the name as it 45public static Type? GetTypeFromEither(string contractName, string desktopName) 47var type = TryGetType(contractName); 57public static Type? GetTypeFromEither([NotNull] ref Type? lazyType, string contractName, string desktopName) 67public static T? FindItem<T>(IEnumerable<T> collection, params Type[] paramTypes) 97internal static MethodInfo? GetDeclaredMethod(this TypeInfo typeInfo, string name, params Type[] paramTypes) 102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes)
src\Dependencies\Collections\Internal\ThrowHelper.cs (4)
115internal static void ThrowWrongKeyTypeArgumentException<T>(T key, Type targetType) 122internal static void ThrowWrongValueTypeArgumentException<T>(T value, Type targetType) 217private static ArgumentException GetWrongKeyTypeArgumentException(object? key, Type targetType) 222private static ArgumentException GetWrongValueTypeArgumentException(object? value, Type targetType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\ChainedFormattingRules.cs (4)
20private static readonly ConcurrentDictionary<(Type type, string name), Type?> s_typeImplementingMethod = []; 87var type = GetTypeImplementingMethod(rule, name); 102private static Type? GetTypeImplementingMethod(object obj, string name)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (1)
86Type IOption.Type => Definition.Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (3)
66public abstract Type Type { get; } 90public static bool IsSupportedOptionType(Type type) 122public override Type Type
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (1)
74Type IOption.Type => Definition.Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
169var type = value.GetType();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (6)
139var wantedType = typeof(TSyntaxNode); 141var expressionType = typeof(TExpressionSyntax); 142var argumentType = typeof(TArgumentSyntax); 143var expressionStatementType = typeof(TExpressionStatementSyntax); 149static bool IsAEqualOrSubclassOfB(Type a, Type b)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\LayeredServiceUtilities.cs (2)
20public static string GetAssemblyQualifiedServiceTypeName(Type type, string argName) 24Type serviceType,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (3)
26private ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 27= ImmutableDictionary<Type, (Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, bool usesFactory)>.Empty; 129private bool TryGetService(Type serviceType, [NotNullWhen(true)] out Lazy<ILanguageService, LanguageServiceMetadata>? lazyService, out bool usesFactory)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (3)
28private ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)> _serviceMap 29= ImmutableDictionary<Type, (Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, bool usesFactory)>.Empty; 138private bool TryGetService(Type serviceType, [NotNullWhen(true)] out Lazy<IWorkspaceService, WorkspaceServiceMetadata>? lazyService, out bool usesFactory)
Storage\StorageDatabaseLogger.cs (1)
23private readonly ConcurrentDictionary<Type, Exception> _set = new(concurrencyLevel: 2, capacity: 10);
Telemetry\TelemetryFeatureName.cs (1)
40public static TelemetryFeatureName GetExtensionName(Type type)
Workspace\Host\CompilationFactory\ICompilationFactoryService.cs (1)
15Compilation CreateSubmissionCompilation(string assemblyName, CompilationOptions options, Type? hostObjectType);
Workspace\Host\Mef\ExportLanguageServiceAttribute.cs (2)
22public class ExportLanguageServiceAttribute(Type type, string language, string layer = ServiceLayer.Default) : ExportAttribute(typeof(ILanguageService)) 46internal ExportLanguageServiceAttribute(Type type, string language, string[] workspaceKinds)
Workspace\Host\Mef\ExportLanguageServiceFactoryAttribute.cs (2)
22public class ExportLanguageServiceFactoryAttribute(Type type, string language, string layer = ServiceLayer.Default) : ExportAttribute(typeof(ILanguageServiceFactory)) 46internal ExportLanguageServiceFactoryAttribute(Type type, string language, string[] workspaceKinds)
Workspace\Host\Mef\ExportWorkspaceServiceAttribute.cs (2)
21public class ExportWorkspaceServiceAttribute(Type serviceType, string layer = ServiceLayer.Default) : ExportAttribute(typeof(IWorkspaceService)) 40internal ExportWorkspaceServiceAttribute(Type serviceType, string[] workspaceKinds)
Workspace\Host\Mef\ExportWorkspaceServiceFactoryAttribute.cs (2)
21public class ExportWorkspaceServiceFactoryAttribute(Type serviceType, string layer = ServiceLayer.Default) : ExportAttribute(typeof(IWorkspaceServiceFactory)) 40internal ExportWorkspaceServiceFactoryAttribute(Type serviceType, string[] workspaceKinds)
Workspace\Solution\FileTextLoader.cs (1)
21private static readonly ConditionalWeakTable<Type, StrongBox<bool>> s_isObsoleteCreateTextOverriden = new();
Workspace\Solution\ProjectInfo.cs (7)
154public Type? HostObjectType { get; } 166Type? hostObjectType) 200Type? hostObjectType) 228Type? hostObjectType = null, 269Type? hostObjectType = null) 294Optional<Type?> hostObjectType = default) 305var newHostObjectType = hostObjectType.HasValue ? hostObjectType.Value : HostObjectType;
Workspace\Solution\ProjectState.cs (1)
668public Type? HostObjectType => this.ProjectInfo.HostObjectType;
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
410var driverType = generatorDriver.GetType();
Workspace\Solution\SourceGeneratorIdentity.cs (1)
32var generatorType = generator.GetGeneratorType();
Workspace\Solution\TextLoader.cs (1)
21private static readonly ConditionalWeakTable<Type, StrongBox<bool>> s_isObsoleteLoadTextAndVersionAsyncOverriden = new();
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
Rpc\RpcClient.cs (2)
31private readonly ConcurrentDictionary<int, (TaskCompletionSource<object?>, System.Type? expectedReturnType)> _outstandingRequests = []; 135private async Task<object?> InvokeCoreAsync(int targetObject, string methodName, List<object?> parameters, Type? expectedReturnType, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (23)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (1)
78var targetType = assembly.GetType(typeof(FatalError).FullName!, throwOnError: true)!;
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
30return !(Type.GetType("Mono.Runtime") is null); 50return !(Type.GetType("Mono.RuntimeStructs", throwOnError: false) is null);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (13)
16private static readonly Type Missing = typeof(void); 18public static Type? TryGetType(string assemblyQualifiedName) 23return Type.GetType(assemblyQualifiedName, throwOnError: false); 31public static Type? TryGetType([NotNull] ref Type? lazyType, string assemblyQualifiedName) 42/// Find a <see cref="Type"/> instance by first probing the contract name and then the name as it 45public static Type? GetTypeFromEither(string contractName, string desktopName) 47var type = TryGetType(contractName); 57public static Type? GetTypeFromEither([NotNull] ref Type? lazyType, string contractName, string desktopName) 67public static T? FindItem<T>(IEnumerable<T> collection, params Type[] paramTypes) 97internal static MethodInfo? GetDeclaredMethod(this TypeInfo typeInfo, string name, params Type[] paramTypes) 102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes)
src\Compilers\Core\Portable\InternalUtilities\UICultureUtilities.cs (3)
25var type = Type.GetType(cultureInfoTypeNameGlobalization) ?? typeof(object).GetTypeInfo().Assembly.GetType(cultureInfoTypeName); 63var type = typeof(object).GetTypeInfo().Assembly.GetType(threadTypeName);
src\Dependencies\Collections\Internal\ThrowHelper.cs (4)
115internal static void ThrowWrongKeyTypeArgumentException<T>(T key, Type targetType) 122internal static void ThrowWrongValueTypeArgumentException<T>(T value, Type targetType) 217private static ArgumentException GetWrongKeyTypeArgumentException(object? key, Type targetType) 222private static ArgumentException GetWrongValueTypeArgumentException(object? value, Type targetType)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (48)
MEF\ExportProviderCache.cs (3)
70public static ComposableCatalog CreateTypeCatalog(IEnumerable<Type> types, Resolver? resolver = null) 90public static ComposableCatalog WithParts(this ComposableCatalog catalog, IEnumerable<Type> types) 97public static ComposableCatalog WithoutPartsOfTypes(this ComposableCatalog catalog, IEnumerable<Type> types)
MEF\TestComposition.cs (22)
31private readonly ImmutableArray<Type> _parts; 32private readonly ImmutableArray<Type> _excludedPartTypes; 34public CacheKey(ImmutableHashSet<Assembly> assemblies, ImmutableHashSet<Type> parts, ImmutableHashSet<Type> excludedPartTypes) 68public readonly ImmutableHashSet<Type> ExcludedPartTypes; 73public readonly ImmutableHashSet<Type> Parts; 77private TestComposition(ImmutableHashSet<Assembly> assemblies, ImmutableHashSet<Type> parts, ImmutableHashSet<Type> excludedPartTypes) 150public TestComposition AddParts(IEnumerable<Type>? types) 153public TestComposition AddParts(params Type[]? types) 154=> AddParts((IEnumerable<Type>?)types); 156public TestComposition AddExcludedPartTypes(IEnumerable<Type>? types) 159public TestComposition AddExcludedPartTypes(params Type[]? types) 160=> AddExcludedPartTypes((IEnumerable<Type>?)types); 171public TestComposition RemoveParts(IEnumerable<Type>? types) 174public TestComposition RemoveParts(params Type[]? types) 175=> RemoveParts((IEnumerable<Type>?)types); 177public TestComposition RemoveExcludedPartTypes(IEnumerable<Type>? types) 180public TestComposition RemoveExcludedPartTypes(params Type[]? types) 181=> RemoveExcludedPartTypes((IEnumerable<Type>?)types); 205public TestComposition WithParts(ImmutableHashSet<Type> parts) 208public TestComposition WithExcludedPartTypes(ImmutableHashSet<Type> excludedPartTypes)
ObjectExtensions.cs (2)
21var type = instance.GetType(); 34var type = instance.GetType();
Options\OptionsTestHelpers.cs (2)
116public static object? GetDifferentValue(Type type, object? value) 144private static object GetDifferentEnumValue(Type type, object defaultValue)
Options\OptionsTestInfo.cs (2)
33Type[] types; 43foreach (var type in types)
Options\TestOption.cs (1)
15public Type Type { get; set; } = typeof(int);
Remote\InProcRemostHostClient.cs (1)
90public object GetService(Type serviceType)
Remote\InProcRemoteHostClientProvider.cs (6)
43Type[]? additionalRemoteParts, 44Type[]? excludedRemoteParts) 52Type[]? additionalRemoteParts, 53Type[]? excludedRemoteParts) 68public Type[]? AdditionalRemoteParts { get; set; } 69public Type[]? ExcludedRemoteParts { get; set; }
TestExportJoinableTaskContext.cs (1)
121var type = assembly.GetType("Microsoft.VisualStudio.Language.Intellisense.Implementation.ForegroundThreadAffinitizedObject", throwOnError: false);
Workspaces\TestHostProject.cs (1)
67Type hostObjectType = null,
Workspaces\TestHostProject`1.cs (2)
75public Type HostObjectType { get; } 99Type hostObjectType = null,
Workspaces\TestWorkspace.cs (1)
71Type? hostObjectType = null,
Workspaces\TestWorkspace_XmlConsumption.cs (2)
462var type = Type.GetType((string)strongNameProviderAttribute);
Workspaces\TestWorkspace`1.cs (1)
211Type? hostObjectType = null,
WorkspaceTestUtilities.cs (1)
14public static Workspace CreateWorkspaceWithPartialSemantics(Type[]? additionalParts = null, TestHost testHost = TestHost.InProcess)
Microsoft.CodeAnalysis.Workspaces.UnitTests (25)
BatchFixAllProviderTests.cs (1)
145public override Type SyntaxKindType => typeof(SyntaxKind);
CodeStyle\NamingStylePreferencesUpgradeTests.cs (1)
192public void NoDuplicateEntriesInKindEnumerations(Type type, params string[] expectedDuplicates)
FindReferencesTests.cs (1)
24private static Workspace CreateWorkspace(Type[] additionalParts = null)
Host\LanguageServices\TestCSharpCompilationFactoryServiceWithIncrementalGeneratorTracking.cs (1)
35Compilation ICompilationFactoryService.CreateSubmissionCompilation(string assemblyName, CompilationOptions options, Type? hostObjectType)
Options\OptionSerializerTests.cs (3)
99var enumType = Nullable.GetUnderlyingType(type); 161private static void VerifyEnumValues(IOption2 option, Type enumType, bool allowsSnakeCase, bool allowsPacalCase) 201private static void VerifyEnumInvalidParse(IOption2 option, Type enumType)
Remote\ServiceDescriptorTests.cs (8)
55private static Dictionary<Type, MemberInfo> GetAllParameterTypesOfRemoteApis() 57var interfaces = new List<Type>(); 68var types = new Dictionary<Type, MemberInfo>(); 70void AddTypeRecursive(Type type, MemberInfo declaringMember) 93foreach (var genericArgument in type.GetGenericArguments()) 117foreach (var interfaceType in interfaces) 131foreach (var type in method.GetParameters().Select(p => p.ParameterType)) 347Type serviceInterface,
SolutionTests\SolutionTestHelpers.cs (1)
16public static Workspace CreateWorkspace(Type[]? additionalParts = null, TestHost testHost = TestHost.InProcess)
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
68var generatorType = typeof(GenerateFileForEachAdditionalFileWithContentsCommented);
TestCompositionTests.cs (8)
41var type1 = typeof(int); 42var type2 = typeof(bool); 60var type1 = typeof(int); 61var type2 = typeof(bool); 83var type1 = typeof(int); 84var type2 = typeof(long); 85var excluded1 = typeof(bool); 86var excluded2 = typeof(byte);
Microsoft.CodeAnalysis.XunitHook (1)
XunitDisposeHook.cs (1)
24var appDomainManagerType = xunitUtility.GetType("Xunit.AppDomainManager_AppDomain");
Microsoft.CommonLanguageServerProtocol.Framework.Example (1)
ExampleLspServices.cs (1)
38public bool TryGetService(Type type, [NotNullWhen(true)] out object? service)
Microsoft.CommonLanguageServerProtocol.Framework.Package (41)
AbstractTypeRefResolver.cs (4)
15private readonly ConcurrentDictionary<TypeRef, Type?> _typeRefToTypeMap = []; 17public Type? Resolve(TypeRef typeRef) 19if (_typeRefToTypeMap.TryGetValue(typeRef, out var result)) 28protected abstract Type? ResolveCore(TypeRef typeRef);
HandlerProvider.cs (2)
80var handlerType = handler.GetType(); 107var handlerType = typeRefResolver.Resolve(handlerTypeRef)
ILspServices.cs (1)
19bool TryGetService(Type type, [NotNullWhen(true)] out object? service);
MethodHandlerDetails.cs (21)
31public static ImmutableArray<MethodHandlerDetails> From(Type handlerType) 57private static ImmutableArray<(Type? RequestType, Type? ResponseType, Type RequestContextType)> GetAllHandlerDetails(Type handlerType) 59var builder = ImmutableArray.CreateBuilder<(Type? RequestType, Type? ResponseType, Type RequestContextType)>(); 61foreach (var interfaceType in handlerType.GetInterfaces()) 68var genericDefinition = interfaceType.GetGenericTypeDefinition(); 100private static (string name, IEnumerable<string> languages) GetRequestHandlerMethod(Type handlerType, Type? requestType, Type contextType, Type? responseType) 116static LanguageServerEndpointAttribute? GetMethodAttributeFromHandlerMethod(Type handlerType, Type? requestType, Type contextType, Type? responseType) 162static bool TypesMatch(MethodInfo methodInfo, Type?[] types) 178static LanguageServerEndpointAttribute? GetMethodAttributeFromClassOrInterface(Type type) 185foreach (var @interface in interfaces)
RequestExecutionQueue.cs (3)
99var noValueType = NoValue.Instance.GetType(); 110var requestType = metadata.RequestTypeRef is TypeRef requestTypeRef 113var responseType = metadata.ResponseTypeRef is TypeRef responseTypeRef
TypeRef.cs (7)
14/// Helper that avoids loading a <see cref="Type"/> by its full assembly-qualified name until needed. 98/// Constructs a <see cref="TypeRef"/> from a <see cref="Type"/>. 100/// <param name="type">The <see cref="Type"/> to use.</param> 101public static TypeRef From(Type type) 119/// Constructs a <see cref="TypeRef"/> from a <see cref="Type"/> or returns <see langword="null"/> 121/// <param name="type">The <see cref="Type"/> to use, or <see langword="null"/>.</param> 122public static TypeRef? FromOrNull(Type? type)
TypeRef.DefaultResolver.cs (3)
22protected override Type? ResolveCore(TypeRef typeRef) 25private static Type LoadType(string typeName) 26=> Type.GetType(typeName)
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (8)
HandlerProviderTests.cs (1)
100var services = new List<(Type, object)>
Mocks\TestLspServices.cs (7)
13internal abstract class TestLspServices(IEnumerable<(Type type, object instance)> services) : ILspServices 15protected readonly IEnumerable<(Type type, object instance)> Services = services; 17public static ILspServices Create(IEnumerable<(Type type, object instance)> services, bool supportsMethodHandlerProvider) 37public virtual bool TryGetService(Type type, [NotNullWhen(true)] out object? service) 43private sealed class Default(IEnumerable<(Type type, object instance)> services) : TestLspServices(services) 47private sealed class WithMethodHandlerProvider(IEnumerable<(Type type, object instance)> services) 57public override bool TryGetService(Type type, [NotNullWhen(true)] out object? service)
Microsoft.CSharp (245)
Microsoft\CSharp\RuntimeBinder\ArgumentObject.cs (2)
18internal readonly Type Type; 20public ArgumentObject(object value, CSharpArgumentInfo info, Type type)
Microsoft\CSharp\RuntimeBinder\Binder.cs (24)
27/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param> 34Type? context, 56/// <param name="context">The <see cref="Type"/> that indicates where this operation is used.</param> 61Type type, 62Type? context) 82/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param> 88Type? context, 101/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param> 108Type? context, 121/// <param name="context">The <see cref="Type"/> that indicates where this operation is used.</param> 127Type? context, 149/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param> 156IEnumerable<Type>? typeArguments, 157Type? context, 187/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param> 193Type? context, 206/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param> 212Type? context) 223/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param> 229Type? context, 244/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param> 251Type? context, 266/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param> 273Type? context,
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (8)
137typeof(RuntimeBinderException).GetConstructor(new Type[] { typeof(string) }), 282private static Type GetTypeForErrorMetaObject(ICSharpBinder action, DynamicMetaObject[] args) 290Debug.Assert(args[0].Value is Type); 291return args[0].Value as Type; 421internal static int AddArgHashes(int hash, Type[] typeArguments, CSharpArgumentInfo[] argInfos) 423foreach (var typeArg in typeArguments) 446internal static bool CompareArgInfos(Type[] typeArgs, Type[] otherTypeArgs, CSharpArgumentInfo[] argInfos, CSharpArgumentInfo[] otherArgInfos)
Microsoft\CSharp\RuntimeBinder\CSharpArgumentInfoFlags.cs (1)
47/// The argument is a <see cref="System.Type"/> indicating an actual typename used in source. Used only for target objects in static calls.
Microsoft\CSharp\RuntimeBinder\CSharpBinaryOperationBinder.cs (4)
37public void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments) 57private readonly Type _callingContext; 69/// <param name="callingContext">The <see cref="Type"/> that indicates where this operation is defined.</param> 75Type callingContext,
Microsoft\CSharp\RuntimeBinder\CSharpConvertBinder.cs (5)
41public void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments) 56private readonly Type _callingContext; 66/// <param name="callingContext">The <see cref="Type"/> that indicates where this operation is defined.</param> 68Type type, 71Type callingContext) :
Microsoft\CSharp\RuntimeBinder\CSharpGetIndexBinder.cs (4)
30public void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments) 41private readonly Type _callingContext; 46/// <param name="callingContext">The <see cref="System.Type"/> that indicates where this operation is defined.</param> 49Type callingContext,
Microsoft\CSharp\RuntimeBinder\CSharpGetMemberBinder.cs (4)
30public void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments) 45private readonly Type _callingContext; 52/// <param name="callingContext">The <see cref="System.Type"/> that indicates where this operation is defined.</param> 57Type callingContext,
Microsoft\CSharp\RuntimeBinder\CSharpInvokeBinder.cs (6)
26public void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments) 35Type[] ICSharpInvokeOrInvokeMemberBinder.TypeArguments => Type.EmptyTypes; 49private readonly Type _callingContext; 55/// <param name="callingContext">The <see cref="System.Type"/> that indicates where this operation is defined.</param> 59Type callingContext,
Microsoft\CSharp\RuntimeBinder\CSharpInvokeConstructorBinder.cs (5)
21public void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments) 34public Type[] TypeArguments => Type.EmptyTypes; 42private readonly Type _callingContext; 46Type callingContext,
Microsoft\CSharp\RuntimeBinder\CSharpInvokeMemberBinder.cs (6)
27public void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments) 36public Type CallingContext { get; } 38public Type[] TypeArguments { get; } 60/// <param name="callingContext">The <see cref="System.Type"/> that indicates where this operation is defined.</param> 66Type callingContext, 67IEnumerable<Type> typeArguments,
Microsoft\CSharp\RuntimeBinder\CSharpIsEventBinder.cs (6)
23public void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments) 24=> SymbolTable.PopulateSymbolTableWithName(Name, null, arguments[0].Info.IsStaticType ? arguments[0].Value as Type : arguments[0].Type); 34private readonly Type _callingContext; 40/// <param name="callingContext">The <see cref="System.Type"/> that indicates where this operation is defined.</param> 43Type callingContext) 77public override Type ReturnType => typeof(bool);
Microsoft\CSharp\RuntimeBinder\CSharpSetIndexBinder.cs (4)
28public void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments) 41private readonly Type _callingContext; 52/// <param name="callingContext">The <see cref="Type"/> that indicates where this operation is defined.</param> 57Type callingContext,
Microsoft\CSharp\RuntimeBinder\CSharpSetMemberBinder.cs (4)
26public void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments) 39private readonly Type _callingContext; 50/// <param name="callingContext">The <see cref="Type"/> that indicates where this operation is defined.</param> 56Type callingContext,
Microsoft\CSharp\RuntimeBinder\CSharpUnaryOperationBinder.cs (4)
38public void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments) 49private readonly Type _callingContext; 58/// <param name="callingContext">The <see cref="Type"/> that indicates where this operation is defined.</param> 63Type callingContext,
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (21)
119Type accessibilityContext) 136public static object TryEvalUnaryOperators<T>(T obj, ExpressionType oper, Type accessibilityContext) 157public static K TryEvalCast<T, K>(T obj, Type type, CSharpBinderFlags kind, Type accessibilityContext) 169Type[] argTypes, 171out Type[] delegateSignatureTypes, 177delegateSignatureTypes = new Type[numberOfArguments + 2]; 208private static object CreateDelegateAndInvoke(Type[] delegateSignatureTypes, CallSiteBinder binder, object[] args) 210Type delegateType = Expression.GetDelegateType(delegateSignatureTypes); 236Type[] argTypes, 239Type accessibilityContext, 240Type[] typeArguments) 242Type[] delegateSignatureTypes; 285public static object TryGetMemberValue<T>(T obj, string propName, Type accessibilityContext, bool isResultIndexed) 315Type[] argTypes, 317Type accessibilityContext) 319Type[] delegateSignatureTypes; 352Type accessibilityContext) 381Type[] argTypes, 383Type accessibilityContext) 385Type[] delegateSignatureTypes;
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (2)
319Type t; 428Type t = fieldInfo.FieldType.AssociatedSystemType;
Microsoft\CSharp\RuntimeBinder\ICSharpBinder.cs (2)
21void PopulateSymbolTableWithName(Type callingType, ArgumentObject[] arguments); 30Type ReturnType { get; }
Microsoft\CSharp\RuntimeBinder\ICSharpInvokeOrInvokeMemberBinder.cs (1)
17Type[] TypeArguments { get; }
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (15)
25public RuntimeBinder(Type contextType, bool isChecked = false) 203private Type GetArgumentType(ICSharpBinder p, CSharpArgumentInfo argInfo, Expression param, DynamicMetaObject arg, int index) 205Type t = argInfo.UseCompileTimeType ? param.Type : arg.LimitType; 267ICSharpInvokeOrInvokeMemberBinder callOrInvoke, Type callingType, ArgumentObject[] arguments) 269Type type; 273type = arguments[0].Value as Type; 384private Expr CreateLocal(Type type, bool isOut, LocalVariableSymbol local) 517Type[] typeArguments, 692Type t = arguments[0].Value as Type; 800Type eventType = TypeManager.SubstType(eventCType, swtEvent.Ats).AssociatedSystemType; 1111ExprFactory.CreateClass(SymbolTable.GetCTypeFromType(argument.Value as Type)) : 1136Type type = argument.Type; 1189Type returnType, 1226internal Expr BindExplicitConversion(ArgumentObject[] arguments, Type returnType, LocalVariableSymbol[] locals)
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (18)
14public static bool IsNullableType(this Type type) 114private static bool IsGenericallyEqual(this Type t1, Type t2) 128Type t1def = t1.IsConstructedGenericType ? t1.GetGenericTypeDefinition() : t1; 129Type t2def = t2.IsConstructedGenericType ? t2.GetGenericTypeDefinition() : t2; 139private static bool IsGenericallyEquivalentTo(this Type t1, Type t2, MemberInfo member1, MemberInfo member2) 184Type[] args1 = t1.GetGenericArguments(); 185Type[] args2 = t2.GetGenericArguments(); 221private static bool IsTypeParameterEquivalentToTypeInst(this Type typeParam, Type typeInst, MemberInfo member) 236Type[] args = method.IsGenericMethod ? method.GetGenericArguments() : null; 254Type memberInfo = typeof(MemberInfo); 261types: new Type[] { typeof(MemberInfo) }, 280PropertyInfo property = memberInfo.GetProperty("MetadataToken", typeof(int), Type.EmptyTypes); 320public static string GetIndexerName(this Type type) 326foreach (Type iface in type.GetInterfaces()) 340private static string GetTypeIndexerName(Type type)
Microsoft\CSharp\RuntimeBinder\Semantics\ConstVal.cs (1)
90Type.GetTypeCode(o.GetType()) switch
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\AggregateSymbol.cs (1)
20public Type AssociatedSystemType;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Constant.cs (1)
59object objval = System.Type.GetTypeCode(Type.AssociatedSystemType) switch
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExprWithType.cs (2)
16protected static bool TypesAreEqual(Type t1, Type t2) => t1 == t2 || t1.IsEquivalentTo(t2);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MethodInfo.cs (4)
36Type type = aggType.AssociatedSystemType; 76Type[] typeArgs = new Type[size]; 107Type type = aggType.AssociatedSystemType;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\PropertyInfo.cs (1)
35Type type = aggType.AssociatedSystemType;
Microsoft\CSharp\RuntimeBinder\Semantics\Types\AggregateType.cs (9)
24private Type _associatedSystemType; 84Type baseSysType = AssociatedSystemType.BaseType; 163Type sysType = AssociatedSystemType; 166Type genType = sysType.GetGenericTypeDefinition(); 303public override Type AssociatedSystemType 310private Type CalculateAssociatedSystemType() 312Type uninstantiatedType = OwningAggregate.AssociatedSystemType; 317Type[] systemTypeArgs = new Type[typeArgs.Count];
Microsoft\CSharp\RuntimeBinder\Semantics\Types\ArrayType.cs (2)
49public override Type AssociatedSystemType 54Type elementType = ElementType.AssociatedSystemType;
Microsoft\CSharp\RuntimeBinder\Semantics\Types\NullableType.cs (1)
48public override Type AssociatedSystemType
Microsoft\CSharp\RuntimeBinder\Semantics\Types\ParameterModifierType.cs (1)
31public override Type AssociatedSystemType
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PointerType.cs (1)
22public override Type AssociatedSystemType
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (5)
53internal static Type GetAssociatedSystemType(PredefinedType type) => s_types[(int)type].AssociatedSystemType; 109public readonly Type AssociatedSystemType; 111internal PredefinedTypeInfo(PredefinedType type, Type associatedSystemType, string name, FUNDTYPE fundType) 121internal PredefinedTypeInfo(PredefinedType type, Type associatedSystemType, string name) 148new PredefinedTypeInfo(PredefinedType.PT_TYPE, typeof(Type), "System.Type"),
Microsoft\CSharp\RuntimeBinder\Semantics\Types\Type.cs (1)
20public virtual Type AssociatedSystemType
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeParameterType.cs (1)
58public override Type AssociatedSystemType
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (68)
20private static readonly HashSet<Type> s_typesWithConversionsLoaded = new HashSet<Type>(); 25internal Type Type { get; } 28public NameHashKey(Type type, string name) 51IEnumerable<Type> typeArguments, 52Type callingType) 81foreach (Type o in typeArguments) 143List<Type> inheritance = CreateInheritanceHierarchyList(key.Type); 152private static void AddNamesInInheritanceHierarchy(string name, List<Type> inheritance) 156Type type = inheritance[i]; 234private static List<Type> CreateInheritanceHierarchyList(Type type) 236List<Type> list; 239Type[] ifaces = type.GetInterfaces(); 241list = new List<Type>(ifaces.Length + 2) 245foreach (Type iface in type.GetInterfaces()) 251Type obj = typeof(object); 257list = new List<Type> { type }; 258for (Type parent = type.BaseType; parent != null; parent = parent.BaseType) 278private static Name GetName(Type type) 303Type[] genericArguments = method.GetGenericArguments(); 307Type t = genericArguments[i]; 314Type t = genericArguments[i]; 327private static TypeArray GetAggregateTypeParameters(Type type, AggregateSymbol agg) 331Type genericDefinition = type.GetGenericTypeDefinition(); 332Type[] genericArguments = genericDefinition.GetGenericArguments(); 351Type t = genericArguments[i]; 385private static TypeParameterType LoadClassTypeParameter(AggregateSymbol parent, Type t) 405private static bool AreTypeParametersEquivalent(Type t1, Type t2) 414Type t1Original = GetOriginalTypeParameterType(t1); 415Type t2Original = GetOriginalTypeParameterType(t2); 455private static Type GetOriginalTypeParameterType(Type t) 461Type parentType = t.DeclaringType; 477Type nextParent = parentType.DeclaringType; 499private static TypeParameterType LoadMethodTypeParameter(MethodSymbol parent, Type t) 521Type t, 581private static CType LoadSymbolsFromType(Type type) 592if (o is Type t) 630return ProcessMethodTypeParameter(m, declarationChain[++i] as Type, current as AggregateSymbol); 646private static TypeParameterType ProcessMethodTypeParameter(MethodInfo methinfo, Type t, AggregateSymbol parent) 666private static CType GetConstructedType(Type type, AggregateSymbol agg) 674foreach (Type argument in type.GetGenericArguments()) 689private static CType ProcessSpecialTypeInChain(NamespaceOrAggregateSymbol parent, Type t) 720private static List<object> BuildDeclarationChain(Type callingType) 740for (Type t = callingType; t != null; t = t.DeclaringType) 780private static AggregateSymbol FindSymForType(Symbol sym, Type t) 809internal static CType[] GetCTypeArrayFromTypes(Type[] types) 822Type t = types[i]; 832internal static CType GetCTypeFromType(Type type) => type.IsByRef 844Type type) 934Type genericDefinition = type.GetGenericTypeDefinition(); 935Type[] genericArguments = genericDefinition.GetGenericArguments(); 940Type t = genericArguments[i]; 970Type t = type.BaseType; 980agg.SetHasPubNoArgCtor(type.GetConstructor(Type.EmptyTypes) != null); 995private static void SetInterfacesOnAggregate(AggregateSymbol aggregate, Type type) 1001Type[] interfaces = type.GetInterfaces(); 1136Type t = aggtype.AssociatedSystemType; 1302Type t = type.getThisType().AssociatedSystemType; 1467PopulateSymbolTableWithName("Value", new Type[] { typeof(Missing) }, typeof(Missing)); // We might need this later 1511Debug.Assert(Type.GetTypeCode(defValue.GetType()) != TypeCode.Decimal); // Handled above 1512switch (Type.GetTypeCode(defValue.GetType())) 1632Type t = p.ParameterType; 1737internal static void AddConversionsForType(Type type) 1743for (Type t = type; t.BaseType != null; t = t.BaseType) 1752private static void AddConversionsForOneType(Type type)
Microsoft.Data.Analysis (116)
DataFrame.IO.cs (22)
23private static Type DefaultGuessTypeFunction(IEnumerable<string> columnValues) 25Type result = typeof(string); 61private static Type GuessKind(int col, List<(long LineNumber, string[] Line)> read, Func<IEnumerable<string>, Type> guessTypeFunction) 70private static Type DetermineType(bool first, Type suggested, Type previous) 78private static Type MaxKind(Type a, Type b) 108string[] columnNames = null, Type[] dataTypes = null, 121public static DataFrame LoadFrom(IEnumerable<IList<object>> vals, IList<(string, Type)> columnInfos) 189var type = reader.GetFieldType(c); 280private static DataFrameColumn CreateColumn(Type kind, string columnName) 350private static DataFrameColumn CreateColumn(Type kind, string[] columnNames, int columnIndex) 357string[] columnNames = null, Type[] dataTypes = null, 360CultureInfo cultureInfo = null, Func<IEnumerable<string>, Type> guessTypeFunction = null) 445Type kind = dataTypes == null ? GuessKind(i, linesForGuessType, guessTypeFunction) : dataTypes[i]; 542string[] columnNames = null, Type[] dataTypes = null, 545CultureInfo cultureInfo = null, Func<IEnumerable<string>, Type> guessTypeFunction = null) 569string[] columnNames = null, Type[] dataTypes = null, 572Func<IEnumerable<string>, Type> guessTypeFunction = null)
DataFrameColumn.cs (2)
27protected DataFrameColumn(string name, long length, Type type) 153public Type DataType { get; }
DataFrameColumns\ArrowStringDataFrameColumn.cs (1)
398Type dataType = mapIndices.DataType;
DataFrameColumns\StringDataFrameColumn.cs (1)
305Type dataType = mapIndices.DataType;
DataFrameColumns\VBufferDataFrameColumn.cs (1)
285Type dataType = mapIndices.DataType;
PrimitiveColumnContainer.cs (1)
460public PrimitiveColumnContainer<T> Clone<U>(PrimitiveColumnContainer<U> mapIndices, Type type, bool invertMapIndices = false)
PrimitiveDataFrameColumn.cs (88)
168Type type = this.DataType; 321var type = typeof(T); 428Type dataType = mapIndices.DataType; 961case Type boolType when boolType == typeof(bool): 970case Type decimalType when decimalType == typeof(decimal): 993case Type DateTimeType when DateTimeType == typeof(DateTime): 995case Type byteType when byteType == typeof(byte): 996case Type charType when charType == typeof(char): 997case Type doubleType when doubleType == typeof(double): 998case Type floatType when floatType == typeof(float): 999case Type intType when intType == typeof(int): 1000case Type longType when longType == typeof(long): 1001case Type sbyteType when sbyteType == typeof(sbyte): 1002case Type shortType when shortType == typeof(short): 1003case Type uintType when uintType == typeof(uint): 1004case Type ulongType when ulongType == typeof(ulong): 1005case Type ushortType when ushortType == typeof(ushort): 1046case Type boolType when boolType == typeof(bool): 1048case Type decimalType when decimalType == typeof(decimal): 1071case Type DateTimeType when DateTimeType == typeof(DateTime): 1073case Type byteType when byteType == typeof(byte): 1074case Type charType when charType == typeof(char): 1075case Type doubleType when doubleType == typeof(double): 1076case Type floatType when floatType == typeof(float): 1077case Type intType when intType == typeof(int): 1078case Type longType when longType == typeof(long): 1079case Type sbyteType when sbyteType == typeof(sbyte): 1080case Type shortType when shortType == typeof(short): 1081case Type uintType when uintType == typeof(uint): 1082case Type ulongType when ulongType == typeof(ulong): 1083case Type ushortType when ushortType == typeof(ushort): 1124case Type boolType when boolType == typeof(bool): 1126case Type decimalType when decimalType == typeof(decimal): 1148case Type DateTimeType when DateTimeType == typeof(DateTime): 1150case Type byteType when byteType == typeof(byte): 1151case Type charType when charType == typeof(char): 1152case Type doubleType when doubleType == typeof(double): 1153case Type floatType when floatType == typeof(float): 1154case Type intType when intType == typeof(int): 1155case Type longType when longType == typeof(long): 1156case Type sbyteType when sbyteType == typeof(sbyte): 1157case Type shortType when shortType == typeof(short): 1158case Type uintType when uintType == typeof(uint): 1159case Type ulongType when ulongType == typeof(ulong): 1160case Type ushortType when ushortType == typeof(ushort): 1200case Type boolType when boolType == typeof(bool): 1219case Type boolType when boolType == typeof(bool): 1221case Type byteType when byteType == typeof(byte): 1226case Type charType when charType == typeof(char): 1231case Type decimalType when decimalType == typeof(decimal): 1233case Type doubleType when doubleType == typeof(double): 1235case Type floatType when floatType == typeof(float): 1237case Type intType when intType == typeof(int): 1242case Type longType when longType == typeof(long): 1247case Type sbyteType when sbyteType == typeof(sbyte): 1252case Type shortType when shortType == typeof(short): 1257case Type uintType when uintType == typeof(uint): 1262case Type ulongType when ulongType == typeof(ulong): 1267case Type ushortType when ushortType == typeof(ushort): 1272case Type DateTimeType when DateTimeType == typeof(DateTime): 1288case Type boolType when boolType == typeof(bool): 1294case Type decimalType when decimalType == typeof(decimal): 1310case Type DateTimeType when DateTimeType == typeof(DateTime): 1316case Type byteType when byteType == typeof(byte): 1317case Type charType when charType == typeof(char): 1318case Type doubleType when doubleType == typeof(double): 1319case Type floatType when floatType == typeof(float): 1320case Type intType when intType == typeof(int): 1321case Type longType when longType == typeof(long): 1322case Type sbyteType when sbyteType == typeof(sbyte): 1323case Type shortType when shortType == typeof(short): 1324case Type uintType when uintType == typeof(uint): 1325case Type ulongType when ulongType == typeof(ulong): 1326case Type ushortType when ushortType == typeof(ushort): 1359case Type boolType when boolType == typeof(bool): 1365case Type decimalType when decimalType == typeof(decimal): 1381case Type DateTimeType when DateTimeType == typeof(DateTime): 1387case Type byteType when byteType == typeof(byte): 1388case Type charType when charType == typeof(char): 1389case Type doubleType when doubleType == typeof(double): 1390case Type floatType when floatType == typeof(float): 1391case Type intType when intType == typeof(int): 1392case Type longType when longType == typeof(long): 1393case Type sbyteType when sbyteType == typeof(sbyte): 1394case Type shortType when shortType == typeof(short): 1395case Type uintType when uintType == typeof(uint): 1396case Type ulongType when ulongType == typeof(ulong): 1397case Type ushortType when ushortType == typeof(ushort):
Microsoft.Data.Analysis.Tests (43)
DataFrame.IOTests.cs (41)
35Type dataType = column.DataType; 407dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double) } 413dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double) } 495DataFrame df = DataFrame.LoadCsv(GetStream(data), dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double) }); 497df = DataFrame.LoadCsvFromString(data, dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double) }); 567DataFrame df = DataFrame.LoadCsv(GetStream(data), dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double), typeof(DateTime) }); 569df = DataFrame.LoadCsvFromString(data, dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double), typeof(DateTime) }); 883DataFrame df = DataFrame.LoadCsv(GetStream(data), dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long) }); 885df = DataFrame.LoadCsvFromString(data, dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long) }); 1226static void AssertEqual(DataFrame dataFrame, (string name, Type type)[] columns, object[][] vals) 1234static ((string name, Type type)[] columns, object[][] vals) GetTestData() 1293private readonly Type[] _columnTypes; 1296public LoadCsvVerifyingHelper(int columnCount, long rowCount, string[] columnNames, Type[] columnTypes, object[][] cells) 1338new Type[] { typeof(string), typeof(int), typeof(string) }, 1343new Type[] { typeof(string), typeof(int), typeof(string) }, 1361new Type[] { typeof(string), typeof(int), typeof(string) }, 1366new Type[] { typeof(string), typeof(int), typeof(string) }, 1384new Type[] { typeof(string), typeof(int), typeof(string) }, 1389new Type[] { typeof(string), typeof(int), typeof(string) }, 1408new Type[] { typeof(string), typeof(int), typeof(string) }, 1413new Type[] { typeof(string), typeof(int), typeof(string) }, 1440new Type[] { typeof(string), typeof(int), typeof(string) }, 1453new Type[] { typeof(string), typeof(int), typeof(string) }, 1471new Type[] { typeof(string), typeof(int), typeof(string) }, 1476new Type[] { typeof(string), typeof(int), typeof(string) }, 1494new Type[] { typeof(string), typeof(int), typeof(string) }, 1499new Type[] { typeof(string), typeof(int), typeof(string) }, 1512public void TestLoadCsvWithTextQualifiersFromStream(string data, char separator, Type[] dataTypes, LoadCsvVerifyingHelper helper) 1520public void TestLoadCsvWithTextQualifiersFromString(string data, char separator, Type[] dataTypes, LoadCsvVerifyingHelper helper) 1528public void TestSaveCsvWithTextQualifiers(string data, char separator, Type[] dataTypes, LoadCsvVerifyingHelper helper) 1558new Type[] { typeof(string), typeof(float), typeof(string), typeof(DateTime), typeof(float), typeof(float), typeof(string) }, 1573new Type[] { typeof(string), typeof(int), typeof(string), typeof(DateTime), typeof(double), typeof(long), typeof(string) }, 1584Type CustomGuessTypeFunction(IEnumerable<string> columnValues) 1586List<Type> types = [ 1596HashSet<Type> possibleTypes = new HashSet<Type>(types); 1609List<Type> typesToRemove = new List<Type>(possibleTypes.Count); 1611foreach (var type in possibleTypes) 1650foreach (var type in typesToRemove) 1662foreach (var type in types)
DataFrameTests.BinaryOperations.cs (1)
153var dtype = dfd.Columns[0].DataType;
DataFrameTests.cs (1)
1241void AssertLengthTypeAndValues(DataFrameColumn column, Type type)
Microsoft.DotNet.AsmDiff (4)
MefHelpers.cs (4)
19public static ContainerConfiguration WithExport(this ContainerConfiguration configuration, object exportedInstance, Type contractType, string contractName = null, IDictionary<string, object> metadata = null) 27readonly Type _contractType; 30protected SinglePartExportDescriptorProvider(Type contractType, string contractName, IDictionary<string, object> metadata) 67public InstanceExportDescriptorProvider(object exportedInstance, Type contractType, string contractName, IDictionary<string, object> metadata)
Microsoft.DotNet.Build.Tasks.Feed (1)
src\Common\Internal\EnumExtensions.cs (1)
16Type type = value.GetType();
Microsoft.DotNet.Build.Tasks.Packaging (6)
PackageIndex.cs (4)
696public override bool CanConvert(Type objectType) 701public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 794public override bool CanConvert(Type objectType) 799public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
PackageReport.cs (2)
68public override bool CanConvert(Type objectType) 73public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Microsoft.DotNet.Internal.DependencyInjection.Testing (16)
DependencyInjectionValidation.cs (16)
36IEnumerable<Type> additionalScopedTypes = null, 37IEnumerable<Type> additionalSingletonTypes = null) 68foreach (Type scopedType in additionalScopedTypes ?? Enumerable.Empty<Type>()) 76foreach (Type scopedType in additionalSingletonTypes ?? Enumerable.Empty<Type>()) 91Type type, 191private static string GetDisplayName(Type type) 204private static bool IsMatchingServiceRegistration(Type serviceType, Type parameterType) 209Type parameterRoot = parameterType.GetGenericTypeDefinition(); 214Type optionType = parameterType.GenericTypeArguments[0]; 219Type serviceRoot = serviceType.GetGenericTypeDefinition(); 232Type def = parameterType.GetGenericTypeDefinition(); 242private static bool IsOptionsType(Type parameterRoot) 255private static bool IsExemptType(Type type)
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\AssertEx.cs (2)
29var type = typeof(T); 375var type = ex.GetType();
Microsoft.DotNet.RemoteExecutor (3)
Program.cs (1)
41Type t = null;
RemoteExecutor.cs (2)
437Type t = method.DeclaringType; 598Type targetType = d.Target.GetType();
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (17)
HelperFactory.cs (17)
31internal static void RegisterAllForType(IHandlebars hb, Type type, object instance) 48private static List<(string name, HandlebarsBlockHelper helper)> CreateBlockHelpersForType(Type type, object instance) 74private static List<(string name, HandlebarsHelper helper)> CreateHelpersForType(Type type, object instance) 100private static IEnumerable<MethodInfo> GetAllMethods(Type type) 213private static MethodInfo EnumerableSkip(Type member) => 216private static MethodInfo EnumerableToArray(Type member) => 219private static MethodInfo EnumerableSelect(Type input, Type output) => 229new[] {typeof(object), typeof(Type)}); 235public ProvidedParameter(string name, Type type, Expression value) 243public Type Type { get; } 268private static readonly Type UndefinedBindingResultType = 271private static Expression CoerceObjectExpression(Type output, Expression input) 295private static Expression ConvertResultExpression(Type type, Expression input) 310var parameterType = parameter.ParameterType; 320private static Expression GetExpressionForParamArrayParameter(Type parameterType, int index, ParameterExpression argumentsParameter) 328var elementType = parameterType.GetElementType();
Microsoft.DotNet.VersionTools.Tests (10)
BuildManifest\ManifestModelTests.cs (10)
38public void ManifestModelToXmlValidatesFileExtensionSignInfos(Type exceptionType, params string[] infos) 62private static void VerifyToXml(Type expectedExceptionType, SigningInformationModel signInfo) 89public void ManifestModelFromXmlValidatesFileExtensionSignInfos(Type exceptionType, params string[] infos) 111private static void VerifyFromXml(Type expectedExceptionType, StringBuilder builder) 143public void ManifestModelToXmlValidatesFileSignInfos(Type exceptionType, params string[] infos) 219public void ManifestModelFromXmlValidatesFileSignInfos(Type exceptionType, params string[] infos) 254public void ManifestModelToXmlValidatesCertificateSignInfo(Type exceptionType, params string[] infos) 294public void ManifestModelFromXmlValidatesCertificateSignInfo(Type exceptionType, params string[] infos) 331public void ManifestModelToXmlValidatesStrongNameSignInfo(Type exceptionType, params string[] infos) 372public void ManifestModelFromXmlValidatesStrongNameSignInfo(Type exceptionType, params string[] infos)
Microsoft.DotNet.XUnitAssert.Tests (8)
Sdk\ArgumentFormatterTests.cs (8)
201 public static TheoryData<Type, string> TypeValueData = new() 225 public static void TypeValue(Type type, string expected) 471 public Type MyProp2 { get; set; } 513 public static TheoryData<Type, string> ArgumentFormatterFormatTypeNamesData = new() 526 public void ArgumentFormatterFormatTypeNames(Type type, string expectedResult) 535 var parameterType = genericTypeParameters.First(); 544 var parameterTKey = genericTypeParameters.First(); 548 var parameterTValue = genericTypeParameters.Last();
Microsoft.DotNet.XUnitExtensions (24)
Attributes\ActiveIssueAttribute.cs (2)
16public Type CalleeType { get; private set; } 23public ActiveIssueAttribute(string issue, Type calleeType, params string[] conditionMemberNames)
Attributes\ConditionalClassAttribute.cs (2)
15public Type CalleeType { get; private set; } 20Type calleeType,
Attributes\ConditionalFactAttribute.cs (2)
15public Type CalleeType { get; private set; } 20Type calleeType,
Attributes\ConditionalTheoryAttribute.cs (2)
15public Type CalleeType { get; private set; } 20Type calleeType,
Attributes\OuterLoopAttribute.cs (2)
16public Type CalleeType { get; private set; } 25public OuterLoopAttribute(string reason, Type calleeType, params string[] conditionMemberNames)
DiscovererHelpers.cs (5)
15private static readonly Lazy<bool> s_isMonoRuntime = new Lazy<bool>(() => Type.GetType("Mono.RuntimeStructs") != null); 46internal static bool Evaluate(Type calleeType, string[] conditionMemberNames) 72Type calleeType = null; 89else if (arg is Type) 91calleeType = (Type)arg;
Discoverers\ConditionalClassDiscoverer.cs (1)
41Type calleeType = null;
Discoverers\ConditionalTestDiscoverer.cs (7)
22Type calleeType = null; 28Type testMethodDeclaringType = testMethodInfo.DeclaringType; 41Type declaringType; 115internal static string GetFailedLookupString(string name, Type type) 123internal static Func<bool> LookupConditionalMember(Type t, string name) 145internal static bool CheckInputToSkipExecution(object[] conditionArguments, ref Type calleeType, ref string[] conditionMemberNames, ITestMethod testMethod = null) 152calleeType = conditionArguments[0] as Type;
XunitParallelTheoryTestCaseRunner.cs (1)
102Type[] parameterTypes = methodToRun.GetParameters().Select(p => p.ParameterType).ToArray();
Microsoft.Extensions.Caching.Hybrid (17)
Internal\DefaultHybridCache.Serialization.cs (1)
18private readonly ConcurrentDictionary<Type, object> _serializers = new();
Internal\DefaultHybridCache.Stampede.cs (2)
95static void ThrowWrongType(string key, Type existingType, Type newType)
Internal\DefaultHybridCache.StampedeState.cs (1)
85public abstract Type Type { get; }
Internal\DefaultHybridCache.StampedeStateT.cs (1)
41public override Type Type => typeof(T);
Internal\ImmutableTypeCache.cs (1)
49internal static bool IsTypeImmutable(Type type)
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (3)
16/// Indicates that certain members on a specified <see cref="Type"/> are accessed dynamically, 23/// This attribute is valid on members whose type is <see cref="Type"/> or <see cref="string"/>. 29/// can be accessed dynamically on <see cref="Type"/> instances returned from calling
src\LegacySupport\TrimAttributes\DynamicDependencyAttribute.cs (8)
40/// with the specified signature of a member on a <see cref="System.Type"/>. 43/// <param name="type">The <see cref="System.Type"/> containing <paramref name="memberSignature"/>.</param> 44public DynamicDependencyAttribute(string memberSignature, Type type) 66/// with the specified types of members on a <see cref="System.Type"/>. 69/// <param name="type">The <see cref="System.Type"/> containing the specified members.</param> 70public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type) 110/// Gets the <see cref="System.Type"/> containing the specified member. 116public Type? Type { get; }
Microsoft.Extensions.Caching.Hybrid.Tests (2)
TypeTests.cs (2)
20public void ImmutableTypes(Type type) 36public void MutableTypes(Type type)
Microsoft.Extensions.Caching.StackExchangeRedis (2)
src\Shared\ThrowHelpers\ObjectDisposedThrowHelper.cs (2)
34public static void ThrowIf([DoesNotReturnIf(true)] bool condition, Type type) 54private static void ThrowObjectDisposedException(Type? type)
Microsoft.Extensions.Compliance.Abstractions (11)
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (3)
16/// Indicates that certain members on a specified <see cref="Type"/> are accessed dynamically, 23/// This attribute is valid on members whose type is <see cref="Type"/> or <see cref="string"/>. 29/// can be accessed dynamically on <see cref="Type"/> instances returned from calling
src\LegacySupport\TrimAttributes\DynamicDependencyAttribute.cs (8)
40/// with the specified signature of a member on a <see cref="System.Type"/>. 43/// <param name="type">The <see cref="System.Type"/> containing <paramref name="memberSignature"/>.</param> 44public DynamicDependencyAttribute(string memberSignature, Type type) 66/// with the specified types of members on a <see cref="System.Type"/>. 69/// <param name="type">The <see cref="System.Type"/> containing the specified members.</param> 70public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type) 110/// Gets the <see cref="System.Type"/> containing the specified member. 116public Type? Type { get; }
Microsoft.Extensions.Compliance.Redaction (5)
RedactionBuilder.cs (1)
40var redactorType = typeof(T);
RedactorProvider.cs (2)
38private static FrozenDictionary<DataClassificationSet, Redactor> GetClassRedactorMap(IEnumerable<Redactor> redactors, Dictionary<DataClassificationSet, Type> map) 62private static Redactor GetFallbackRedactor(IEnumerable<Redactor> redactors, Type defaultRedactorType)
RedactorProviderOptions.cs (2)
18public Type FallbackRedactor { get; set; } = typeof(ErasingRedactor); 23public Dictionary<DataClassificationSet, Type> Redactors { get; } = [];
Microsoft.Extensions.Compliance.Testing (11)
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (3)
16/// Indicates that certain members on a specified <see cref="Type"/> are accessed dynamically, 23/// This attribute is valid on members whose type is <see cref="Type"/> or <see cref="string"/>. 29/// can be accessed dynamically on <see cref="Type"/> instances returned from calling
src\LegacySupport\TrimAttributes\DynamicDependencyAttribute.cs (8)
40/// with the specified signature of a member on a <see cref="System.Type"/>. 43/// <param name="type">The <see cref="System.Type"/> containing <paramref name="memberSignature"/>.</param> 44public DynamicDependencyAttribute(string memberSignature, Type type) 66/// with the specified types of members on a <see cref="System.Type"/>. 69/// <param name="type">The <see cref="System.Type"/> containing the specified members.</param> 70public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type) 110/// Gets the <see cref="System.Type"/> containing the specified member. 116public Type? Type { get; }
Microsoft.Extensions.Configuration.Binder (42)
ConfigurationBinder.cs (40)
73public static object? Get(this IConfiguration configuration, Type type) 90Type type, 187Type type, 206Type type, string key, 323[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 428Type? interfaceGenericType = type.IsInterface && type.IsConstructedGenericType ? type.GetGenericTypeDefinition() : null; 434Type genericType = typeof(List<>).MakeGenericType(type.GenericTypeArguments); 447Type? dictionaryInterface = FindOpenGenericInterface(typeof(IDictionary<,>), type); 455Type? collectionInterface = FindOpenGenericInterface(typeof(ICollection<>), type); 510Type type, 625Type dictionaryType, 629Type keyType = dictionaryType.GenericTypeArguments[0]; 630Type valueType = dictionaryType.GenericTypeArguments[1]; 659Type kvpType = typeof(KeyValuePair<,>).MakeGenericType(keyType, valueType); 696Type dictionaryType, 702Type keyType = dictionaryType.GenericTypeArguments[0]; 703Type valueType = dictionaryType.GenericTypeArguments[1]; 766Type collectionType, 770Type itemType = collectionType.GenericTypeArguments[0]; 803private static Array BindArray(Type type, IEnumerable? source, IConfiguration config, BinderOptions options) 805Type elementType; 862private static object? BindSet(Type type, IEnumerable? source, IConfiguration config, BinderOptions options) 864Type elementType = type.GetGenericArguments()[0]; 879Type genericType = typeof(HashSet<>).MakeGenericType(elementType); 932Type type, 985Type type, 996private static bool TypeIsADictionaryInterface(Type type) 1000Type genericTypeDefinition = type.GetGenericTypeDefinition(); 1005private static bool IsImmutableArrayCompatibleInterface(Type type) 1009Type genericTypeDefinition = type.GetGenericTypeDefinition(); 1015private static bool TypeIsASetInterface(Type type) 1019Type genericTypeDefinition = type.GetGenericTypeDefinition(); 1027private static Type? FindOpenGenericInterface( 1028Type expected, 1030Type actual) 1038Type[] interfaces = actual.GetInterfaces(); 1039foreach (Type interfaceType in interfaces) 1050private static List<PropertyInfo> GetAllProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 1054Type baseType = type; 1079private static object? BindParameter(ParameterInfo parameter, Type type, IConfiguration config,
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (2)
42static object? CreateValueType(Type t) => 52Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
Microsoft.Extensions.DependencyInjection (112)
DependencyInjectionEventSource.cs (4)
97public void ServiceResolved(ServiceProvider provider, Type serviceType) 106public void CallSiteBuilt(ServiceProvider provider, Type serviceType, ServiceCallSite callSite) 125public void DynamicMethodBuilt(ServiceProvider provider, Type serviceType, int methodSize) 305public static void ExpressionTreeGenerated(this DependencyInjectionEventSource source, ServiceProvider provider, Type serviceType, Expression expression)
ServiceLookup\CallSiteChain.cs (4)
33public void Add(ServiceIdentifier serviceIdentifier, Type? implementationType = null) 57Type? implementationType = pair.Value.ImplementationType; 79public Type? ImplementationType { get; } 81public ChainItemInfo(int order, Type? implementationType)
ServiceLookup\CallSiteFactory.cs (29)
39Type serviceType = descriptor.ServiceType; 42Type? implementationType = descriptor.GetImplementationType(); 57Type[] serviceTypeGenericArguments = serviceType.GetGenericArguments(); 58Type[] implementationTypeGenericArguments = implementationType.GetGenericArguments(); 70else if (descriptor.TryGetImplementationType(out Type? implementationType)) 100Type serviceType, 101Type[] serviceTypeGenericArguments, 102Type implementationType, 103Type[] implementationTypeGenericArguments) 109Type serviceGenericType = serviceTypeGenericArguments[i]; 110Type implementationGenericType = implementationTypeGenericArguments[i]; 129private static DynamicallyAccessedMemberTypes GetDynamicallyAccessedMemberTypes(Type serviceGenericType) 265var serviceType = serviceIdentifier.ServiceType; 273Type itemType = serviceType.GenericTypeArguments[0]; 428Type? implementationType = descriptor.GetImplementationType(); 431Type closedType; 434Type[] genericTypeArguments = serviceIdentifier.ServiceType.GenericTypeArguments; 461[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType, 498HashSet<Type>? bestConstructorParameterTypes = null; 524bestConstructorParameterTypes = new HashSet<Type>(); 567Type implementationType, 578Type parameterType = parameters[index].ParameterType; 636private static void VerifyOpenGenericAotCompatibility(Type serviceType, Type[] genericTypeArguments) 638foreach (Type typeArg in genericTypeArguments) 652public bool IsService(Type serviceType) => IsService(new ServiceIdentifier(null, serviceType)); 654public bool IsKeyedService(Type serviceType, object? key) => IsService(new ServiceIdentifier(key, serviceType)); 658var serviceType = serviceIdentifier.ServiceType; 681if (serviceType.IsConstructedGenericType && serviceType.GetGenericTypeDefinition() is Type genericDefinition)
ServiceLookup\CallSiteRuntimeResolver.cs (1)
178static Array CreateArray(Type elementType, int length)
ServiceLookup\CallSiteValidator.cs (18)
10internal sealed class CallSiteValidator : CallSiteVisitor<CallSiteValidator.CallSiteValidatorState, Type?> 13private readonly ConcurrentDictionary<ServiceCacheKey, Type?> _scopedServices = new ConcurrentDictionary<ServiceCacheKey, Type?>(); 20&& _scopedServices.TryGetValue(callSite.Cache.Key, out Type? scopedService) 23Type serviceType = callSite.ServiceType; 39protected override Type? VisitCallSite(ServiceCallSite callSite, CallSiteValidatorState argument) 44if (!_scopedServices.TryGetValue(callSite.Cache.Key, out Type? firstScopedServiceInCallSiteTree)) 67protected override Type? VisitConstructor(ConstructorCallSite constructorCallSite, CallSiteValidatorState state) 69Type? result = null; 72Type? scoped = VisitCallSite(parameterCallSite, state); 78protected override Type? VisitIEnumerable(IEnumerableCallSite enumerableCallSite, 81Type? result = null; 84Type? scoped = VisitCallSite(serviceCallSite, state); 90protected override Type? VisitRootCache(ServiceCallSite singletonCallSite, CallSiteValidatorState state) 96protected override Type? VisitScopeCache(ServiceCallSite scopedCallSite, CallSiteValidatorState state) 108protected override Type? VisitConstant(ConstantCallSite constantCallSite, CallSiteValidatorState state) => null; 110protected override Type? VisitServiceProvider(ServiceProviderCallSite serviceProviderCallSite, CallSiteValidatorState state) => null; 112protected override Type? VisitFactory(FactoryCallSite factoryCallSite, CallSiteValidatorState state) => null;
ServiceLookup\ConstantCallSite.cs (4)
10private readonly Type _serviceType; 13public ConstantCallSite(Type serviceType, object? defaultValue) : base(ResultCache.None(serviceType)) 24public override Type ServiceType => _serviceType; 25public override Type ImplementationType => DefaultValue?.GetType() ?? _serviceType;
ServiceLookup\ConstructorCallSite.cs (4)
14public ConstructorCallSite(ResultCache cache, Type serviceType, ConstructorInfo constructorInfo) : this(cache, serviceType, constructorInfo, Array.Empty<ServiceCallSite>()) 18public ConstructorCallSite(ResultCache cache, Type serviceType, ConstructorInfo constructorInfo, ServiceCallSite[] parameterCallSites) : base(cache) 30public override Type ServiceType { get; } 32public override Type? ImplementationType => ConstructorInfo.DeclaringType;
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (3)
120static MethodInfo GetArrayEmptyMethodInfo(Type elementType) 129static NewArrayExpression NewArrayInit(Type elementType, IEnumerable<Expression> expr) 195private static Expression Convert(Expression expression, Type type, bool forceValueTypeConversion = false)
ServiceLookup\FactoryCallSite.cs (4)
12public FactoryCallSite(ResultCache cache, Type serviceType, Func<IServiceProvider, object> factory) : base(cache) 18public FactoryCallSite(ResultCache cache, Type serviceType, object serviceKey, Func<IServiceProvider, object, object> factory) : base(cache) 24public override Type ServiceType { get; } 25public override Type? ImplementationType => null;
ServiceLookup\IEnumerableCallSite.cs (4)
13internal Type ItemType { get; } 16public IEnumerableCallSite(ResultCache cache, Type itemType, ServiceCallSite[] serviceCallSites) : base(cache) 27public override Type ServiceType => typeof(IEnumerable<>).MakeGenericType(ItemType); 32public override Type ImplementationType => ItemType.MakeArrayType();
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (2)
35private static readonly MethodInfo GetTypeFromHandleMethod = typeof(Type).GetMethod(nameof(Type.GetTypeFromHandle))!;
ServiceLookup\ResultCache.cs (1)
11public static ResultCache None(Type serviceType)
ServiceLookup\ServiceCacheKey.cs (1)
29public ServiceCacheKey(object key, Type type, int slot)
ServiceLookup\ServiceCallSite.cs (2)
18public abstract Type ServiceType { get; } 19public abstract Type? ImplementationType { get; }
ServiceLookup\ServiceDescriptorExtensions.cs (2)
32public static Type? GetImplementationType(this ServiceDescriptor serviceDescriptor) 39public static bool TryGetImplementationType(this ServiceDescriptor serviceDescriptor, out Type? type)
ServiceLookup\ServiceIdentifier.cs (4)
13public Type ServiceType { get; } 15public ServiceIdentifier(Type serviceType) 20public ServiceIdentifier(object? serviceKey, Type serviceType) 29public static ServiceIdentifier FromServiceType(Type type) => new ServiceIdentifier(null, type);
ServiceLookup\ServiceLookupHelpers.cs (3)
33.GetMethod(nameof(Monitor.Enter), BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(object), typeof(bool).MakeByRefType() }, null)!; 35.GetMethod(nameof(Monitor.Exit), BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(object) }, null)!; 40internal static MethodInfo GetArrayEmptyMethodInfo(Type itemType) =>
ServiceLookup\ServiceProviderCallSite.cs (2)
14public override Type ServiceType { get; } = typeof(IServiceProvider); 15public override Type ImplementationType { get; } = typeof(ServiceProvider);
ServiceLookup\ServiceProviderEngineScope.cs (3)
43public object? GetService(Type serviceType) 53public object? GetKeyedService(Type serviceType, object? serviceKey) 63public object GetRequiredKeyedService(Type serviceType, object? serviceKey)
ServiceProvider.cs (5)
103public object? GetService(Type serviceType) => GetService(ServiceIdentifier.FromServiceType(serviceType), Root); 111public object? GetKeyedService(Type serviceType, object? serviceKey) 114internal object? GetKeyedService(Type serviceType, object? serviceKey, ServiceProviderEngineScope serviceProviderEngineScope) 124public object GetRequiredKeyedService(Type serviceType, object? serviceKey) 127internal object GetRequiredKeyedService(Type serviceType, object? serviceKey, ServiceProviderEngineScope serviceProviderEngineScope)
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (2)
42static object? CreateValueType(Type t) => 52Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (10)
15private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 44/// <param name="type">The <see cref="Type"/>.</param> 50public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 57private static string? ProcessType(ref StringBuilder? builder, Type type, in DisplayNameOptions options) 61Type[] genericArguments = type.GetGenericArguments(); 109private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 111Type innerType = type; 128private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
Microsoft.Extensions.DependencyInjection.Abstractions (171)
ActivatorUtilities.cs (43)
28private static readonly ConcurrentDictionary<Type, ConstructorInfoEx[]> s_constructorInfos = new(); 31private static readonly Lazy<ConditionalWeakTable<Type, ConstructorInfoEx[]>> s_collectibleConstructorInfos = new(); 38new Func<IServiceProvider, Type, Type, bool, object?, object?>(GetService).Method; 49[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, 172Type?[] argumentTypes; 175argumentTypes = Type.EmptyTypes; 179argumentTypes = new Type[parameters.Length]; 227[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type) 252[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type) 277[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, 278Type[] argumentTypes) 315Type[] argumentTypes) 334private static void CreateFactoryInternal([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, Type[] argumentTypes, out ParameterExpression provider, out ParameterExpression argumentArray, out Expression factoryExpressionBody) 374[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type) 379private static object? GetService(IServiceProvider sp, Type type, Type requiredBy, bool hasDefaultValue, object? key) 390private static void ThrowHelperUnableToResolveService(Type type, Type requiredBy) 407Type? parameterType = constructorParameter.ParameterType; 418Expression.Constant(parameterType, typeof(Type)), 419Expression.Constant(constructor.DeclaringType, typeof(Type)), 448[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, 449Type?[] argumentTypes) 452Type declaringType = constructor.DeclaringType!; 549public FactoryParameterContext(Type parameterType, bool hasDefaultValue, object? defaultValue, int argumentIndex, object? serviceKey) 558public Type ParameterType { get; } 566[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, 567Type?[] argumentTypes, 602[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, 603Type?[] argumentTypes, 635[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, 636Type?[] argumentTypes, 688private static bool TryCreateParameterMap(ParameterInfo[] constructorParameters, Type?[] argumentTypes, out int?[] parameterMap) 695Type? givenParameter = argumentTypes[i]; 822Type? givenType = givenParameters[givenIndex]?.GetType(); 929Type declaringType, 969Type declaringType, 987Type declaringType, 1123Type declaringType, 1203public static void ClearCache(Type[]? _) 1222private static object? GetKeyedService(IServiceProvider provider, Type type, object? serviceKey)
Extensions\ServiceCollectionDescriptorExtensions.cs (14)
107[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type service) 126Type service, 127[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 147Type service, 213[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type service) 232Type service, 233[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 253Type service, 319[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type service) 338Type service, 339[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 359Type service, 459Type? implementationType = descriptor.GetImplementationType(); 562public static IServiceCollection RemoveAll(this IServiceCollection collection, Type serviceType)
Extensions\ServiceCollectionDescriptorExtensions.Keyed.cs (13)
21[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type service, 42Type service, 44[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 65Type service, 137[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type service, 158Type service, 160[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 181Type service, 253[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type service, 274Type service, 276[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 297Type service, 397public static IServiceCollection RemoveAllKeyed(this IServiceCollection collection, Type serviceType, object? serviceKey)
IKeyedServiceProvider.cs (2)
21object? GetKeyedService(Type serviceType, object? serviceKey); 31object GetRequiredKeyedService(Type serviceType, object? serviceKey);
IServiceProviderIsKeyedService.cs (1)
21bool IsKeyedService(Type serviceType, object? serviceKey);
IServiceProviderIsService.cs (1)
18bool IsService(Type serviceType);
ISupportRequiredService.cs (1)
21object GetRequiredService(Type serviceType);
ObjectFactory.cs (2)
9/// The result of <see cref="ActivatorUtilities.CreateFactory(Type, Type[])"/>.
ServiceCollectionServiceExtensions.cs (16)
26Type serviceType, 27[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 48Type serviceType, 87[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType) 168Type serviceType, 169[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 190Type serviceType, 229[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType) 311Type serviceType, 312[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 333Type serviceType, 372[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType) 453Type serviceType, 487Type serviceType, 488[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType, 498Type serviceType,
ServiceCollectionServiceExtensions.Keyed.cs (16)
27Type serviceType, 29[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 51Type serviceType, 95[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType, 185Type serviceType, 187[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 209Type serviceType, 253[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType, 343Type serviceType, 345[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 367Type serviceType, 411[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType, 501Type serviceType, 538Type serviceType, 540[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType, 550Type serviceType,
ServiceDescriptor.cs (53)
19/// <param name="serviceType">The <see cref="Type"/> of the service.</param> 20/// <param name="implementationType">The <see cref="Type"/> implementing the service.</param> 23Type serviceType, 24[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType, 33/// <param name="serviceType">The <see cref="Type"/> of the service.</param> 35/// <param name="implementationType">The <see cref="Type"/> implementing the service.</param> 38Type serviceType, 40[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType, 54/// <param name="serviceType">The <see cref="Type"/> of the service.</param> 57Type serviceType, 67/// <param name="serviceType">The <see cref="Type"/> of the service.</param> 71Type serviceType, 85/// <param name="serviceType">The <see cref="Type"/> of the service.</param> 89Type serviceType, 103/// <param name="serviceType">The <see cref="Type"/> of the service.</param> 108Type serviceType, 129private ServiceDescriptor(Type serviceType, object? serviceKey, ServiceLifetime lifetime) 147/// Gets the <see cref="Type"/> of the service. 149public Type ServiceType { get; } 152private Type? _implementationType; 155/// Gets the <see cref="Type"/> that implements the service, 162public Type? ImplementationType => IsKeyedService ? null : _implementationType; 165/// Gets the <see cref="Type"/> that implements the service, 172public Type? KeyedImplementationType 286internal Type GetImplementationType() 300Type[]? typeArguments = ImplementationFactory.GetType().GenericTypeArguments; 319Type[]? typeArguments = KeyedImplementationFactory.GetType().GenericTypeArguments; 371Type service, 372[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 390Type service, 392[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 483public static ServiceDescriptor Transient(Type service, Func<IServiceProvider, object> implementationFactory) 500public static ServiceDescriptor KeyedTransient(Type service, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory) 548Type service, 549[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 564Type service, 566[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 654public static ServiceDescriptor Scoped(Type service, Func<IServiceProvider, object> implementationFactory) 671public static ServiceDescriptor KeyedScoped(Type service, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory) 720Type service, 721[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 739Type service, 741[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 835Type serviceType, 854Type serviceType, 908Type serviceType, 927Type serviceType, 960Type serviceType, 961[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType, 978Type serviceType, 980[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType, 995public static ServiceDescriptor Describe(Type serviceType, Func<IServiceProvider, object> implementationFactory, ServiceLifetime lifetime) 1010public static ServiceDescriptor DescribeKeyed(Type serviceType, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory, ServiceLifetime lifetime)
ServiceProviderKeyedServiceExtensions.cs (4)
41public static object? GetKeyedService(this IServiceProvider provider, Type serviceType, object? serviceKey) 62public static object GetRequiredKeyedService(this IServiceProvider provider, Type serviceType, object? serviceKey) 112public static IEnumerable<object?> GetKeyedServices(this IServiceProvider provider, Type serviceType, object? serviceKey) 117Type? genericEnumerable = typeof(IEnumerable<>).MakeGenericType(serviceType);
ServiceProviderServiceExtensions.cs (3)
35public static object GetRequiredService(this IServiceProvider provider, Type serviceType) 88public static IEnumerable<object?> GetServices(this IServiceProvider provider, Type serviceType) 93Type? genericEnumerable = typeof(IEnumerable<>).MakeGenericType(serviceType);
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (2)
42static object? CreateValueType(Type t) => 52Type? underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
Microsoft.Extensions.DependencyInjection.AutoActivation (29)
AutoActivationExtensions.cs (13)
34var constructed = typeof(IEnumerable<TService>); 58public static IServiceCollection ActivateSingleton(this IServiceCollection services, Type serviceType) 68var constructed = GetEnumerableServiceType(serviceType); 84static Type GetEnumerableServiceType(Type serviceType) => typeof(IEnumerable<>).MakeGenericType(serviceType); 171[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType) 190[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType, 211Type serviceType, 212[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 230[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType) 246Type serviceType, 247[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 262public static void TryAddActivatedSingleton(this IServiceCollection services, Type serviceType, Func<IServiceProvider, object> implementationFactory)
AutoActivationExtensions.Keyed.cs (13)
33var constructed = typeof(IEnumerable<TService>); 60Type serviceType, 71var constructed = GetEnumerableServiceType(serviceType); 87static Type GetEnumerableServiceType(Type serviceType) => typeof(IEnumerable<>).MakeGenericType(serviceType); 181[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType, 202Type serviceType, 225Type serviceType, 227[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 246[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType, 264Type serviceType, 266[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType) 284Type serviceType,
AutoActivationHostedService.cs (1)
26foreach (var singleton in _options.AutoActivators)
AutoActivatorOptions.cs (2)
11public HashSet<Type> AutoActivators { get; } = []; 12public HashSet<(Type serviceType, object? serviceKey)> KeyedAutoActivators { get; } = [];
Microsoft.Extensions.Diagnostics.Abstractions (10)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (10)
15private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 44/// <param name="type">The <see cref="Type"/>.</param> 50public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 57private static string? ProcessType(ref StringBuilder? builder, Type type, in DisplayNameOptions options) 61Type[] genericArguments = type.GetGenericArguments(); 109private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 111Type innerType = type; 128private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (19)
ExceptionSummarizer.cs (6)
15private readonly FrozenDictionary<Type, IExceptionSummaryProvider> _exceptionTypesToProviders; 19var exceptionTypesToProvidersBuilder = new Dictionary<Type, IExceptionSummaryProvider>(); 22foreach (var exceptionType in exceptionSummaryProvider.SupportedExceptionTypes) 35var exceptionType = exception.GetType(); 39var type = exceptionType; 53var innerExceptionType = exception.InnerException.GetType();
HttpExceptionSummaryProvider.cs (1)
72public IEnumerable<Type> SupportedExceptionTypes { get; } = new[]
IExceptionSummaryProvider.cs (1)
34public IEnumerable<Type> SupportedExceptionTypes { get; }
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (3)
16/// Indicates that certain members on a specified <see cref="Type"/> are accessed dynamically, 23/// This attribute is valid on members whose type is <see cref="Type"/> or <see cref="string"/>. 29/// can be accessed dynamically on <see cref="Type"/> instances returned from calling
src\LegacySupport\TrimAttributes\DynamicDependencyAttribute.cs (8)
40/// with the specified signature of a member on a <see cref="System.Type"/>. 43/// <param name="type">The <see cref="System.Type"/> containing <paramref name="memberSignature"/>.</param> 44public DynamicDependencyAttribute(string memberSignature, Type type) 66/// with the specified types of members on a <see cref="System.Type"/>. 69/// <param name="type">The <see cref="System.Type"/> containing the specified members.</param> 70public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type) 110/// Gets the <see cref="System.Type"/> containing the specified member. 116public Type? Type { get; }
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (1)
ResourceMonitoringServiceTests.cs (1)
735var typ = typeof(ResourceMonitorService);
Microsoft.Extensions.Diagnostics.Testing (1)
Metrics\MetricCollector.cs (1)
24private static readonly HashSet<Type> _supportedTs =
Microsoft.Extensions.Features (13)
FeatureCollection.cs (10)
23private IDictionary<Type, object>? _features; 64public object? this[Type key] 87_features = new Dictionary<Type, object>(_initialCapacity); 100public IEnumerator<KeyValuePair<Type, object>> GetEnumerator() 146private sealed class KeyComparer : IEqualityComparer<KeyValuePair<Type, object>> 148public bool Equals(KeyValuePair<Type, object> x, KeyValuePair<Type, object> y) 153public int GetHashCode(KeyValuePair<Type, object> obj) 164public DictionaryItemDebugView<Type, object>[] Items => _features.Select(pair => new DictionaryItemDebugView<Type, object>(pair)).ToArray();
FeatureCollectionExtensions.cs (1)
36public static object GetRequiredFeature(this IFeatureCollection featureCollection, Type key)
IFeatureCollection.cs (2)
12public interface IFeatureCollection : IEnumerable<KeyValuePair<Type, object>> 29object? this[Type key] { get; set; }
Microsoft.Extensions.Http (36)
DefaultTypedHttpClientFactory.cs (1)
42return ActivatorUtilities.CreateFactory(typeof(TClient), new Type[] { typeof(HttpClient), });
DependencyInjection\HttpClientBuilderExtensions.cs (6)
347/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 408/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 468/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 514/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 755private static void ReserveClient(IHttpClientBuilder builder, Type type, string name, bool validateSingleType) 765if (registry.NamedClientRegistrations.TryGetValue(name, out Type? otherType) &&
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (16)
196/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 236/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 273/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 316/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 357/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 396/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 439/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 483/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 523/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 565/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 611/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 658/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 703/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 740/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 782/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing 819/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
DependencyInjection\HttpClientMappingRegistry.cs (1)
16public Dictionary<string, Type> NamedClientRegistrations { get; } = new();
ITypedHttpClientFactory.cs (2)
21/// should rarely be used directly in application code, use <see cref="IServiceProvider.GetService(Type)"/> instead 33/// <see cref="ActivatorUtilities.CreateInstance(IServiceProvider, Type, object[])" /> for details.
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (10)
15private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 44/// <param name="type">The <see cref="Type"/>.</param> 50public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 57private static string? ProcessType(ref StringBuilder? builder, Type type, in DisplayNameOptions options) 61Type[] genericArguments = type.GetGenericArguments(); 109private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 111Type innerType = type; 128private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Logging\Internal\TestLoggingHandler.cs (1)
22var handlerType = typeof(IHttpClientFactory).Assembly.GetType("Microsoft.Extensions.Http.Logging.HttpClientLoggerHandler");
Microsoft.Extensions.Http.Polly.Tests (3)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (3)
527public void AddPolicyRegistry_AddsOnlyMissingRegistrations(Type missingType) 532var policyTypes = new List<Type> 540foreach (var policyType in policyTypes.Where(x => x != missingType))
Microsoft.Extensions.Identity.Core (39)
IdentityBuilder.cs (19)
21/// <param name="user">The <see cref="Type"/> to use for the users.</param> 23public IdentityBuilder(Type user, IServiceCollection services) 37/// <param name="user">The <see cref="Type"/> to use for the users.</param> 38/// <param name="role">The <see cref="Type"/> to use for the roles.</param> 40public IdentityBuilder(Type user, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type role, IServiceCollection services) : this(user, services) 51/// Gets the <see cref="Type"/> used for users. 54/// The <see cref="Type"/> used for users. 56public Type UserType { get; } 59/// Gets the <see cref="Type"/> used for roles. 62/// The <see cref="Type"/> used for roles. 65public Type? RoleType { get; private set; } 75private IdentityBuilder AddScoped(Type serviceType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type concreteType) 144public virtual IdentityBuilder AddTokenProvider(string providerName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type provider) 176var userManagerType = typeof(UserManager<>).MakeGenericType(UserType); 177var customType = typeof(TUserManager); 262var managerType = typeof(RoleManager<>).MakeGenericType(RoleType); 263var customType = typeof(TRoleManager);
src\Shared\ThrowHelpers\ObjectDisposedThrowHelper.cs (2)
34public static void ThrowIf([DoesNotReturnIf(true)] bool condition, Type type) 54private static void ThrowObjectDisposedException(Type? type)
src\Shared\TrimmingAttributes.cs (11)
184/// with the specified signature of a member on a <see cref="System.Type"/>. 187/// <param name="type">The <see cref="System.Type"/> containing <paramref name="memberSignature"/>.</param> 188public DynamicDependencyAttribute(string memberSignature, Type type) 210/// with the specified types of members on a <see cref="System.Type"/>. 213/// <param name="type">The <see cref="System.Type"/> containing the specified members.</param> 214public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type) 254/// Gets the <see cref="System.Type"/> containing the specified member. 260public Type? Type { get; } 286/// Indicates that certain members on a specified <see cref="Type"/> are accessed dynamically, 293/// This attribute is valid on members whose type is <see cref="Type"/> or <see cref="string"/>. 299/// can be accessed dynamically on <see cref="Type"/> instances returned from calling
TokenProviderDescriptor.cs (6)
16private readonly Stack<Type> _providerTypes = new(1); 22public TokenProviderDescriptor(Type type) 30public Type ProviderType => _providerTypes.Peek(); 37internal void AddProviderType(Type type) => _providerTypes.Push(type); 39internal Type? GetProviderType<T>() 41foreach (var providerType in _providerTypes)
UserManager.cs (1)
110if (provider == null && description.GetProviderType<IUserTwoFactorTokenProvider<TUser>>() is Type providerType)
Microsoft.Extensions.Identity.Stores (1)
src\Shared\ThrowHelpers\ObjectDisposedThrowHelper.cs (1)
34public static void ThrowIf([DoesNotReturnIf(true)] bool condition, Type type)
Microsoft.Extensions.Localization (4)
ResourceManagerStringLocalizerFactory.cs (4)
118/// <see cref="Type.FullName"/> of the specified <see cref="Type"/>. 120/// <param name="resourceSource">The <see cref="Type"/>.</param> 122public IStringLocalizer Create(Type resourceSource)
Microsoft.Extensions.Localization.Abstractions (6)
IStringLocalizerFactory.cs (4)
15/// <see cref="Type.FullName"/> of the specified <see cref="Type"/>. 17/// <param name="resourceSource">The <see cref="Type"/>.</param> 19IStringLocalizer Create(Type resourceSource);
IStringLocalizerOfT.cs (1)
9/// <typeparam name="T">The <see cref="System.Type"/> to provide strings for.</typeparam>
StringLocalizerOfT.cs (1)
13/// <typeparam name="TResourceSource">The <see cref="Type"/> to provide strings for.</typeparam>
Microsoft.Extensions.Localization.Tests (6)
LocalizationServiceCollectionExtensionsTest.cs (2)
44Type serviceType, 45Type implementationType)
ResourceManagerStringLocalizerFactoryTest.cs (3)
79var type = typeof(ResourceManagerStringLocalizerFactoryTest); 146var type = typeof(Model); 175var type = typeof(Model);
ResourceManagerStringLocalizerTest.cs (1)
288public TestAssemblyWrapper(Type type)
Microsoft.Extensions.Logging (3)
LoggerInformation.cs (1)
86public Type ProviderType { get; }
LoggerRuleSelector.cs (1)
10public static void Select(LoggerFilterOptions options, Type providerType, string category, out LogLevel? minLevel, out Func<string?, string?, LogLevel, bool>? filter)
src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (1)
15internal static string? GetAlias(Type providerType)
Microsoft.Extensions.Logging.Abstractions (11)
LoggerFactoryExtensions.cs (1)
32public static ILogger CreateLogger(this ILoggerFactory factory, Type type)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (10)
15private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> 44/// <param name="type">The <see cref="Type"/>.</param> 50public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = DefaultNestedTypeDelimiter) 57private static string? ProcessType(ref StringBuilder? builder, Type type, in DisplayNameOptions options) 61Type[] genericArguments = type.GetGenericArguments(); 109private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options) 111Type innerType = type; 128private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
Microsoft.Extensions.Logging.AzureAppServices (2)
ConfigurationBasedLevelSwitcher.cs (2)
13private readonly Type _provider; 16public ConfigurationBasedLevelSwitcher(IConfiguration configuration, Type provider, string levelKey)
Microsoft.Extensions.Logging.Configuration (3)
ILoggerProviderConfigurationFactory.cs (1)
19IConfiguration GetConfiguration(Type providerType);
LoggerProviderConfigurationFactory.cs (1)
19public IConfiguration GetConfiguration(Type providerType)
src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (1)
15internal static string? GetAlias(Type providerType)
Microsoft.Extensions.Logging.Generators (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.Extensions.ObjectPool.DependencyInjection (1)
DependencyInjectionPooledObjectPolicy.cs (1)
21_factory = ActivatorUtilities.CreateFactory(typeof(TImplementation), Type.EmptyTypes);
Microsoft.Extensions.ObjectPool.Microbenchmark (7)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (6)
18public AspNetCoreBenchmarkAttribute(Type configType) 23public AspNetCoreBenchmarkAttribute(Type configType, Type validationConfigType) 25ConfigTypes = new Dictionary<string, Type>() 49if (!ConfigTypes.TryGetValue(ConfigName ?? NamedConfiguration.Default, out var configType)) 60public Dictionary<string, Type> ConfigTypes { get; }
src\Shared\BenchmarkRunner\ParameterizedJobConfigAttribute.cs (1)
11public ParameterizedJobConfigAttribute(Type configType) : base(configType)
Microsoft.Extensions.Options (19)
OptionsServiceCollectionExtensions.cs (11)
171private static IEnumerable<Type> FindConfigurationServices(Type type) 173foreach (Type t in GetInterfacesOnType(type)) 177Type gtd = t.GetGenericTypeDefinition(); 194static Type[] GetInterfacesOnType(Type t) 198private static void ThrowNoConfigServices(Type type) => 214[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type configureType) 219foreach (Type serviceType in FindConfigurationServices(configureType)) 244Type configureType = configureInstance.GetType(); 247foreach (Type serviceType in FindConfigurationServices(configureType))
OptionsValidationException.cs (2)
20public OptionsValidationException(string optionsName, Type optionsType, IEnumerable<string>? failureMessages) 38public Type OptionsType { get; }
StartupValidatorOptions.cs (2)
12public Dictionary<(Type, string), Action> _validators { get; } = new Dictionary<(Type, string), Action>();
ValidateEnumeratedItemsAttribute.cs (2)
35public ValidateEnumeratedItemsAttribute(Type validator) 43public Type? Validator { get; }
ValidateObjectMembersAttribute.cs (2)
34public ValidateObjectMembersAttribute(Type validator) 42public Type? Validator { get; }
Microsoft.Extensions.Options.SourceGeneration (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.Extensions.Resilience (11)
src\LegacySupport\TrimAttributes\DynamicallyAccessedMembersAttribute.cs (3)
16/// Indicates that certain members on a specified <see cref="Type"/> are accessed dynamically, 23/// This attribute is valid on members whose type is <see cref="Type"/> or <see cref="string"/>. 29/// can be accessed dynamically on <see cref="Type"/> instances returned from calling
src\LegacySupport\TrimAttributes\DynamicDependencyAttribute.cs (8)
40/// with the specified signature of a member on a <see cref="System.Type"/>. 43/// <param name="type">The <see cref="System.Type"/> containing <paramref name="memberSignature"/>.</param> 44public DynamicDependencyAttribute(string memberSignature, Type type) 66/// with the specified types of members on a <see cref="System.Type"/>. 69/// <param name="type">The <see cref="System.Type"/> containing the specified members.</param> 70public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type) 110/// Gets the <see cref="System.Type"/> containing the specified member. 116public Type? Type { get; }
Microsoft.Extensions.Telemetry (3)
Logging\Import\LoggerInformation.cs (1)
100public Type ProviderType { get; }
Logging\Import\LoggerRuleSelector.cs (1)
15public static void Select(LoggerFilterOptions options, Type providerType, string category, out LogLevel? minLevel, out Func<string?, string?, LogLevel, bool>? filter)
Logging\Import\ProviderAliasUtilities.cs (1)
18internal static string? GetAlias(Type providerType)
Microsoft.Extensions.Telemetry.Abstractions (13)
Logging\TagProviderAttribute.cs (3)
63public TagProviderAttribute(Type providerType, string providerMethod) 70/// Gets the <see cref="Type"/> containing the method that provides tags to be logged. 72public Type ProviderType { get; }
Metrics\CounterAttribute.cs (2)
48public CounterAttribute(Type type) 78public Type? Type { get; }
Metrics\CounterAttributeT.cs (2)
55public CounterAttribute(Type type) 84public Type? Type { get; }
Metrics\GaugeAttribute.cs (2)
48public GaugeAttribute(Type type) 77public Type? Type { get; }
Metrics\HistogramAttribute.cs (2)
48public HistogramAttribute(Type type) 77public Type? Type { get; }
Metrics\HistogramAttributeT.cs (2)
55public HistogramAttribute(Type type) 84public Type? Type { get; }
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
DiagDescriptorsTests.cs (1)
16var type = typeof(DiagDescriptors);
Microsoft.Gen.Logging (1)
src\Generators\Shared\RoslynExtensions.cs (1)
101public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\FormattableTestExtensions.cs (1)
42public readonly object ToType(Type conversionType, IFormatProvider? provider) => throw new NotSupportedException();
Microsoft.Gen.Logging.Unit.Tests (1)
DiagDescriptorsTests.cs (1)
17var type = typeof(DiagDescriptors);
Microsoft.Gen.Metrics (1)
src\Generators\Shared\RoslynExtensions.cs (1)
101public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.Gen.Metrics.Unit.Tests (1)
DiagDescriptorsTests.cs (1)
16var type = typeof(DiagDescriptors);
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.Interop.LibraryImportGenerator (4)
LibraryImportGenerator.cs (3)
394$"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}", 395$"{nameof(StringMarshalling)}{Type.Delimiter}{pinvokeData.StringMarshalling}"); 408$"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(InteropAttributeMember.StringMarshallingCustomType)}");
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.Interop.LibraryImportGenerator.Downlevel (3)
DownlevelLibraryImportGenerator.cs (2)
287$"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}", 288$"{nameof(StringMarshalling)}{Type.Delimiter}{pinvokeData.StringMarshalling}");
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.Interop.SourceGeneration (5)
GeneratorDiagnosticsBag.cs (2)
20private readonly Type _resourceSource; 32public GeneratorDiagnosticsBag(IDiagnosticDescriptorProvider descriptorProvider, ISignatureDiagnosticLocations locations, ResourceManager resourceManager, Type resourceSource)
MarshalAsParser.cs (2)
179_diagnostics.ReportConfigurationNotSupported(attributeData, $"{attributeData.AttributeClass!.Name}{Type.Delimiter}{namedArg.Key}"); 184_diagnostics.ReportConfigurationNotSupported(attributeData, $"{attributeData.AttributeClass!.Name}{Type.Delimiter}{namedArg.Key}");
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.JSInterop (46)
Infrastructure\ByteArrayJsonConverter.cs (1)
23public override byte[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Infrastructure\DotNetDispatcher.cs (23)
29private static readonly ConcurrentDictionary<AssemblyKey, IReadOnlyDictionary<string, (MethodInfo, Type[])>> _cachedMethodsByAssembly = new(); 31private static readonly ConcurrentDictionary<Type, IReadOnlyDictionary<string, (MethodInfo, Type[])>> _cachedMethodsByType = new(); 33private static readonly ConcurrentDictionary<Type, Func<object, Task>> _cachedConvertToTaskByType = new(); 163Type[] parameterTypes; 215internal static object?[] ParseArguments(JSRuntime jsRuntime, string methodIdentifier, string arguments, Type[] parameterTypes) 240var parameterType = parameterTypes[index]; 265static bool IsIncorrectDotNetObjectRefUse(Type parameterType, Utf8JsonReader jsonReader) 351private static (MethodInfo, Type[]) GetCachedMethodInfo(AssemblyKey assemblyKey, string methodIdentifier) 371private static Task GetTaskByType(Type type, object obj) 373var converterDelegate = _cachedConvertToTaskByType.GetOrAdd(type, (Type t, MethodInfo taskConverterMethodInfo) => 381private static (MethodInfo methodInfo, Type[] parameterTypes) GetCachedMethodInfo(IDotNetObjectReference objectReference, string methodIdentifier) 383var type = objectReference.Value.GetType(); 399static Dictionary<string, (MethodInfo, Type[])> ScanTypeForCallableMethods([DynamicallyAccessedMembers(JSInvokable)] Type type) 401var result = new Dictionary<string, (MethodInfo, Type[])>(StringComparer.Ordinal); 431private static Dictionary<string, (MethodInfo, Type[])> ScanAssemblyForCallableMethods(AssemblyKey assemblyKey) 435var result = new Dictionary<string, (MethodInfo, Type[])>(StringComparer.Ordinal); 437foreach (var type in exportedTypes) 464private static Type[] GetParameterTypes(MethodInfo method) 469return Type.EmptyTypes; 472var parameterTypes = new Type[parameters.Length]; 509public static void ClearCache(Type[]? _)
Infrastructure\DotNetObjectReferenceJsonConverter.cs (1)
22public override DotNetObjectReference<TValue> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Infrastructure\DotNetObjectReferenceJsonConverterFactory.cs (4)
19public override bool CanConvert(Type typeToConvert) 25public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) 28var instanceType = typeToConvert.GetGenericArguments()[0]; 29var converterType = typeof(DotNetObjectReferenceJsonConverter<>).MakeGenericType(instanceType);
Infrastructure\DotNetStreamReferenceJsonConverter.cs (1)
20public override DotNetStreamReference Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Infrastructure\JSObjectReferenceJsonConverter.cs (2)
19public override bool CanConvert(Type typeToConvert) 22public override IJSObjectReference? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Infrastructure\JSStreamReferenceJsonConverter.cs (2)
21public override bool CanConvert(Type typeToConvert) 24public override IJSStreamReference? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Infrastructure\TaskGenericsUtil.cs (11)
11private static readonly ConcurrentDictionary<Type, ITaskResultGetter> _cachedResultGetters 12= new ConcurrentDictionary<Type, ITaskResultGetter>(); 14private static readonly ConcurrentDictionary<Type, ITcsResultSetter> _cachedResultSetters 15= new ConcurrentDictionary<Type, ITcsResultSetter>(); 23public static Type GetTaskCompletionSourceResultType(object taskCompletionSource) 30var resultType = GetTaskResultType(taskInstanceType); 39private static Type? GetTaskResultType(Type taskType) 57Type ResultType { get; } 83public Type ResultType => typeof(T); 108var resultType = tcsType.GetGenericArguments()[0];
JSRuntime.cs (1)
245var resultType = TaskGenericsUtil.GetTaskCompletionSourceResultType(tcs);
Microsoft.JSInterop.WebAssembly (2)
WebAssemblyJSObjectReferenceJsonConverter.cs (2)
19public override bool CanConvert(Type typeToConvert) 26public override IJSObjectReference? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Microsoft.Maui (160)
Animations\Lerp.cs (6)
9 public static readonly Dictionary<Type, Lerp> Lerps = new Dictionary<Type, Lerp>() 174 public static Lerp? GetLerp(Type type) 180 var types = new List<Type> { type }; 181 Type? baseType = type?.BaseType; 188 foreach (var t in types)
Animations\LerpingAnimation.cs (1)
83 var type = StartValue?.GetType() ?? EndValue?.GetType();
Converters\CornerRadiusTypeConverter.cs (3)
10 public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 13 public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 72 public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
Converters\EasingTypeConverter.cs (3)
13 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 16 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 53 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Converters\FlexEnumsConverters.cs (21)
12 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 15 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 39 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 51 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 54 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 74 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 86 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 89 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 113 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 125 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 128 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 148 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 160 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 163 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 183 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 195 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 198 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 216 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 228 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 231 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 258 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Converters\KeyboardTypeConverter.cs (4)
12 public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 15 public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 28 var kbType = typeof(Keyboard); 44 public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
Converters\PrimitiveTypeConversions.cs (1)
10 internal static bool IsImplicitlyConvertibleToDouble(Type type)
Converters\ThicknessTypeConverter.cs (3)
13 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 18 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 93 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Core\IHybridWebView.cs (1)
40 Type? InvokeJavaScriptType { get; set; }
Handlers\ElementHandlerExtensions.cs (2)
36 public static T? GetService<T>(this IElementHandler handler, Type type) 54 public static T GetRequiredService<T>(this IElementHandler handler, Type type)
Handlers\HybridWebView\HybridWebViewHandler.cs (3)
174 var t = ((IHybridWebView)VirtualView).InvokeJavaScriptType; 183 var resultType = result.GetType(); 218 private static object? InvokeDotNetMethod([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type t, object jsInvokeTarget, JSInvokeMethodData invokeData)
Hosting\ImageSources\IImageSourceServiceProvider.cs (5)
12 IImageSourceService? GetImageSourceService(Type imageSource); 18 Type GetImageSourceServiceType(Type imageSource) => throw new NotImplementedException(); 22 Type GetImageSourceType(Type imageSource) => throw new NotImplementedException();
Hosting\ImageSources\ImageSourceServiceProvider.cs (21)
13 static readonly Type ImageSourceServiceType = typeof(IImageSourceService<>); 15 readonly ConcurrentDictionary<Type, Type> _imageSourceCache = new ConcurrentDictionary<Type, Type>(); 16 readonly ConcurrentDictionary<Type, Type> _serviceCache = new ConcurrentDictionary<Type, Type>(); 29 public IImageSourceService? GetImageSourceService(Type imageSource) 31 var imageSourceService = _serviceCache.GetOrAdd(imageSource, _imageSourceMapping.FindImageSourceServiceType); 39 public Type GetImageSourceServiceType(Type imageSource) 43 Type CreateImageSourceServiceTypeCacheEntry(Type type) 45 var genericConcreteType = ImageSourceServiceType.MakeGenericType(type); 57 public Type GetImageSourceType(Type imageSource) 61 Type CreateImageSourceTypeCacheEntry(Type type) 72 foreach (var directInterface in type.GetInterfaces())
Hosting\ImageSources\ImageSourceServiceProviderExtensions.cs (1)
22 public static IImageSourceService GetRequiredImageSourceService(this IImageSourceServiceProvider provider, Type imageSourceType)
Hosting\ImageSources\ImageSourceToImageSourceServiceTypeMapping.cs (13)
15 private readonly Dictionary<Type, Type> _concreteTypeMapping = new(); 16 private readonly Dictionary<Type, Type> _interfaceTypeMapping = new(); 32 public Type FindImageSourceServiceType(Type type) 36 if (_concreteTypeMapping.TryGetValue(type, out var exactImageSourceService) 47 private static Type? FindImageSourceServiceMapping(Type type, Dictionary<Type, Type> mapping) 49 Type? bestImageSource = null; 50 Type? bestImageSourceService = null;
Hosting\IMauiHandlersFactory.cs (3)
11 Type? GetHandlerType(Type iview); 13 IElementHandler? GetHandler(Type type);
Hosting\IMauiServiceCollection.cs (1)
9 bool TryGetService(Type serviceType, out ServiceDescriptor? descriptor);
Hosting\Internal\MauiFactory.cs (1)
28 public object? GetService(Type serviceType)
Hosting\Internal\MauiHandlersFactory.cs (9)
12 readonly ConcurrentDictionary<Type, Type> _serviceCache = new ConcurrentDictionary<Type, Type>(); 22 public IElementHandler? GetHandler(Type type) 29 public Type? GetHandlerType(Type iview) 38 private Type GetVirtualViewHandlerServiceType(Type type)
Hosting\Internal\MauiServiceCollection.cs (3)
12 readonly Dictionary<Type, ServiceDescriptor> _descriptorDictionary = new Dictionary<Type, ServiceDescriptor>(); 74 public bool TryGetService(Type serviceType, out ServiceDescriptor? descriptor) =>
Hosting\Internal\RegisteredHandlerServiceTypeSet.cs (10)
15 private readonly HashSet<Type> _concreteHandlerServiceTypeSet = new(); 16 private readonly HashSet<Type> _interfaceHandlerServiceTypeSet = new(); 18 public void Add(Type virtualViewType) 30 public Type ResolveVirtualViewToRegisteredHandlerServiceType(Type type) 45 private static Type? ResolveVirtualViewFromTypeSet(Type type, HashSet<Type> set) 47 Type? bestVirtualViewHandlerServiceType = null; 49 foreach (Type registeredViewHandlerServiceType in set)
Hosting\MauiHandlersCollectionExtensions.cs (5)
20 Type viewType, 21 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type handlerType) 78 Type viewType, 79 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type handlerType) 127 private static void RegisterHandlerServiceType(this IMauiHandlersCollection handlersCollection, Type virtualViewType)
HotReload\HotReloadExtensions.cs (2)
39 public static List<MethodInfo> GetOnHotReloadMethods(this Type type) 43 static IEnumerable<MethodInfo> getOnHotReloadMethods(Type type, bool isSubclass = false)
HotReload\HotReloadHelper.cs (18)
70 if (!replacedViews.TryGetValue(view.GetType().FullName!, out var newViewType)) 83 var viewType = view.GetType(); 84 if (!replacedViews.TryGetValue(viewType.FullName!, out var newViewType) || viewType == newViewType) 117 static Dictionary<string, Type> replacedViews = new(StringComparer.Ordinal); 119 static Dictionary<string, List<KeyValuePair<Type, Type>>> replacedHandlers = new(StringComparer.Ordinal); 125 public static void RegisterReplacedView(string oldViewType, Type newViewType) 165 var t = assemblies.Select(x => x.GetType(oldViewType)).FirstOrDefault(x => x != null); 167 var views = HandlerService!.Where(x => x.ImplementationType == t).Select(x => new KeyValuePair<Type, Type>(x.ServiceType, x.ImplementationType!)).ToList(); 177 static void RegisterHandler(KeyValuePair<Type, Type> pair, Type newHandler) 180 var view = pair.Key; 181 var newType = newHandler; 213 public static void UpdateApplication(Type[] types) 216 foreach (var t in types) 219 public static void ClearCache(Type[] types) => TriggerReload();
MauiContext.cs (5)
55 readonly ConcurrentDictionary<Type, (object, Func<object, object?>)> _scopeStatic = new(); 64 public object? GetService(Type serviceType) 75 public void AddSpecific(Type type, Func<object, object?> getter, object state) 88 public object? GetKeyedService(Type serviceType, object? serviceKey) 97 public object GetRequiredKeyedService(Type serviceType, object? serviceKey)
Platform\ElementExtensions.cs (5)
35 static HashSet<Type> handlersWithConstructors = new HashSet<Type>(); 37 static IElementHandler? CreateTypeWithInjection(this Type viewType, IMauiContext mauiContext) 39 var handlerType = mauiContext.Handlers.GetHandlerType(viewType); 75 var viewType = view.GetType();
Platform\ReflectionExtensions.cs (2)
10 internal static object[]? GetCustomAttributesSafe(this Assembly assembly, Type attrType) 25 public static bool IsInstanceOfType(this Type self, object o)
Primitives\GridLength.cs (3)
95 public override bool CanConvertFrom(ITypeDescriptorContext? context, Type? sourceType) 105 public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) => false; 106 public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type? destinationType) => throw new NotSupportedException();
Primitives\SizeRequest.cs (3)
57 public override bool CanConvertFrom(ITypeDescriptorContext? context, Type? sourceType) 66 public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 68 public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type? destinationType)
VisualDiagnostics\BootstrapHelper.cs (2)
35 MethodInfo loadFrom = typeof(Assembly).GetMethod("LoadFrom", new Type[] { typeof(string) }); 44 Type type = assembly?.GetType(typeName);
Microsoft.Maui.Controls (404)
AcceleratorTypeConverter.cs (3)
19 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 22 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 35 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
BindableProperty.cs (27)
43 internal static readonly Dictionary<Type, TypeConverter> KnownTypeConverters = new Dictionary<Type, TypeConverter> 51 internal static readonly Dictionary<Type, IValueConverter> KnownIValueConverters = new Dictionary<Type, IValueConverter> 58 internal static readonly Dictionary<Type, Type[]> SimpleConvertTypes = new Dictionary<Type, Type[]> 77 BindableProperty(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue, BindingMode defaultBindingMode = BindingMode.OneWay, 117 public Type DeclaringType { get; private set; } 133 public Type ReturnType { get; } 148 public static BindableProperty Create(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue = null, BindingMode defaultBindingMode = BindingMode.OneWay, 157 public static BindableProperty CreateAttached(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue, BindingMode defaultBindingMode = BindingMode.OneWay, 165 public static BindablePropertyKey CreateAttachedReadOnly(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue, BindingMode defaultBindingMode = BindingMode.OneWayToSource, 175 public static BindablePropertyKey CreateReadOnly(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue, BindingMode defaultBindingMode = BindingMode.OneWayToSource, 184 internal static BindableProperty Create(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue, BindingMode defaultBindingMode, ValidateValueDelegate validateValue, 192 internal static BindableProperty CreateAttached(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue, BindingMode defaultBindingMode, ValidateValueDelegate validateValue, 210 Type returnType = ReturnType; 215 Type valueType = value.GetType(); 222 if (SimpleConvertTypes.TryGetValue(valueType, out Type[] convertibleTo) && Array.IndexOf(convertibleTo, returnType) != -1)
BindablePropertyConverter.cs (10)
18 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 21 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 36 Type type = null; 93 Type type = GetControlType(parts[0]); 97 BindableProperty ConvertFrom(Type type, string propertyName, IXmlLineInfo lineinfo) 118 static Type GetControlType(string typeName) 119 => Type.GetType("Microsoft.Maui.Controls." + typeName); 124 static FieldInfo GetPropertyField(Type type, string fieldName) 127 Type FindTypeForVisualState(IProvideParentValues parentValueProvider, IXmlLineInfo lineInfo) 162 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Binding.cs (3)
109 internal Type DataType { get; set; } 180 internal override object GetSourceValue(object value, Type targetPropertyType) 188 internal override object GetTargetValue(object value, Type sourcePropertyType)
BindingBase.cs (2)
136 internal virtual object GetSourceValue(object value, Type targetPropertyType) 177 internal virtual object GetTargetValue(object value, Type sourcePropertyType) => value;
BindingExpression.cs (6)
68 if (Binding is Binding { Source: var source, DataType: Type dataType }) 307 if (sourceType.BaseType is Type baseT && GetIndexer(baseT.GetTypeInfo(), indexerName, content) is PropertyInfo p) 311 foreach (var face in sourceType.ImplementedInterfaces) 392 var propertyType = property.PropertyType; 422 Type genericTypeDefinition = propertyType.GetGenericTypeDefinition(); 685 public Type SetterType { get; set; }
BindingExpressionHelper.cs (2)
10 static readonly Type[] DecimalTypes = { typeof(float), typeof(decimal), typeof(double) }; 12 internal static bool TryConvert(ref object value, BindableProperty targetProperty, Type convertTo, bool toTarget)
Brush\BrushTypeConverter.cs (3)
32 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 37 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 84 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Button\Button.cs (3)
572 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 575 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 607 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
ColumnDefinitionCollectionTypeConverter.cs (3)
14 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 17 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 38 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Command.cs (1)
50 var t = typeof(T);
CompareStateTrigger.cs (1)
82 object ConvertToEnum(Type enumType, object value)
Compatibility\Handlers\ListView\iOS\ListViewRenderer.cs (3)
469 var rendererType = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : _footerRenderer.GetType(); 508 var rendererType = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : _headerRenderer.GetType(); 1390 protected Type GetItemTypeForPath(NSIndexPath indexPath)
Compatibility\Handlers\ListView\iOS\ViewCellRenderer.cs (2)
207 var viewHandlerType = MauiContext.Handlers.GetHandlerType(cell.View.GetType()); 209 var rendererType = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : (renderer != null ? renderer.GetType() : typeof(System.Object));
Compatibility\Handlers\Shell\iOS\ShellSectionRenderer.cs (2)
92 public ShellSectionRenderer(IShellContext context, Type navigationBarType, Type toolbarType)
Compatibility\Handlers\Shell\iOS\ShellSectionRootHeader.cs (1)
205 protected virtual Type GetCellType()
Compatibility\iOS\FontNamedSizeService.cs (1)
26 public double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes)
ContentConverter.cs (3)
10 public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 27 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 110 static bool HasTemplateAncestor(ContentPresenter presenter, Type type)
ControlTemplate.cs (1)
17 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type)
DataTemplate.cs (1)
26 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type)
DataTemplateSelector.cs (2)
10 Dictionary<Type, DataTemplate> _dataTemplates = new Dictionary<Type, DataTemplate>();
DecorableTextElement.cs (3)
17 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 20 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 49 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
DependencyAttribute.cs (2)
13 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type implementorType) 19 internal Type Implementor { get; private set; }
DependencyResolver.cs (8)
12 static Type _defaultVisualType = typeof(VisualMarker.DefaultVisual); 13 static Func<Type, object[], object> Resolver { get; set; } 16 public static void ResolveUsing(Func<Type, object[], object> resolver) 22 public static void ResolveUsing(Func<Type, object> resolver) 27 internal static object Resolve(Type type, params object[] args) 43 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type) 47 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type, 49 Type visualType,
DependencyService.cs (14)
20 static readonly Dictionary<Type, DependencyData> DependencyImplementations = new Dictionary<Type, DependencyData>(); 36 Type targetType = typeof(T); 39 Type implementor = FindImplementor(targetType); 66 Type type = typeof(T); 72 Type targetType = typeof(T); 73 Type implementorType = typeof(TImpl); 82 Type targetType = typeof(T); 83 Type implementorType = typeof(T); 91 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type type) 98 static Type FindImplementor(Type target) => 171 public Type ImplementorType { get; set; } 177 public Type Type { get; set; }
Device.cs (2)
127 public static double GetNamedSize(NamedSize size, Type targetElementType) 146 public static double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes) =>
DoubleCollectionConverter.cs (3)
12 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 17 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 47 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Element\Element_StyleSheets.cs (1)
30 var t = GetType();
ElementTemplate.cs (3)
17 readonly Type _type; 24 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type) 49 internal Type Type => _type;
ExportEffectAttribute.cs (2)
15 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type effectType, 27 internal Type Type { get; private set; }
FileImageSourceConverter.cs (3)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 26 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
FlowDirectionConverter.cs (3)
10 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 13 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 35 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
FontAttributes.cs (3)
24 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 27 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 66 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
FontSizeConverter.cs (4)
13 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 16 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 57 var type = serviceProvider.GetService(typeof(IProvideValueTarget)) is IProvideValueTarget valueTargetProvider ? valueTargetProvider.TargetObject.GetType() : typeof(Label); 103 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
FormattedString.cs (3)
94 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 97 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 110 public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
GridLengthTypeConverter.cs (3)
12 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 15 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 38 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
HandlerAttribute.cs (8)
12 protected HandlerAttribute(Type handler, [DynamicallyAccessedMembers(Internals.HandlerType.TargetMembers)] Type target) : this(handler, target, null) 16 protected HandlerAttribute(Type handler, [DynamicallyAccessedMembers(Internals.HandlerType.TargetMembers)] Type target, Type[] supportedVisuals) 27 internal Type[] SupportedVisuals { get; private set; } 28 internal Type HandlerType { get; private set; } 31 internal Type TargetType { get; private set; }
Handlers\Items\iOS\ItemsViewController.cs (1)
463 var cellType = ItemsViewLayout.ScrollDirection == UICollectionViewScrollDirection.Vertical ? typeof(VerticalCell) : typeof(HorizontalCell);
Handlers\Items2\iOS\ItemsViewController2.cs (1)
291 var cellType = typeof(TemplatedCell2);
Hosting\Effects\AppHostBuilderExtensions.cs (5)
72 internal Dictionary<Type, Func<PlatformEffect>> RegisteredEffects { get; } = new Dictionary<Type, Func<PlatformEffect>>(); 89 Type TEffect, 90 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type TPlatformEffect) 103 private readonly Dictionary<Type, Func<PlatformEffect>> _registeredEffects;
Hosting\Effects\IEffectsBuilder.cs (2)
14 IEffectsBuilder Add(Type TEffect, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type TPlatformEffect);
HybridWebView\HybridWebView.cs (2)
42 Type? _invokeJavaScriptType; 46 Type? IHybridWebView.InvokeJavaScriptType
IFontNamedSizeService.cs (1)
9 double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes);
ImageSource.cs (1)
75 public static ImageSource FromResource(string resource, Type resolvingType)
ImageSourceConverter.cs (3)
13 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 16 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 34 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
IMarkupExtension.cs (2)
25 public RequireServiceAttribute(Type[] serviceTypes) 29 public Type[] ServiceTypes { get; }
IMultiValueConverter.cs (2)
22 object Convert(object[] values, Type targetType, object parameter, CultureInfo culture); 24 object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture);
INativeValueConverterService.cs (1)
8 bool ConvertTo(object value, Type toType, out object platformValue);
Interactivity\Behavior.cs (2)
19 internal Behavior(Type associatedType) => AssociatedType = associatedType ?? throw new ArgumentNullException(nameof(associatedType)); 24 protected Type AssociatedType { get; }
Interactivity\DataTrigger.cs (1)
15 public DataTrigger([System.ComponentModel.TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType) : base(new BindingCondition(), targetType)
Interactivity\MultiTrigger.cs (1)
12 public MultiTrigger([System.ComponentModel.TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType) : base(new MultiCondition(), targetType)
Interactivity\Trigger.cs (1)
15 public Trigger([System.ComponentModel.TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType) : base(new PropertyCondition(), targetType)
Interactivity\TriggerAction.cs (2)
8 internal TriggerAction(Type associatedType) 15 protected Type AssociatedType { get; private set; }
Interactivity\TriggerBase.cs (3)
13 internal TriggerBase(Type targetType) 21 internal TriggerBase(Condition condition, Type targetType) : this(targetType) 50 public Type TargetType { get; }
IStyle.cs (1)
8 Type TargetType { get; }
Items\CarouselLayoutTypeConverter.cs (3)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 30 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Items\ItemsLayoutTypeConverter.cs (3)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 56 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
IValueConverter.cs (2)
9 object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture); 10 object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture);
IValueConverterProvider.cs (1)
11 object Convert(object value, Type toType, Func<MemberInfo> minfoRetriever, IServiceProvider serviceProvider);
IWrappedValue.cs (1)
9 Type ValueType { get; }
IXamlTypeResolver.cs (2)
8 Type Resolve(string qualifiedTypeName, IServiceProvider serviceProvider = null); 9 bool TryResolve(string qualifiedTypeName, out Type type);
Layout\BoundsTypeConverter.cs (3)
13 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 16 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 56 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
LayoutOptionsConverter.cs (3)
15 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 18 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 60 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
LegacyLayouts\ConstraintTypeConverter.cs (3)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 28 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
ListStringTypeConverter.cs (3)
14 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 17 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 29 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
MergedStyle.cs (5)
15 static readonly IList<Type> s_stopAtTypes = new List<Type> { typeof(View), 33 public MergedStyle(Type targetType, BindableObject target) 117 public Type TargetType { get; } 156 Type type = TargetType;
MessagingCenter.cs (10)
31 class Sender : Tuple<string, Type, Type> 33 public Sender(string message, Type senderType, Type argType) : base(message, senderType, argType) 200 void InnerSend(string message, Type senderType, Type argType, object sender, object args) 226 void InnerSubscribe(object subscriber, string message, Type senderType, Type argType, object target, MethodInfo methodInfo, Filter filter) 243 void InnerUnsubscribe(string message, Type senderType, Type argType, object subscriber)
MultiBinding.cs (3)
198 internal override object GetSourceValue(object value, Type targetPropertyType) 213 internal override object GetTargetValue(object value, Type sourcePropertyType) 218 var types = new Type[_bpProxies.Length];
OnIdiom.cs (1)
92 System.Type IWrappedValue.ValueType => typeof(T);
OnPlatform.cs (1)
59 System.Type IWrappedValue.ValueType => typeof(T);
PlatformBindingHelpers.cs (2)
45 var propertyType = targetPropertyInfo?.PropertyType; 63 static BindableProperty CreateBindableProperty(string targetProperty, Type propertyType = null, object defaultValue = null)
PlatformConfigurationRegistry.cs (2)
12 readonly Dictionary<Type, object> _platformSpecifics = new Dictionary<Type, object>();
RadioButton\RadioButton.cs (2)
693 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 701 public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
ReferenceTypeConverter.cs (3)
17 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 20 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 49 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Registrar.cs (53)
30 public readonly Type Target; 34 [DynamicallyAccessedMembers(TargetMembers)] Type target, 45 readonly Dictionary<Type, Dictionary<Type, HandlerType>> _handlers = new Dictionary<Type, Dictionary<Type, HandlerType>>(); 46 static Type _defaultVisualType = typeof(VisualMarker.DefaultVisual); 49 static Type[] _defaultVisualRenderers = new[] { _defaultVisualType }; 52 Type tview, 53 [DynamicallyAccessedMembers(HandlerType.TargetMembers)] Type trender, 54 Type[] supportedVisuals, 62 if (!_handlers.TryGetValue(tview, out Dictionary<Type, HandlerType> visualRenderers)) 64 visualRenderers = new Dictionary<Type, HandlerType>(); 96 public void Register(Type tview, [DynamicallyAccessedMembers(HandlerType.TargetMembers)] Type trender, Type[] supportedVisual) 99 public void Register(Type tview, [DynamicallyAccessedMembers(HandlerType.TargetMembers)] Type trender) 102 internal TRegistrable GetHandler(Type type) => GetHandler(type, _defaultVisualType); 104 internal TRegistrable GetHandler(Type type, Type visualType) 106 Type handlerType = GetHandlerType(type, visualType ?? _defaultVisualType); 117 internal TRegistrable GetHandler(Type type, object source, IVisual visual, params object[] args) 126 Type handlerType = GetHandlerType(type, visual?.GetType() ?? _defaultVisualType); 136 public TOut GetHandler<TOut>(Type type) where TOut : class, TRegistrable 141 public TOut GetHandler<TOut>(Type type, params object[] args) where TOut : class, TRegistrable 152 var type = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : obj.GetType(); 163 var type = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : obj.GetType(); 168 public Type GetHandlerType(Type viewType) => GetHandlerType(viewType, _defaultVisualType); 171 public Type GetHandlerType(Type viewType, Type visualType) 176 if (_handlers.TryGetValue(viewType, out Dictionary<Type, HandlerType> visualRenderers)) 196 public Type GetHandlerTypeForObject(object obj) 202 var type = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : obj.GetType(); 207 bool LookupHandlerType(Type viewType, Type visualType, out HandlerType handlerType) 212 if (_handlers.TryGetValue(viewType, out Dictionary<Type, HandlerType> visualRenderers)) 227 void RegisterRenderWithTypes(Type viewType, Type visualType) 239 if (!_handlers.TryGetValue(viewType, out Dictionary<Type, HandlerType> visualRenderers) || 252 Type specificTypeRenderer = attribute.Type; 303 public readonly Type Type; 306 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type) 412 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type effectType) 420 public static void RegisterAll(Type[] attrTypes, IFontRegistrar fontRegistrar = null) 429 public static void RegisterAll(Type[] attrTypes, InitializationFlags flags, IFontRegistrar fontRegistrar = null) 444 Type[] attrTypes, 446 Action<(Type handler, Type target)> viewRegistered, 475 foreach (Type attrType in attrTypes) 515 internal static void CheckIfRendererIsCompatibilityRenderer(Type rendererType)
RelativeBindingSource.cs (2)
18 Type ancestorType = null, 43 public Type AncestorType
RenderWithAttribute.cs (5)
12 public RenderWithAttribute([DynamicallyAccessedMembers(Internals.HandlerType.TargetMembers)] Type type) : this(type, new[] { typeof(VisualMarker.DefaultVisual) }) 18 [DynamicallyAccessedMembers(Internals.HandlerType.TargetMembers)] Type type, 19 Type[] supportedVisuals) 26 public Type[] SupportedVisuals { get; } 30 public Type Type { get; }
ResourceDictionary.cs (8)
22 static ConditionalWeakTable<Type, ResourceDictionary> s_instances = new ConditionalWeakTable<Type, ResourceDictionary>(); 67 internal static ResourceDictionary GetOrCreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type type) 393 internal static void ClearCache() => s_instances = new ConditionalWeakTable<Type, ResourceDictionary>(); 398 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 401 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 412 var rootObjectType = (serviceProvider.GetService(typeof(Xaml.IRootObjectProvider)) as Xaml.IRootObjectProvider)?.RootObject.GetType(); 456 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Routing.cs (3)
227 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type) 262 readonly Type _type; 265 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type)
RowDefinitionCollectionTypeConverter.cs (3)
14 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 17 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 37 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Shapes\MatrixTypeConverter.cs (3)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 39 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Shapes\PathFigureCollectionConverter.cs (3)
15 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 18 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 677 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Shapes\PathGeometryConverter.cs (3)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 27 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Shapes\PointCollectionConverter.cs (3)
14 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 17 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 61 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Shapes\StrokeShapeTypeConverter.cs (1)
24 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Shapes\TransformTypeConverter.cs (3)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 23 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Shell\ShellContent.cs (4)
377 var type = content.GetType(); 430 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 433 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 446 public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
Shell\ShellItem.cs (3)
349 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 355 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 368 public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
Shell\ShellNavigationState.cs (3)
106 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) => false; 107 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cultureInfo, object value, Type destinationType) => throw new NotSupportedException(); 109 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Shell\ShellSection.cs (3)
1249 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) => false; 1250 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cultureInfo, object value, Type destinationType) => throw new NotSupportedException(); 1252 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Style.cs (3)
30 public Style([System.ComponentModel.TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType) 111 public Type TargetType { get; } 123 internal bool CanBeAppliedTo(Type targetType)
StyleSheets\StylePropertyAttribute.cs (3)
13 public Type TargetType { get; } 15 public Type PropertyOwnerType { get; set; } 23 Type targetType,
StyleSheets\StyleSheet.cs (1)
95 Type IStyle.TargetType => typeof(VisualElement);
StyleSheets\StyleSheetServiceProvider.cs (1)
21 public object GetService(Type serviceType)
TemplateBinding.cs (2)
110 internal override object GetSourceValue(object value, Type targetPropertyType) 118 internal override object GetTargetValue(object value, Type sourcePropertyType)
TextAlignment.cs (3)
10 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 13 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 44 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
ToStringValueConverter.cs (2)
9 public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 20 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotSupportedException();
TypeConversionHelper.cs (12)
15 internal static bool TryConvert(object value, Type targetType, out object? convertedValue) 17 Type valueType = value.GetType(); 72 private static bool TryGetTypeConverter(Type type, [NotNullWhen(true)] out TypeConverter? converter) 75 private static bool ShouldCheckForImplicitConversionOperator(Type type) => 81 private static bool TryConvertUsingImplicitCastOperator(object value, Type targetType, [NotNullWhen(true)] out object? result) 83 Type valueType = value.GetType(); 99 static MethodInfo? GetImplicitConversionOperator(Type onType, Type fromType, Type toType) 148 static bool HasSuitableParameterType(MethodInfo method, Type fromType) 153 static bool HasSuitableReturnType(MethodInfo method, Type toType) 157 private static void WarnIfImplicitOperatorIsAvailable(object value, Type targetType)
TypedBinding.cs (2)
251 internal override object GetSourceValue(object value, Type targetPropertyType) 259 internal override object GetTargetValue(object value, Type sourcePropertyType)
TypeTypeConverter.cs (3)
13 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 16 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 32 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
UriTypeConverter.cs (3)
12 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 15 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 26 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
VisualElement\VisualElement.cs (3)
2381 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 2384 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 2408 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
VisualElement\VisualElement_StyleSheet.cs (1)
39 var propertyOwnerType = styleAttribute.PropertyOwnerType ?? GetType();
Visuals\VisualAttribute.cs (2)
14 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type visual) 23 internal Type Visual { get; }
Visuals\VisualTypeConverter.cs (6)
19 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 22 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 80 foreach (var type in assembly.GetExportedTypes()) 115 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type visual, 138 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type visualType) 176 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
VisualStateManager.cs (2)
389 public Type TargetType { get; set; } 617 public Type TargetType { get; set; }
WebView\WebViewSource.cs (3)
37 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) => false; 38 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cultureInfo, object value, Type destinationType) => throw new NotSupportedException(); 40 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
WebView\WebViewSourceTypeConverter.cs (3)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 26 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Xaml\TypeConversionExtensions.cs (9)
45 internal static object ConvertTo(this object value, Type toType, Func<ParameterInfo> pinfoRetriever, 53 var convertertype = pInfo.GetCustomAttribute<TypeConverterAttribute>()?.GetConverterType(); 62 internal static object ConvertTo(this object value, Type toType, Func<MemberInfo> minfoRetriever, 91 if (memberInfo.GetCustomAttribute<TypeConverterAttribute>()?.GetConverterType() is Type converterType) 104 static Type GetConverterType(this TypeConverterAttribute attribute) 105 => Type.GetType(attribute.ConverterTypeName); 110 Type toType, 111 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type convertertype, 130 internal static object ConvertTo(this object value, Type toType, Func<TypeConverter> getConverter,
Xaml\ValueConverterProvider.cs (1)
13 public object Convert(object value, Type toType, Func<MemberInfo> minfoRetriever, IServiceProvider serviceProvider)
Xaml\XamlResourceIdAttribute.cs (6)
19 public Type Type { get; set; } 25 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type type) 32 internal static string GetResourceIdForType(Type type) 43 internal static string GetPathForType(Type type) 65 internal static Type GetTypeForResourceId(Assembly assembly, string resourceId) 76 internal static Type GetTypeForPath(Assembly assembly, string path)
Microsoft.Maui.Controls.Build.Tasks (11)
CompiledConverters\TypeTypeConverter.cs (1)
44 throw new BuildException(BuildExceptionCode.Conversion, node, null, value, typeof(Type));
CreateObjectVisitor.cs (2)
101 Type compiledMarkupExtensionType; 104 (compiledMarkupExtensionType = Type.GetType(compiledMarkupExtensionName)) != null &&
NodeILExtensions.cs (2)
157 Type compiledConverterType; 159 && (compiledConverterType = Type.GetType(compiledConverterName)) != null
SetPropertiesVisitor.cs (4)
351 Type compiledValueProviderType; 355 && (compiledValueProviderType = Type.GetType(compiledValueProviderName)) != null 394 Type compiledValueProviderType; 395 if (compiledValueProviderName != null && (compiledValueProviderType = Type.GetType(compiledValueProviderName)) != null)
XamlCache.cs (2)
21 Dictionary<TypeReference, Type> _knownCompiledTypeConverters; 56 public Dictionary<TypeReference, Type> GetKnownCompiledTypeConverters(ModuleDefinition module) => _knownCompiledTypeConverters ??= new(TypeRefComparer.Default)
Microsoft.Maui.Controls.Compatibility (27)
ExportRendererAttribute.cs (9)
9 public ExportRendererAttribute(Type handler, [DynamicallyAccessedMembers(Internals.HandlerType.TargetMembers)] Type target) : this(handler, target, null) 13 public ExportRendererAttribute(Type handler, [DynamicallyAccessedMembers(Internals.HandlerType.TargetMembers)] Type target, Type[] supportedVisuals) : base(handler, target, supportedVisuals) 21 public ExportCellAttribute(Type handler, [DynamicallyAccessedMembers(Internals.HandlerType.TargetMembers)] Type target) : base(handler, target) 29 public ExportImageSourceHandlerAttribute(Type handler, [DynamicallyAccessedMembers(Internals.HandlerType.TargetMembers)] Type target) : base(handler, target)
iOS\Cells\ViewCellRenderer.cs (2)
199 var type = Microsoft.Maui.Controls.Internals.Registrar.Registered.GetHandlerTypeForObject(this._viewCell.View); 201 var rendererType = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : renderer.GetType();
iOS\Forms.cs (1)
192 Type _targetType;
iOS\NativeValueConverterService.cs (1)
21 public bool ConvertTo(object value, Type toType, out object nativeValue)
iOS\RendererPool.cs (5)
14 readonly Dictionary<Type, Stack<IVisualElementRenderer>> _freeRenderers = 15 new Dictionary<Type, Stack<IVisualElementRenderer>>(); 38 var rendererType = Controls.Internals.Registrar.Registered.GetHandlerTypeForObject(view) ?? typeof(ViewRenderer); 64 var oldChildType = (oldNativeChildren[i] as IVisualElementRenderer)?.Element?.GetType(); 132 var rendererType = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : renderer.GetType();
iOS\Renderers\ListViewRenderer.cs (3)
481 var rendererType = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : _footerRenderer.GetType(); 526 var rendererType = reflectableType != null ? reflectableType.GetTypeInfo().AsType() : _headerRenderer.GetType(); 1378 protected Type GetItemTypeForPath(NSIndexPath indexPath)
MauiHandlersCollectionExtensions.cs (4)
10 public static IMauiHandlersCollection TryAddCompatibilityRenderer(this IMauiHandlersCollection handlersCollection, Type controlType, [DynamicallyAccessedMembers(Internals.HandlerType.TargetMembers)] Type rendererType) 25 public static IMauiHandlersCollection AddCompatibilityRenderer(this IMauiHandlersCollection handlersCollection, Type controlType, [DynamicallyAccessedMembers(Internals.HandlerType.TargetMembers)] Type rendererType)
src\Core\src\VisualDiagnostics\BootstrapHelper.cs (2)
35 MethodInfo loadFrom = typeof(Assembly).GetMethod("LoadFrom", new Type[] { typeof(string) }); 44 Type type = assembly?.GetType(typeName);
Microsoft.Maui.Controls.DesignTools (3)
GridLengthCollectionDesignTypeConverter.cs (1)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
GridLengthDesignTypeConverter.cs (1)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
KnownValuesDesignTypeConverter.cs (1)
15 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Microsoft.Maui.Controls.Xaml (72)
ApplyPropertiesVisitor.cs (17)
47 public bool IsResourceDictionary(ElementNode node) => Context.Types.TryGetValue(node, out var type) && typeof(ResourceDictionary).IsAssignableFrom(type); 245 internal static string GetContentPropertyName(Type type) 299 static bool GetRealNameAndType(ref Type elementType, string namespaceURI, ref string localname, 318 static BindableProperty GetBindableProperty(Type elementType, string localName, IXmlLineInfo lineInfo) 334 var bpOwnerType = xamlelement.GetType(); 341 var elementType = xamlelement.GetType(); 383 var bpOwnerType = element.GetType(); 438 var bpOwnerType = xamlElement.GetType(); 462 var elementType = element.GetType(); 473 var rootElementType = rootElement.GetType(); 525 var elementType = element.GetType(); 546 var elementType = element.GetType(); 578 var elementType = element.GetType(); 642 var elementType = element.GetType(); 659 var elementType = element.GetType(); 691 var elementType = element.GetType(); 825 static IEnumerable<MethodInfo> GetAllRuntimeMethods(Type type)
CreateValuesVisitor.cs (7)
51 var type = XamlParser.GetElementType(node.XmlType, node, Context.RootElement?.GetType().Assembly, 202 bool ValidateCtorArguments(Type nodeType, IElementNode node, out string missingArgName) 229 public object CreateFromParameterizedConstructor(Type nodeType, IElementNode node) 241 public object CreateFromFactory(Type nodeType, IElementNode node) 252 Type[] types = arguments == null ? Array.Empty<Type>() : arguments.Select(a => a.GetType()).ToArray(); 335 static object CreateLanguagePrimitive(Type nodeType, IElementNode node)
FillResourceDictionariesVisitor.cs (3)
30 if (!Context.Types.TryGetValue((IElementNode)parentNode, out var type) || !typeof(ResourceDictionary).IsAssignableFrom(type)) 59 && Context.Types.TryGetValue((IElementNode)parentNode, out var parentType) 82 && Context.Types.TryGetValue((IElementNode)parentNode, out var parentType)
HydrationContext.cs (2)
12 Types = new Dictionary<IElementNode, Type>(); 16 public Dictionary<IElementNode, Type> Types { get; }
MarkupExtensionParser.cs (2)
39 Type type; 70 var t = markupExtension.GetType();
MarkupExtensions\AppThemeBindingExtension.cs (1)
62 Type propertyType = null;
MarkupExtensions\ArrayExtension.cs (1)
22 public Type Type { get; set; }
MarkupExtensions\BindingExtension.cs (1)
45 Type bindingXDataType = null;
MarkupExtensions\DataTemplateExtension.cs (1)
25 if (typeResolver.TryResolve(TypeName, out var type))
MarkupExtensions\OnIdiomExtension.cs (1)
47 Type propertyType = null;
MarkupExtensions\OnPlatformExtension.cs (1)
59 Type propertyType = null;
MarkupExtensions\RelativeSourceExtension.cs (1)
22 public Type AncestorType
MarkupExtensions\StaticExtension.cs (1)
30 var type = typeResolver.Resolve(typename, serviceProvider);
MarkupExtensions\StaticResourceExtension.cs (2)
42 Type valueType = value.GetType(); 43 var propertyType = bp?.ReturnType ?? pi?.PropertyType;
MarkupExtensions\StyleSheetExtension.cs (1)
32 var rootObjectType = (serviceProvider.GetService(typeof(IRootObjectProvider)) as IRootObjectProvider)?.RootObject.GetType();
MarkupExtensions\TypeExtension.cs (3)
8 public class TypeExtension : IMarkupExtension<Type> 12 public Type ProvideValue(IServiceProvider serviceProvider) 29 return (this as IMarkupExtension<Type>).ProvideValue(serviceProvider);
ResourceDictionaryHelpers.cs (2)
27 internal static void LoadFromSource(ResourceDictionary rd, string value, Type rootType, IXmlLineInfo lineInfo) 41 var type = XamlResourceIdAttribute.GetTypeForPath(assembly, resourcePath);
ViewExtensions.cs (1)
40 public static TXaml LoadFromXaml<TXaml>(this TXaml view, Type callingType)
XamlCompilationAttribute.cs (1)
27 public static bool IsCompiled(this Type type)
XamlLoader.cs (6)
48 public static void Load(object view, Type callingType) 219 static string GetXamlForType(Type type, object instance, out bool useDesignProperties) 259 static readonly Dictionary<Type, string> XamlResources = new Dictionary<Type, string>(); 260 static string LegacyGetXamlForType(Type type) 340 static string ReadResourceAsXaml(Type type, Assembly assembly, string likelyTargetName, bool validate = false)
XamlParser.cs (6)
364 public static Type GetElementType(XmlType xmlType, IXmlLineInfo xmlInfo, Assembly currentAssembly, 373 Type type = xmlType.GetTypeReference( 378 var t = Type.GetType($"{typeInfo.clrNamespace}.{typeInfo.typeName}, {typeInfo.assemblyName}"); 406 var t = GetElementType(xmltype, xmlInfo, currentAssembly, out XamlParseException xpe); 436 public static bool IsPublicOrVisibleInternal(this Type type, Assembly assembly)
XamlServiceProvider.cs (11)
14 readonly Dictionary<Type, object> services = new Dictionary<Type, object>(); 75 public object GetService(Type serviceType) => services.TryGetValue(serviceType, out var service) ? service : null; 77 public void Add(Type type, object service) => services.Add(type, service); 210 Type IXamlTypeResolver.Resolve(string qualifiedTypeName, IServiceProvider serviceProvider) 212 var type = Resolve(qualifiedTypeName, serviceProvider, out XamlParseException e); 218 bool IXamlTypeResolver.TryResolve(string qualifiedTypeName, out Type type) 224 internal bool TryResolve(XmlType xmlType, out Type type) 231 Type Resolve(string qualifiedTypeName, IServiceProvider serviceProvider, out XamlParseException exception) 244 internal delegate Type GetTypeFromXmlName(XmlType xmlType, IXmlLineInfo xmlInfo, Assembly currentAssembly, out XamlParseException exception); 333 context.RootElement.GetType().Assembly, out var xpe) is Type parentType
Microsoft.Maui.Essentials (3)
Preferences\Preferences.shared.cs (3)
273 internal static Type[] SupportedTypes = new Type[] 287 var type = typeof(T);
Microsoft.Maui.Graphics (21)
Converters\ColorTypeConverter.cs (3)
21 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 188 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 191 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
Converters\PointFTypeConverter.cs (3)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 37 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Converters\PointTypeConverter.cs (3)
11 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 14 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 37 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Converters\RectFTypeConverter.cs (3)
10 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 13 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 31 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Converters\RectTypeConverter.cs (3)
10 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 13 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 32 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Converters\SizeFTypeConverter.cs (3)
10 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 13 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 30 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Converters\SizeTypeConverter.cs (3)
10 public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 13 public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 30 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Microsoft.Maui.Resizetizer (1)
ColorTable.cs (1)
34 static void FillWithProperties(Dictionary<string, SKColor> dictionary, Type typeWithColors)
Microsoft.ML.AutoML (14)
EstimatorExtensions\EstimatorExtensionCatalog.cs (3)
30private static readonly IDictionary<EstimatorName, Type> _namesToExtensionTypes = new 31Dictionary<EstimatorName, Type>() 51var extType = _namesToExtensionTypes[estimatorName];
SweepableEstimator\Converter\MultiModelPipelineConverter.cs (1)
15public override MultiModelPipeline Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
SweepableEstimator\Converter\SweepableEstimatorConverter.cs (1)
16public override SweepableEstimator Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
SweepableEstimator\Converter\SweepableEstimatorPipelineConverter.cs (1)
15public override SweepableEstimatorPipeline Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
SweepableEstimator\Converter\SweepablePipelineConverter.cs (1)
15public override SweepablePipeline Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
TrainerExtensions\TrainerExtensionCatalog.cs (4)
13private static readonly IDictionary<TrainerName, Type> _trainerNamesToExtensionTypes = 14new Dictionary<TrainerName, Type>() 49private static readonly IDictionary<Type, TrainerName> _extensionTypesToTrainerNames = 59var trainerExtensionType = _trainerNamesToExtensionTypes[trainerName];
TrainerExtensions\TrainerExtensionUtil.cs (2)
237private static void SetValue(FieldInfo fi, IComparable value, object obj, Type propertyType) 265var propType = Nullable.GetUnderlyingType(fi.FieldType) ?? fi.FieldType;
Utils\SweepableParamAttributes.cs (1)
94var type = o.GetType();
Microsoft.ML.AutoML.SourceGenerator (10)
Template\EstimatorType.cs (2)
306System.Type t = objectToConvert.GetType(); 307System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Template\SearchSpace.cs (2)
323System.Type t = objectToConvert.GetType(); 324System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Template\SweepableEstimator.cs (2)
325System.Type t = objectToConvert.GetType(); 326System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Template\SweepableEstimator_T_.cs (2)
330System.Type t = objectToConvert.GetType(); 331System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Template\SweepableEstimatorFactory.cs (2)
301System.Type t = objectToConvert.GetType(); 302System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Microsoft.ML.AutoML.Tests (3)
MetricsUtil.cs (1)
47var type = typeof(T);
Utils\DoubleToDecimalConverter.cs (1)
13public override double Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options)
Utils\FloatToDecimalConverter.cs (1)
13public override float Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options)
Microsoft.ML.Benchmarks.Tests (5)
BenchmarksTest.cs (5)
35public static TheoryData<Type> GetBenchmarks() 37TheoryData<Type> benchmarks = new TheoryData<Type>(); 44foreach (Type type in types) 53public void BenchmarksProjectIsNotBroken(Type type)
Microsoft.ML.CodeGenerator (26)
CodeGenerator\CSharp\AzureCodeGenerator\AzureAttachModelCodeGenerator.cs (1)
57Type labelTypeCsharp = Utils.GetCSharpType(labelType);
CodeGenerator\CSharp\CodeGenerator.cs (3)
61Type labelTypeCsharp = Utils.GetCSharpType(labelType); 140Type labelTypeCsharp, bool includeLightGbmPackage, bool includeMklComponentsPackage, 162Type labelTypeCsharp, bool includeLightGbmPackage, bool includeMklComponentsPackage,
CodeGenerator\CSharp\TrainerGeneratorBase.cs (1)
63Type type = kv.Value.GetType();
Templates\Azure\Console\AzureModelBuilder.cs (2)
400System.Type t = objectToConvert.GetType(); 401System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Templates\Azure\Model\AzureImageModelOutputClass.cs (2)
341System.Type t = objectToConvert.GetType(); 342System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Templates\Azure\Model\AzureObjectDetectionModelOutputClass.cs (2)
341System.Type t = objectToConvert.GetType(); 342System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Templates\Console\ConsumeModel.cs (2)
352System.Type t = objectToConvert.GetType(); 353System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Templates\Console\ModelBuilder.cs (2)
717System.Type t = objectToConvert.GetType(); 718System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Templates\Console\ModelInputClass.cs (2)
315System.Type t = objectToConvert.GetType(); 316System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Templates\Console\ModelOutputClass.cs (2)
358System.Type t = objectToConvert.GetType(); 359System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Templates\Console\ModelProject.cs (2)
347System.Type t = objectToConvert.GetType(); 348System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Templates\Console\PredictProgram.cs (2)
374System.Type t = objectToConvert.GetType(); 375System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Templates\Console\PredictProject.cs (2)
352System.Type t = objectToConvert.GetType(); 353System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
Utils.cs (1)
150internal static Type GetCSharpType(DataKind labelType)
Microsoft.ML.Core (289)
CommandLine\ArgumentAttribute.cs (1)
101public Type SignatureType { get; set; }
CommandLine\CmdParser.cs (46)
46Type SignatureType { get; } 236public static bool ParseArguments(IHostEnvironment env, string settings, object destination, Type destinationType, ErrorReporter reporter) 259var destinationType = destination.GetType(); 335Type t1 = values.GetType(); 336Type t2 = defaults.GetType(); 337Type t; 354Type t1 = values.GetType(); 355Type t2 = defaults.GetType(); 356Type t; 382public static bool IsNumericType(Type type) 415public static string ArgumentsUsage(IHostEnvironment env, Type type, object defaults, bool showRsp = false, int? columns = null) 435public static ArgInfo GetArgInfo(Type type, object defaults) 462private static ArgumentInfo GetArgumentInfo(Type type, object defaults) 1101private static bool IsNullableType(Type type) 1106private static bool IsValidItemType(Type type) 1114Type typeBase = type; 1142Type factoryType, 1143Type signatureType, 1225public Type ItemType { get { return _arg.ItemType; } } 1230public Type ItemValueType { get { return _arg.ItemValueType; } } 1252internal static ArgInfo GetInfo(Type type, object defaults = null) 1264private static string TypeToString(Type type) 1340public ArgumentInfo(Type type, Argument argDef, Argument[] args, Dictionary<string, Argument> map) 1363private static MethodInfo GetParseMethod(Type type) 1372private static MethodInfo GetUnparseMethod(Type type) 1397public readonly Type ItemType; 1402public readonly Type ItemValueType; 1414private readonly Type _signatureType; 1469_ctorCustom = ItemValueType.GetConstructor(Type.EmptyTypes); 1492private bool IsKeyValuePair(Type type) 1739Type type = ItemValueType; 1927var type = value.GetType(); 2035var type = value.GetType(); 2110var type = value.GetType(); 2181Type type = ItemValueType; 2285Type factoryType, 2286Type signatureType, 2299Type factoryType, 2300Type signatureType, 2314Type componentFactoryType; 2336public Type SignatureType { get; } 2340protected ComponentFactory(Type signatureType, string name, string[] settings) 2375public ComponentFactory(Type signatureType, string name, string[] settings) 2393public ComponentFactory(Type signatureType, string name, string[] settings) 2412public ComponentFactory(Type signatureType, string name, string[] settings) 2432public ComponentFactory(Type signatureType, string name, string[] settings)
ComponentModel\ComponentCatalog.cs (66)
79_signatures = new Dictionary<Type, bool>(); 86_extensionsMap = new Dictionary<(Type AttributeType, string ContractName), Type>(); 101public readonly Type Signature; 103public Key(string name, Type sig) 131public Type Type { get; } 137public Type LoaderType { get; } 139public IReadOnlyList<Type> SignatureTypes { get; } 196public Type ArgType { get; } 198private Type[] CtorTypes { get; } 225CtorTypes = attr.CtorTypes ?? Type.EmptyTypes; 312var ctor = ArgType.GetConstructor(Type.EmptyTypes); 334public readonly Type InputType; 335public readonly Type OutputType; 336public readonly Type[] InputKinds; 337public readonly Type[] OutputKinds; 361var outputType = method.ReturnType; 370private Type[] FindEntryPointKinds(Type type) 374var baseType = type.BaseType; 401public readonly Type ArgumentType; 402public readonly Type InterfaceType; 405internal ComponentInfo(Type interfaceType, string kind, Type argumentType, TlcModule.ComponentAttribute attribute) 448private readonly Dictionary<Type, bool> _signatures; 456private readonly Dictionary<(Type AttributeType, string ContractName), Type> _extensionsMap; 458private static bool TryGetIniters(Type instType, Type loaderType, Type[] parmTypes, 467var parmTypesWithEnv = Utils.Concat(new Type[1] { typeof(IHostEnvironment) }, parmTypes); 475if ((ctor = loaderType.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, parmTypes ?? Type.EmptyTypes, null)) == null) 477if ((ctor = loaderType.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, parmTypesWithEnv ?? Type.EmptyTypes, null)) != null) 482if ((create = FindCreateMethod(instType, loaderType, parmTypes ?? Type.EmptyTypes)) == null) 484if ((create = FindCreateMethod(instType, loaderType, parmTypesWithEnv ?? Type.EmptyTypes)) != null) 528foreach (var sigType in info.SignatureTypes) 564var type = info.LoaderType; 590foreach (var nestedType in type.GetTypeInfo().GetNestedTypes()) 594private bool ScanForComponents(Type nestedType) 602foreach (var faceType in nestedType.GetInterfaces()) 642private static MethodInfo FindInstanceGetter(Type instType, Type loaderType) 660private static MethodInfo FindCreateMethod(Type instType, Type loaderType, Type[] parmTypes) 662var meth = loaderType.GetMethod("Create", BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy, null, parmTypes ?? Type.EmptyTypes, null); 731internal LoadableClassInfo[] GetAllDerivedClasses(Type typeBase, Type typeSig) 750internal Type[] GetAllSignatureTypes() 759internal static string SignatureToString(Type sig) 814internal LoadableClassInfo GetLoadableClassInfo(string loadName, Type signatureType) 850internal bool TryFindComponent(Type argumentType, out ComponentInfo component) 859internal bool TryFindComponent(Type interfaceType, Type argumentType, out ComponentInfo component) 870internal bool TryFindComponent(Type interfaceType, string alias, out ComponentInfo component) 880/// Akin to <see cref="TryFindComponent(Type, string, out ComponentInfo)"/>, except if the regular (case sensitive) comparison fails, it will 884internal bool TryFindComponentCaseInsensitive(Type interfaceType, string alias, out ComponentInfo component) 927internal IEnumerable<ComponentInfo> GetAllComponents(Type interfaceType) 934internal bool TryGetComponentKind(Type signatureType, out string kind) 946internal bool TryGetComponentShortName(Type type, out string name) 976internal static TRes CreateInstance<TRes>(IHostEnvironment env, Type signatureType, string name, string options, params object[] extra) 997internal static bool TryCreateInstance<TRes>(IHostEnvironment env, Type signatureType, out TRes result, string name, string options, params object[] extra) 1081foreach (Type type in assembly.GetTypes()) 1088if (_extensionsMap.TryGetValue(key, out var existingType)) 1129internal object GetExtensionValue(IHostEnvironment env, Type attributeType, string contractName) 1132if (_extensionsMap.TryGetValue((attributeType, contractName), out Type extensionType))
ComponentModel\LoadableClassAttribute.cs (42)
32public LoadableClassAttribute(Type instType, Type argType, Type sigType, string userName, params string[] loadNames) 47public LoadableClassAttribute(Type instType, Type loaderType, Type argType, Type sigType, string userName, params string[] loadNames) 52public LoadableClassAttribute(Type instType, Type argType, Type[] sigTypes, string userName, params string[] loadNames) 57public LoadableClassAttribute(Type instType, Type loaderType, Type argType, Type[] sigTypes, string userName, params string[] loadNames) 72public LoadableClassAttribute(string summary, Type instType, Type argType, Type sigType, string userName, params string[] loadNames) 88public LoadableClassAttribute(string summary, Type instType, Type loaderType, Type argType, Type sigType, string userName, params string[] loadNames) 93public LoadableClassAttribute(string summary, Type instType, Type argType, Type[] sigTypes, string userName, params string[] loadNames) 98public LoadableClassAttribute(string summary, Type instType, Type loaderType, Type argType, Type[] sigTypes, string userName, params string[] loadNames) 113public Type InstanceType { get; private set; } 120public Type LoaderType { get; private set; } 125public Type ArgType { get; private set; } 131public Type[] SigTypes { get; private set; } 136public Type[] CtorTypes { get; private set; } 161protected LoadableClassAttributeBase(string summary, Type instType, Type loaderType, Type argType, Type[] sigTypes, string userName, params string[] loadNames) 174var sigType = sigTypes[0]; 176Type[] types; 188types = new Type[1 + parms.Length]; 192types = new Type[parms.Length]; 194types = Type.EmptyTypes;
Data\ColumnTypeExtensions.cs (2)
95public static PrimitiveDataViewType PrimitiveTypeFromType(Type type) 129public static NumberDataViewType NumberTypeFromType(Type type)
Data\DataKind.cs (3)
195public static ulong ToMaxInt(this Type type) 249public static Type ToType(this InternalDataKind kind) 293public static bool TryGetDataKind(this Type type, out InternalDataKind kind)
EntryPoints\EntryPointModuleAttribute.cs (1)
21public EntryPointModuleAttribute(Type loaderType)
EntryPoints\EntryPointUtils.cs (1)
64var fieldType = fieldInfo.FieldType;
EntryPoints\ModuleArgs.cs (6)
100public readonly Type[] Kinds; 102public EntryPointKindAttribute(params Type[] kinds) 148private Type _type; 154public Type Type => _type; 374var type = o.GetType(); 600public static DataKind GetDataType(Type type)
Environment\HostEnvironmentBase.cs (3)
279/// map from <see cref="System.Type"/> to <see cref="Dispatcher"/>. 355protected readonly ConcurrentDictionary<Type, Dispatcher> ListenerDict; 377ListenerDict = new ConcurrentDictionary<Type, Dispatcher>();
Utilities\FuncInstanceMethodInfo1`2.cs (3)
67Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 73Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 74Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo1`3.cs (3)
68Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 74Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 75Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T, TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo1`4.cs (3)
69Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 75Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 76Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T1, T2, TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo2`4.cs (3)
69Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 75Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 76Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T1, T2, TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo3`3.cs (3)
68Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 74Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 75Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T, TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo3`4.cs (3)
69Contracts.CheckParam(methodCallExpression.Method.GetParameters()[0].ParameterType == typeof(Type), nameof(expression), "Unexpected expression form"); 75Contracts.CheckParam(((ConstantExpression)methodCallExpression.Arguments[0]).Type == typeof(Type), nameof(expression), "Unexpected expression form"); 76Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T1, T2, TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncMethodInfo1`1.cs (3)
26private ImmutableDictionary<Type, MethodInfo> _instanceMethodInfo; 31_instanceMethodInfo = ImmutableDictionary<Type, MethodInfo>.Empty; 37public MethodInfo MakeGenericMethod(Type typeArg1)
Utilities\FuncMethodInfo1`2.cs (3)
27private ImmutableDictionary<Type, MethodInfo> _instanceMethodInfo; 32_instanceMethodInfo = ImmutableDictionary<Type, MethodInfo>.Empty; 38public MethodInfo MakeGenericMethod(Type typeArg1)
Utilities\FuncMethodInfo1`3.cs (3)
28private ImmutableDictionary<Type, MethodInfo> _instanceMethodInfo; 33_instanceMethodInfo = ImmutableDictionary<Type, MethodInfo>.Empty; 39public MethodInfo MakeGenericMethod(Type typeArg1)
Utilities\FuncMethodInfo2`3.cs (6)
28private ImmutableDictionary<(Type, Type), MethodInfo> _instanceMethodInfo; 33_instanceMethodInfo = ImmutableDictionary<(Type, Type), MethodInfo>.Empty; 39public MethodInfo MakeGenericMethod(Type typeArg1, Type typeArg2)
Utilities\FuncMethodInfo3`2.cs (9)
27private ImmutableDictionary<(Type, Type, Type), MethodInfo> _instanceMethodInfo; 32_instanceMethodInfo = ImmutableDictionary<(Type, Type, Type), MethodInfo>.Empty; 38public MethodInfo MakeGenericMethod(Type typeArg1, Type typeArg2, Type typeArg3)
Utilities\FuncMethodInfo3`3.cs (9)
28private ImmutableDictionary<(Type, Type, Type), MethodInfo> _instanceMethodInfo; 33_instanceMethodInfo = ImmutableDictionary<(Type, Type, Type), MethodInfo>.Empty; 39public MethodInfo MakeGenericMethod(Type typeArg1, Type typeArg2, Type typeArg3)
Utilities\PathUtils.cs (1)
64public static string FindExistentFileOrNull(string fileName, string folderPrefix = null, string customSearchDir = null, System.Type assemblyForBasePath = null)
Utilities\PlatformUtils.cs (4)
25public static bool IsGenericEx(this Type type, Type typeDef) 33public static Type[] GetGenericTypeArgumentsEx(this Type type)
Utilities\Utils.cs (62)
961private static MethodInfo MarshalInvokeCheckAndCreate<TRet>(Type genArg, Delegate func) 991public static TResult MarshalInvoke<TTarget, TResult>(FuncInstanceMethodInfo1<TTarget, TResult> func, TTarget target, Type genArg) 999/// A static version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1001public static TResult MarshalInvoke<TResult>(FuncStaticMethodInfo1<TResult> func, Type genArg) 1008/// A one-argument version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1010public static TResult MarshalInvoke<TTarget, TArg1, TResult>(FuncInstanceMethodInfo1<TTarget, TArg1, TResult> func, TTarget target, Type genArg, TArg1 arg1) 1018/// A one-argument version of <see cref="MarshalInvoke{TResult}(FuncStaticMethodInfo1{TResult}, Type)"/>. 1020public static TResult MarshalInvoke<TArg1, TResult>(FuncStaticMethodInfo1<TArg1, TResult> func, Type genArg, TArg1 arg1) 1027/// A one-argument, three-type-parameter version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1029public static TResult MarshalInvoke<TTarget, TArg1, TResult>(FuncInstanceMethodInfo3<TTarget, TArg1, TResult> func, TTarget target, Type genArg1, Type genArg2, Type genArg3, TArg1 arg1) 1037/// A one-argument, three-type-parameter version of <see cref="MarshalInvoke{TResult}(FuncStaticMethodInfo1{TResult}, Type)"/>. 1039public static TResult MarshalInvoke<TArg1, TResult>(FuncStaticMethodInfo3<TArg1, TResult> func, Type genArg1, Type genArg2, Type genArg3, TArg1 arg1) 1046/// A two-argument version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1048public static TResult MarshalInvoke<TTarget, TArg1, TArg2, TResult>(FuncInstanceMethodInfo1<TTarget, TArg1, TArg2, TResult> func, TTarget target, Type genArg, TArg1 arg1, TArg2 arg2) 1056/// A two-argument version of <see cref="MarshalInvoke{TResult}(FuncStaticMethodInfo1{TResult}, Type)"/>. 1058public static TResult MarshalInvoke<TArg1, TArg2, TResult>(FuncStaticMethodInfo1<TArg1, TArg2, TResult> func, Type genArg, TArg1 arg1, TArg2 arg2) 1065/// A two-argument, two-type-parameter version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1067public static TResult MarshalInvoke<TTarget, TArg1, TArg2, TResult>(FuncInstanceMethodInfo2<TTarget, TArg1, TArg2, TResult> func, TTarget target, Type genArg1, Type genArg2, TArg1 arg1, TArg2 arg2) 1075/// A two-argument, two-type-parameter version of <see cref="MarshalInvoke{TResult}(FuncStaticMethodInfo1{TResult}, Type)"/>. 1077public static TResult MarshalInvoke<TArg1, TArg2, TResult>(FuncStaticMethodInfo2<TArg1, TArg2, TResult> func, Type genArg1, Type genArg2, TArg1 arg1, TArg2 arg2) 1084/// A two-argument, three-type-parameter version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1086public static TResult MarshalInvoke<TTarget, TArg1, TArg2, TResult>(FuncInstanceMethodInfo3<TTarget, TArg1, TArg2, TResult> func, TTarget target, Type genArg1, Type genArg2, Type genArg3, TArg1 arg1, TArg2 arg2) 1094/// A two-argument, three-type-parameter version of <see cref="MarshalInvoke{TResult}(FuncStaticMethodInfo1{TResult}, Type)"/>. 1096public static TResult MarshalInvoke<TArg1, TArg2, TResult>(FuncStaticMethodInfo3<TArg1, TArg2, TResult> func, Type genArg1, Type genArg2, Type genArg3, TArg1 arg1, TArg2 arg2) 1103/// A three-argument version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1105public static TRet MarshalInvoke<TArg1, TArg2, TArg3, TRet>(Func<TArg1, TArg2, TArg3, TRet> func, Type genArg, 1113/// A four-argument version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1116Type genArg, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4) 1123/// A five-argument version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1126Type genArg, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5) 1133/// A six-argument version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1136Type genArg, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6) 1143/// A seven-argument version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1146Type genArg, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7) 1153/// An eight-argument version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1156Type genArg, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7, TArg8 arg8) 1163/// A nine-argument version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1167Type genArg, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7, TArg8 arg8, TArg9 arg9) 1174/// A ten-argument version of <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>. 1178Type genArg, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7, TArg8 arg8, TArg9 arg9, TArg10 arg10) 1184private static MethodInfo MarshalActionInvokeCheckAndCreate(Type genArg, Delegate func) 1197/// This is akin to <see cref="MarshalInvoke{TTarget, TResult}(FuncInstanceMethodInfo1{TTarget, TResult}, TTarget, Type)"/>, except applied to 1204public static void MarshalActionInvoke(Action act, Type genArg) 1211/// A one-argument version of <see cref="MarshalActionInvoke(Action, Type)"/>. 1213public static void MarshalActionInvoke<TArg1>(Action<TArg1> act, Type genArg, TArg1 arg1) 1220/// A two-argument version of <see cref="MarshalActionInvoke(Action, Type)"/>. 1222public static void MarshalActionInvoke<TArg1, TArg2>(Action<TArg1, TArg2> act, Type genArg, TArg1 arg1, TArg2 arg2) 1229/// A three-argument version of <see cref="MarshalActionInvoke(Action, Type)"/>. 1231public static void MarshalActionInvoke<TArg1, TArg2, TArg3>(Action<TArg1, TArg2, TArg3> act, Type genArg, TArg1 arg1, TArg2 arg2, TArg3 arg3) 1238/// A four-argument version of <see cref="MarshalActionInvoke(Action, Type)"/>. 1240public static void MarshalActionInvoke<TArg1, TArg2, TArg3, TArg4>(Action<TArg1, TArg2, TArg3, TArg4> act, Type genArg, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4) 1248Type type = value.GetType();
Microsoft.ML.Core.Tests (2)
UnitTests\ColumnTypes.cs (1)
53var rawType = tmp.RawType;
UnitTests\TestEntryPoints.cs (1)
369var weightType = ib1.GetFieldTypeOrNull("ExampleWeightColumnName");
Microsoft.ML.Data (199)
Data\Conversion.cs (20)
78private readonly Dictionary<(Type src, Type dst), Delegate> _delegatesStd; 82private readonly Dictionary<(Type src, Type dst), Delegate> _delegatesAll; 85private readonly Dictionary<Type, Delegate> _isNADelegates; 88private readonly Dictionary<Type, Delegate> _hasNADelegates; 91private readonly Dictionary<Type, Delegate> _isDefaultDelegates; 95private readonly Dictionary<Type, Delegate> _hasZeroDelegates; 98private readonly Dictionary<Type, Delegate> _getNADelegates; 101private readonly Dictionary<Type, Delegate> _tryParseDelegates; 105_delegatesStd = new Dictionary<(Type src, Type dst), Delegate>(); 106_delegatesAll = new Dictionary<(Type src, Type dst), Delegate>(); 107_isNADelegates = new Dictionary<Type, Delegate>(); 108_hasNADelegates = new Dictionary<Type, Delegate>(); 109_isDefaultDelegates = new Dictionary<Type, Delegate>(); 110_hasZeroDelegates = new Dictionary<Type, Delegate>(); 111_getNADelegates = new Dictionary<Type, Delegate>(); 112_tryParseDelegates = new Dictionary<Type, Delegate>();
Data\DataViewTypeManager.cs (13)
15/// A singleton class for managing the map between ML.NET <see cref="DataViewType"/> and C# <see cref="Type"/>. 26private static readonly HashSet<Type> _bannedRawTypes = new HashSet<Type>() 37/// Mapping from a <see cref="Type"/> plus its <see cref="Attribute"/>s to a <see cref="DataViewType"/>. 42/// Mapping from a <see cref="DataViewType"/> to a <see cref="Type"/> plus its <see cref="Attribute"/>s. 54internal static DataViewType GetDataViewType(Type type, IEnumerable<Attribute> typeAttributes = null) 89internal static bool Knows(Type type, IEnumerable<Attribute> typeAttributes = null) 121/// If <paramref name="dataViewType"/> has been registered with a <see cref="Type"/>, this function returns <see langword="true"/>. 145public static void Register(DataViewType dataViewType, Type type, IEnumerable<Attribute> typeAttributes) 176public static void Register(DataViewType dataViewType, Type type, DataViewTypeAttribute typeAttribute = null) 206var associatedRawType = _dataViewTypeToRawTypeMap[dataViewType].TargetType; 224public Type TargetType { get; } 233public TypeWithAttributes(Type type, DataViewTypeAttribute attribute)
Data\DataViewUtils.cs (2)
866Type pipeType; 874var constructor = pipeType.GetConstructor(new Type[] { typeof(object) });
Data\SchemaDefinition.cs (5)
236internal Type ReturnType => Generator?.GetMethodInfo().GetParameters().LastOrDefault().ParameterType.GetElementType(); 331internal static MemberInfo[] GetMemberInfos(Type userType, Direction direction) 382internal static bool GetNameAndCustomAttributes(MemberInfo memberInfo, Type userType, HashSet<string> colNames, out string name, out IEnumerable<Attribute> customAttributes) 418public static SchemaDefinition Create(Type userType, Direction direction = Direction.Both) 430InternalSchemaDefinition.GetVectorAndItemType(memberInfo, out bool isVector, out Type dataType);
DataLoadSave\Binary\BinaryLoader.cs (4)
506Type entryType; 509Type valueType = type.RawType; 511Type[] args = valueType.GetGenericArguments(); 1454Type genType = entry.IsGenerated ? typeof(ReadPipeGenerated<>) : typeof(ReadPipe<>);
DataLoadSave\Binary\BinarySaver.cs (1)
97Type writePipeType = typeof(WritePipe<>).MakeGenericType(col.Codec.Type.RawType);
DataLoadSave\Binary\CodecFactory.cs (2)
21private readonly Dictionary<Type, IValueCodec> _simpleCodecTypeMap; 46_simpleCodecTypeMap = new Dictionary<Type, IValueCodec>();
DataLoadSave\Binary\Codecs.cs (6)
160private static DataViewType UnsafeColumnType(Type type) 1151Type codecType = typeof(VBufferCodec<>).MakeGenericType(itemType.RawType); 1167Type codecType = typeof(VBufferCodec<>).MakeGenericType(itemType.RawType); 1264Type codecType = typeof(KeyCodecOld<>).MakeGenericType(itemType.RawType); 1352Type codecType = typeof(KeyCodec<>).MakeGenericType(itemType.RawType); 1369Type codecType = typeof(KeyCodec<>).MakeGenericType(type.RawType);
DataLoadSave\Binary\UnsafeTypeOps.cs (2)
28private static readonly Dictionary<Type, object> _type2ops; 32_type2ops = new Dictionary<Type, object>();
DataLoadSave\Database\DatabaseLoader.cs (2)
104var userType = typeof(TInput); 688Type rawType = dbType.ToType();
DataLoadSave\Database\DbExtensions.cs (1)
15public static Type ToType(this DbType dbType)
DataLoadSave\Text\TextLoader.cs (1)
1572var userType = typeof(TInput);
DataLoadSave\Text\TextSaver.cs (1)
65Type writePipeType;
DataView\CacheDataView.cs (3)
1250private static volatile Type[] _pipeConstructorTypes; 1288Type pipeType; 1299new Type[] { typeof(CacheDataView), typeof(DataViewRowCursor), typeof(int), typeof(OrderedWaiter) }, null);
DataView\DataViewConstructionUtils.cs (9)
236var outputType = column.OutputType; 237var genericType = outputType; 289var keyRawType = colType.RawType; 880Type itemType; 914var typeT = typeof(T); 919var itemType = typeT.GetElementType(); 920var dstItemType = typeof(TDst).GetGenericArguments()[0]; 945var dstItemType = typeof(TDst).GetGenericArguments()[0]; 946var itemType = typeT.GetGenericArguments()[0];
DataView\InternalSchemaDefinition.cs (13)
31public Type ComputedReturnType { get { return ReturnParameterInfo.ParameterType.GetElementType(); } } 32public Type FieldOrPropertyType => (MemberInfo is FieldInfo) ? (MemberInfo as FieldInfo).FieldType : (MemberInfo as PropertyInfo).PropertyType; 33public Type OutputType => IsComputed ? ComputedReturnType : FieldOrPropertyType; 122GetVectorAndItemType("return type", ComputedReturnType, null, out bool isVector, out Type itemType); 144public static void GetVectorAndItemType(MemberInfo memberInfo, out bool isVector, out Type itemType) 163public static void GetMappedType(Type rawType, out Type itemType, out bool isVector) 194public static void GetVectorAndItemType(string name, Type rawType, IEnumerable<Attribute> attributes, out bool isVector, out Type itemType) 205public static InternalSchemaDefinition Create(Type userType, SchemaDefinition.Direction direction) 211public static InternalSchemaDefinition Create(Type userType, SchemaDefinition userSchemaDefinition) 228Type dataItemType; 253var parameterType = col.ReturnType;
DataView\Transposer.cs (2)
244var type = ((ITransposeDataView)this).GetSlotType(col).ItemType.RawType; 1371var type = typeof(TValue);
DataView\TypedCursor.cs (5)
143InternalSchemaDefinition.GetVectorAndItemType(memberInfo, out bool isVector, out Type itemType); 228Type actualType = null; 258private static void ValidateUserType(SchemaDefinition schemaDefinition, Type userType, IDataView data) 359var fieldType = column.OutputType; 360var genericType = fieldType;
Dirty\ModelParametersBase.cs (1)
78private protected static bool WarnOnOldNormalizer(ModelLoadContext ctx, Type typePredictor, IChannelProvider provider)
EntryPoints\EntryPointNode.cs (15)
30public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 35public override bool CanConvert(Type objectType) 68public static bool CheckType(Type type) 162public readonly Type Type; 179public static bool IsValidType(Type variableType) 216public EntryPointVariable(IExceptionContext ectx, string name, Type type) 290public void AddInputVariable(VariableBinding binding, Type type) 320public Boolean AddOutputVariable(string name, Type type) 389Type type = typeof(T); 522private void SetColumnArgument(IChannel ch, object inputInstance, string argName, string colName, string columnRole, params Type[] inputKinds) 542var colFieldType = _inputBuilder.GetFieldTypeOrNull(colField); 627Type valueType = _inputBuilder.GetFieldTypeOrNull(pair.Key); 649Type valueType = _inputBuilder.GetFieldTypeOrNull(pair.Key); 692var valueType = _outputHelper.GetFieldType(pair.Key); 863var type = _inputBuilder.GetFieldTypeOrNull(firstBinding.ParameterName).GetElementType();
EntryPoints\InputBuilder.cs (17)
48private readonly Type _type; 55public InputBuilder(IExceptionContext ectx, Type inputType, ComponentCatalog catalog) 119public Type GetFieldTypeOrNull(string alias) 127var type = _fields[fi].FieldType; 276var type = instanceVal.GetType(); 316var elementType = type.GetElementType(); 356var deftype = defaultsVal.GetType(); 391private static bool ExtractOptional(ref object value, ref Type type) 400private static object ParseJsonValue(IExceptionContext ectx, Type type, Attributes attributes, JToken value, ComponentCatalog catalog) 532private static object GetFieldAssignableValue(IExceptionContext ectx, Type type, object value) 544private static IComponentFactory GetComponentJson(IExceptionContext ectx, Type signatureType, string name, JObject settings, ComponentCatalog catalog) 614private static object MakeOptionalIfNeeded(IExceptionContext ectx, object innerValue, Type outerType) 623var genericType = outerType.GetGenericTypeDefinition(); 659private readonly Type _type; 664public OutputHelper(IExceptionContext ectx, Type outputType) 702public Type GetFieldType(string name) 707var type = fi?.FieldType;
MLContext.cs (1)
191var type = asm.GetType("Microsoft.ML.OneDal.OneDalUtils");
Model\Onnx\OnnxContext.cs (2)
165public abstract string AddInitializer(int value, Type type, string name = null, bool makeUniqueName = true); 233public abstract string AddInitializer(IEnumerable<int> values, Type type, IEnumerable<long> dims, string name = null, bool makeUniqueName = true);
Model\Onnx\OnnxNode.cs (1)
32public abstract void AddAttribute(string argName, Type t);
Model\Pfa\PfaUtils.cs (2)
189System.Type rawType = itemType.RawType; 232System.Type rawType = itemType.RawType;
Prediction\Calibrator.cs (8)
454Type genericType = typeof(ValueMapperCalibratedModelParameters<,>); 521Type genericType = typeof(FeatureWeightsCalibratedModelParameters<,>); 598Type genericType = typeof(ParameterMixingCalibratedModelParameters<,>); 817internal static object Create(IHostEnvironment env, ModelLoadContext ctx, object predictor, ICalibrator calibrator, Type calibratedModelParametersType) 819Type[] genericTypeArgs = { predictor.GetType(), calibrator.GetType() }; 820Type constructed = calibratedModelParametersType.MakeGenericType(genericTypeArgs); 822Type[] constructorArgs = { 1318var toTypeInt = typeof(long);
Scorers\PredictionTransformer.cs (18)
726Type predictionTransformerType = typeof(BinaryPredictionTransformer<>); 743Type predictionTransformerType = typeof(MulticlassPredictionTransformer<>); 760Type predictionTransformerType = typeof(RegressionPredictionTransformer<>); 778Type predictionTransformerType = typeof(RankingPredictionTransformer<>); 785internal static object Create(IHostEnvironment env, ModelLoadContext ctx, IHost host, IPredictorProducing<float> model, Type predictionTransformerType) 796internal static object Create(IHostEnvironment env, ModelLoadContext ctx, IHost host, IPredictorProducing<VBuffer<float>> model, Type predictionTransformerType) 807private static ConstructorInfo CreateConstructor(Type modelType, Type predictionTransformerType) 809Type modelLoadType = GetLoadType(modelType); 810Type[] genericTypeArgs = { modelLoadType }; 811Type constructedType = predictionTransformerType.MakeGenericType(genericTypeArgs); 813Type[] constructorArgs = { 824private static Type GetLoadType(Type modelType) 836Type[] typeArguments = modelType.GetGenericArguments(); 837Type genericType = att.LoadType; 849internal Type LoadType { get; } 850internal PredictionTransformerLoadTypeAttribute(Type loadtype)
TrainCatalog.cs (1)
121var type = o.GetType();
Transforms\Hashing.cs (5)
406Type rawType = srcType.ItemType.RawType; 471Type rawType = srcType.ItemType.RawType; 1434var t = NumberDataViewType.Int64.RawType; 1514Type t = vectorTypeSrc != null ? (ex.UseOrderedHashing ? typeof(ImplVecOrdered<>) : typeof(ImplVec<>)) : typeof(ImplOne<>); 1519var consTypes = new Type[] { typeof(DataViewRow), typeof(HashingEstimator.ColumnOptions), typeof(int), typeof(Delegate) };
Transforms\KeyToValue.cs (2)
243new Type[] { srcItemType.RawType, types[iinfo].GetItemType().RawType }); 514var t = InternalDataKindExtensions.ToInternalDataKind(DataKind.Int64).ToType();
Transforms\NAFilter.cs (1)
277Type genericArgument;
Transforms\RowShufflingTransformer.cs (3)
362private static volatile Type[] _pipeConstructorTypes; 378Type pipeType; 387Interlocked.CompareExchange(ref _pipeConstructorTypes, new Type[] { typeof(int), typeof(Delegate) }, null);
Transforms\TypeConverting.cs (2)
505var t = _parent._columns[iinfo].OutputKind.ToInternalDataKind().ToType(); 585public ColumnOptions(string name, Type type, string inputColumnName, KeyCount outputKeyCount = null)
Transforms\ValueMapping.cs (5)
191internal static PrimitiveDataViewType GetPrimitiveType(Type rawType, out bool isVectorType) 193Type type = rawType; 767private protected static PrimitiveDataViewType GetPrimitiveType(Type rawType, out bool isVectorType) 769Type type = rawType; 1202var t = InternalDataKindExtensions.ToInternalDataKind(DataKind.String).ToType();
Transforms\ValueToKeyMappingTransformer.cs (2)
793var t = InternalDataKindExtensions.ToInternalDataKind(DataKind.String).ToType(); 806var t = InternalDataKindExtensions.ToInternalDataKind(DataKind.Single).ToType();
Utilities\ColumnCursor.cs (1)
75var elementType = typeof(T).GetElementType();
Utilities\ComponentCreation.cs (10)
99Type factoryType = typeof(IComponentFactory<IMultiStreamSource, ILegacyDataLoader>); 140Type factoryType = typeof(IComponentFactory<IDataView, IDataTransform>); 163Type factoryType = typeof(IComponentFactory<IDataView, ISchemaBoundMapper, RoleMappedSchema, IDataScorerTransform>); 164Type signatureType = typeof(SignatureDataScorer); 230Type signatureType, 240Type signatureType, 251Type factoryType, 252Type signatureType, 271Type factoryType, 272Type signatureType,
Utilities\TypeParsingUtils.cs (1)
60Type rawType = type.HasValue ? type.Value.ToType() : InternalDataKind.U8.ToType();
Utils\ApiUtils.cs (9)
34private static OpCode GetAssignmentOpCode(Type t, IEnumerable<Attribute> attributes) 73Type fieldType = fieldInfo.FieldType; 78Type propertyType = propertyInfo.PropertyType; 92Type[] args = { typeof(TOwn), typeof(TRow), typeof(long), typeof(TValue).MakeByRefType() }; 112Type[] args = { typeof(TOwn), typeof(TRow), typeof(long), typeof(TValue).MakeByRefType() }; 141Type fieldType = fieldInfo.FieldType; 146Type propertyType = propertyInfo.PropertyType; 158Type[] args = { typeof(TOwn), typeof(TRow), typeof(TValue) }; 176Type[] args = { typeof(TOwn), typeof(TRow), typeof(TValue) };
Microsoft.ML.DataView (19)
DataViewType.cs (8)
24private protected DataViewType(Type rawType) 30/// The raw <see cref="Type"/> for this <see cref="DataViewType"/>. Note that this is the raw representation type 38public Type RawType { get; } 65protected StructuredDataViewType(Type rawType) 77protected PrimitiveDataViewType(Type rawType) 127private NumberDataViewType(Type rawType) 471/// The function <see cref="Register"/> will be called to register a <see cref="DataViewType"/> for a <see cref="Type"/> with its <see cref="Attribute"/>s. 472/// Whenever a value typed to the registered <see cref="Type"/> and its <see cref="Attribute"/>s, that value's type (i.e., a <see cref="DataViewSchema.Column.Type"/>)
KeyDataViewType.cs (5)
47public KeyDataViewType(Type type, ulong count) 60/// <see cref="KeyDataViewType.KeyDataViewType(Type, ulong)"/> constructor by taking an <see cref="int"/> for 73public KeyDataViewType(Type type, int count) 84public static bool IsValidDataType(Type type) 89private static ulong GetMaxInt(Type type)
Utils.cs (5)
13public static void MarshalActionInvoke<TArg1>(Action<TArg1> act, Type genArg, TArg1 arg1) 19public static void MarshalActionInvoke<TArg1, TArg2, TArg3, TArg4>(Action<TArg1, TArg2, TArg3, TArg4> act, Type genArg, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4) 25public static TRet MarshalInvoke<TArg1, TArg2, TRet>(Func<TArg1, TArg2, TRet> func, Type genArg, TArg1 arg1, TArg2 arg2) 31private static MethodInfo MarshalInvokeCheckAndCreate<TRet>(Type genArg, Delegate func) 38private static MethodInfo MarshalActionInvokeCheckAndCreate(Type genArg, Delegate func)
VectorType.cs (1)
88private static Type GetRawType(PrimitiveDataViewType itemType)
Microsoft.ML.Ensemble (1)
Selector\SubModelSelector\BaseBestPerformanceSelector.cs (1)
46protected static string FindMetricName(Type type, object value)
Microsoft.ML.EntryPoints (12)
JsonUtils\JsonManifestUtils.cs (12)
51var kinds = new List<Type>(); 60foreach (var epKind in kinds.Distinct().OrderBy(k => k.Name)) 71var type = ExtractOptionalOrNullableType(fieldInfo.PropertyType); 90private static Type ExtractOptionalOrNullableType(Type type) 133foreach (var kind in entryPointInfo.InputKinds) 141foreach (var kind in entryPointInfo.OutputKinds) 148private static JArray BuildInputManifest(IExceptionContext ectx, Type inputType, ComponentCatalog catalog) 279private static JArray BuildOutputManifest(IExceptionContext ectx, Type outputType, ComponentCatalog catalog) 307private static JToken BuildTypeToken(IExceptionContext ectx, FieldInfo fieldInfo, Type type, ComponentCatalog catalog) 393private static JToken BuildValueToken(IExceptionContext ectx, object value, Type valueType, ComponentCatalog catalog) 458var type = value.GetType();
Microsoft.ML.FastTree (8)
Dataset\Dataset.cs (3)
409Type arrayDataType = Data.GetType().GetElementType(); 679Type arrayDataType = qddata.Data.GetType().GetElementType(); 841Type t = arrays.First(x => x != null).GetType().GetElementType();
Utils\BufferPoolManager.cs (5)
30private static readonly ConcurrentDictionary<Type, SortedList<int, List<Array>>> _bufferPools = new ConcurrentDictionary<Type, SortedList<int, List<Array>>>(); 110public static void ReleaseAllAvailableBuffers(Type type) 128foreach (var type in _bufferPools.Keys) 147private static void InitializeBufferPool(Type type)
Microsoft.ML.GenAI.Core (1)
CausalLMPipelineChatClient.cs (1)
85public virtual object? GetService(Type serviceType, object? serviceKey = null) =>
Microsoft.ML.IntegrationTests (4)
Common.cs (3)
29var types = new Dictionary<string, Type>(); 38var vBufferType = typeof(VBuffer<>); 39Type[] typeArgs = { property.PropertyType.GetElementType() };
IntrospectiveTraining.cs (1)
299var expectedTypes = new Type[] {typeof(ColumnConcatenatingTransformer),
Microsoft.ML.LightGbm (1)
LightGbmTrainerBase.cs (1)
393Type optionsType = LightGbmTrainerOptions.GetType();
Microsoft.ML.Maml (2)
HelpCommand.cs (2)
248Type typeSig; 249Type typeRes;
Microsoft.ML.OnnxConverter (8)
OnnxContextImpl.cs (2)
308public override string AddInitializer(int value, Type type, string name = null, bool makeUniqueName = true) 365public override string AddInitializer(IEnumerable<int> values, Type type, IEnumerable<long> dims, string name = null, bool makeUniqueName = true)
OnnxNodeImpl.cs (1)
46public override void AddAttribute(string argName, Type value)
OnnxUtils.cs (5)
222public static void NodeAddAttributes(NodeProto node, string argName, Type value) 225private static TensorProto.Types.DataType ConvertToTensorProtoType(Type rawType) 345Type rawType; 414public static TensorProto MakeInt32(string name, Type type, int value) 424public static TensorProto MakeInt32s(string name, Type type, IEnumerable<int> values, IEnumerable<long> dims = null)
Microsoft.ML.OnnxTransformer (64)
OnnxMapType.cs (10)
16/// <see cref="OnnxMapType.OnnxMapType(Type,Type)"/>. 25public OnnxMapType(Type keyType, Type valueType) : base(typeof(IDictionary<,>).MakeGenericType(keyType, valueType)) 52private readonly Type _keyType; 53private readonly Type _valueType; 67public OnnxMapTypeAttribute(Type keyType, Type valueType) 96var enumerableType = typeof(IDictionary<,>); 97var type = enumerableType.MakeGenericType(_keyType, _valueType);
OnnxSequenceType.cs (10)
16/// <see cref="OnnxSequenceType.OnnxSequenceType(Type)"/>. 20private static Type MakeNativeType(Type elementType) 22var enumerableTypeInfo = typeof(IEnumerable<>); 23var enumerableType = enumerableTypeInfo.MakeGenericType(elementType); 31public OnnxSequenceType(Type elementType) : base(MakeNativeType(elementType)) 58private readonly Type _elemType; 72public OnnxSequenceTypeAttribute(Type elemType) 100var enumerableType = typeof(IEnumerable<>); 101var type = enumerableType.MakeGenericType(_elemType);
OnnxTransform.cs (11)
502/// <see cref="_inputOnnxTypes"/>'s i-th element value tells if the <see cref="Type"/> of the i-th ONNX input. 504private readonly Type[] _inputOnnxTypes; 513_inputOnnxTypes = new Type[_parent.Inputs.Length]; 626var elemRawType = vectorType.ItemType.RawType; 635var type = _parent.Model.ModelInfo.OutputsInfo[_parent.MapDataViewColumnToOnnxOutputTensor(iinfo)].DataViewType.RawType; 775Type[] onnxInputTypes, 795private static INamedOnnxValueGetter CreateNamedOnnxValueGetter(DataViewRow input, Type onnxType, int colIndex, OnnxShape onnxShape) 801var type = input.Schema[colIndex].Type.RawType; 807/// Function needed by reflection in <see cref="CreateNamedOnnxValueGetter(DataViewRow, Type, int, OnnxShape)"/>. 818private static INamedOnnxValueGetter CreateNamedOnnxValueGetterVec(DataViewRow input, Type onnxType, int colIndex, OnnxShape onnxShape) 830/// Function needed by reflection in <see cref="CreateNamedOnnxValueGetterVec(DataViewRow, Type, int, OnnxShape)"/>.
OnnxTypeParser.cs (25)
21/// Derive the corresponding <see cref="Type"/> for ONNX tensor's element type specified by <paramref name="elementType"/>. 22/// The corresponding <see cref="Type"/> should match the type system in ONNXRuntime's C# APIs. 23/// This function is used when determining the corresponding <see cref="Type"/> of <see cref="OnnxCSharpToProtoWrapper.TypeProto"/>. 26public static Type GetNativeScalarType(int elementType) 29Type scalarType = null; 75/// Derive the corresponding <see cref="Type"/> for ONNX variable typed to <paramref name="typeProto"/>. 76/// The corresponding <see cref="Type"/> should match the type system in ONNXRuntime's C# APIs. 79public static Type GetNativeType(OnnxCSharpToProtoWrapper.TypeProto typeProto) 89Type tensorType = typeof(VBuffer<>); 90Type elementType = GetNativeScalarType(typeProto.TensorType.ElemType); 96var enumerableType = typeof(IEnumerable<>); 97var elementType = GetNativeType(typeProto.SequenceType.ElemType); 102var dictionaryType = typeof(IDictionary<,>); 103Type keyType = GetNativeScalarType(typeProto.MapType.KeyType); 104Type valueType = GetNativeType(typeProto.MapType.ValueType); 248var elemType = GetNativeType(elemTypeProto); 253var keyType = GetNativeScalarType(typeProto.MapType.KeyType); 254var valueType = GetNativeType(typeProto.MapType.ValueType); 262/// Class which store casting functions used in <see cref="GetDataViewValueCasterAndResultedType(OnnxCSharpToProtoWrapper.TypeProto, out Type)"/>. 287public static Func<NamedOnnxValue, object> GetDataViewValueCasterAndResultedType(OnnxCSharpToProtoWrapper.TypeProto typeProto, out Type resultedType) 299var type = GetScalarDataViewType(typeProto.TensorType.ElemType).RawType; 320var type = GetScalarDataViewType(typeProto.TensorType.ElemType).RawType; 340var elementCaster = GetDataViewValueCasterAndResultedType(typeProto.SequenceType.ElemType, out Type elementType); 363var keyType = GetNativeScalarType(typeProto.MapType.KeyType); 364var valueType = GetNativeType(typeProto.MapType.ValueType);
OnnxUtils.cs (8)
120public Type TypeInOnnxRuntime { get; } 132public OnnxVariableInfo(string name, OnnxShape shape, Type typeInOnnxRuntime, DataViewType mlnetType, Func<NamedOnnxValue, object> caster) 276casterPool[valueInfo.Name] = OnnxTypeParser.GetDataViewValueCasterAndResultedType(valueInfo.Type, out Type actualType); 494private static readonly HashSet<Type> _onnxTypeMap = 495new HashSet<Type> 510private static readonly Dictionary<Type, InternalDataKind> _typeToKindMap = 511new Dictionary<Type, InternalDataKind> 579public static PrimitiveDataViewType OnnxToMlNetType(Type type)
Microsoft.ML.Parquet (2)
PartitionedFileLoader.cs (2)
681private Delegate MarshalGetter(Func<DataViewSchema.Column, ValueGetter<DataViewSchema.Column>> func, Type type, DataViewSchema.Column column) 683var returnType = typeof(ValueGetter<>).MakeGenericType(type);
Microsoft.ML.Predictor.Tests (1)
CmdLine\CmdLine.cs (1)
305var type = typeof(T);
Microsoft.ML.Recommender (1)
MatrixFactorizationTrainer.cs (1)
20new Type[] { typeof(SignatureTrainer), typeof(SignatureMatrixRecommendingTrainer) },
Microsoft.ML.Samples (1)
Program.cs (1)
14foreach (var type in Assembly.GetExecutingAssembly().GetTypes())
Microsoft.ML.Samples.GPU (1)
Program.cs (1)
15foreach (var type in types)
Microsoft.ML.SearchSpace (14)
Converter\ChoiceOptionConverter.cs (1)
28public override ChoiceOption Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Converter\NumericOptionConverter.cs (1)
37public override UniformNumericOption Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Converter\OptionConverter.cs (1)
16public override OptionBase Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Converter\ParameterConverter.cs (1)
15public override Parameter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Converter\SearchSpaceConverter.cs (1)
16public override SearchSpace Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameter.cs (2)
158private static Parameter FromEnum(Enum e, Type t) 172private static Parameter FromObject(object value, Type type)
SearchSpace.cs (7)
66protected SearchSpace(Type typeInfo, Parameter defaultOption = null) 172private Dictionary<string, OptionBase> GetOptionsFromType(Type typeInfo) 180private SearchSpace GetSearchSpaceOptionFromType(Type typeInfo) 193private Dictionary<string, OptionBase> GetOptionsFromField(Type typeInfo) 240private Dictionary<string, OptionBase> GetOptionsFromProperty(Type typeInfo) 287private void CheckOptionType(object attribute, string optionName, Type type) 303var supportTypes = new Type[] { typeof(string), typeof(int), typeof(short), typeof(long), typeof(float), typeof(double), typeof(char) };
Microsoft.ML.SearchSpace.Tests (2)
SearchSpaceTest.cs (2)
367public override double Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 378public override float Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Microsoft.ML.StandardTrainers (1)
Standard\LinearModelParameters.cs (1)
329Type type = GetType();
Microsoft.ML.Sweeper (1)
Parameters.cs (1)
522public bool TryParseParameter(string paramValue, Type paramType, string paramName, out IValueGenerator sweepValues, out string error)
Microsoft.ML.TensorFlow (1)
TensorflowTransform.cs (1)
647var type = Tf2MlNetType(_parent.TFOutputTypes[iinfo]).RawType;
Microsoft.ML.TensorFlow.Tests (1)
TensorFlowEstimatorTests.cs (1)
141Type type = typeof(TensorFlowTransformer);
Microsoft.ML.TestFramework (4)
DataPipe\TestDataPipeBase.cs (2)
885Type rawType = type.RawType; 935Type itemType = vectorType.ItemType.RawType;
SubComponent.cs (2)
207public static SubComponent Create(Type type) 213public static SubComponent Clone(SubComponent src, Type type = null)
Microsoft.ML.Tests (5)
CalibratedModelParametersTests.cs (3)
38Type expectedInternalType = typeof(ParameterMixingCalibratedModelParameters<LinearBinaryModelParameters, PlattCalibrator>); 60Type expectedInternalType = typeof(ValueMapperCalibratedModelParameters<GamBinaryModelParameters, PlattCalibrator>); 83Type expectedInternalType = typeof(FeatureWeightsCalibratedModelParameters<FastTreeBinaryModelParameters, PlattCalibrator>);
CollectionsDataViewTest.cs (1)
38public bool CompareObjectValues(object x, object y, Type type)
Transformers\NormalizerTests.cs (1)
724Type type = typeof(VectorWhiteningTransformer);
Microsoft.ML.Tokenizers (15)
Model\TiktokenTokenizer.cs (11)
1116private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(string modelName) => GetTiktokenConfigurations(GetModelEncoding(modelName), modelName); 1118private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(ModelEncoding modelEncoding, string? modelName = null) 1124{ { EndOfText, 100257}, { FimPrefix, 100258}, { FimMiddle, 100259}, { FimSuffix, 100260}, { EndOfPrompt, 100276} }, Cl100kBaseRegex(), Cl100kBaseVocabFile, Type.GetType(Cl100kBaseTypeName), Cl100kBasePackageName); 1127return (new Dictionary<string, int> { { EndOfText, 50256 }, }, P50kBaseRegex(), GPT2File, Type.GetType(Gpt2TypeName), Gpt2PackageName); 1130return (new Dictionary<string, int> { { EndOfText, 199999 }, { EndOfPrompt, 200018 } }, O200kBaseRegex(), O200kBaseFile, Type.GetType(O200kBaseTypeName), O200kBasePackageName); 1133return (new Dictionary<string, int> { { EndOfText, 50256 } }, P50kBaseRegex(), P50RanksFile, Type.GetType(P50kBaseTypeName), P50kBasePackageName); 1137{ { EndOfText, 50256 }, { FimPrefix, 50281 }, { FimMiddle, 50282 }, { FimSuffix, 50283 } }, P50kBaseRegex(), P50RanksFile, Type.GetType(P50kBaseTypeName), P50kBasePackageName); 1140return (new Dictionary<string, int> { { EndOfText, 50256 } }, P50kBaseRegex(), R50RanksFile, Type.GetType(R50kBaseTypeName), R50kBasePackageName); 1209(Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) tiktokenConfiguration = GetTiktokenConfigurations(modelEncoding, modelName); 1369(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName); 1409(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName);
Utils\StringSpanOrdinalKey.cs (3)
136public override StringSpanOrdinalKey ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => 142public override StringSpanOrdinalKey Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => new StringSpanOrdinalKey(reader.GetString()!); 148public override Vocabulary Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Utils\TokenizerExtensions.cs (1)
66public override SortedDictionary<int, string>? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => null;
Microsoft.ML.TorchSharp (2)
Utils\FileUtils.cs (2)
19private static readonly Type[] _validTypes = new Type[]
Microsoft.ML.Transforms (34)
Expression\BuiltinFunctions.cs (4)
37Type type = v.GetType(); 50public static object GetNA(Type type) 381Type type = fn.ReturnType; 392Type type = fn.ReturnType;
Expression\CodeGen.cs (5)
26private readonly Type _delType; 46Type typeFn; 63var types = new Type[node.Vars.Length + 1]; 832Type typeLoc; 1250Type type;
Expression\IlGeneratorExtensions.cs (2)
345public static ILGenerator Newarr(this ILGenerator il, Type type) 374public static ILGenerator Stelem(this ILGenerator il, Type type)
Expression\LambdaBinder.cs (2)
1177var type = ps[i].ParameterType; 1444var type = best.Method.GetParameters()[ivMax].ParameterType;
Expression\MethodGenerator.cs (7)
22public MethodGenerator(string name, Type thisType, Type returnType, params Type[] parameterTypes) 38public Delegate CreateDelegate(Type delegateType) 101public readonly Type Type; 104public LocalKey(Type type, bool isRef) 142public Temporary AcquireTemporary(Type type, bool isRef = false)
Expression\Node.cs (2)
344internal static Type ToSysType(ExprTypeKind kind) 365internal static ExprTypeKind ToExprTypeKind(Type type)
GroupTransform.cs (1)
454var type = typeof(ListAggregator<>);
MissingValueIndicatorTransformer.cs (1)
469Type rawType = (inputType is VectorDataViewType vectorType) ? vectorType.ItemType.RawType : inputType.RawType;
MissingValueReplacing.cs (1)
875Type rawType;
OptionalColumnTransform.cs (1)
546Type type = columnType.RawType;
PermutationFeatureImportanceExtensions.cs (6)
684var predictionTransformerGenericType = GetImplementedIPredictionTransformer(lastTransformer.GetType()); 686Type[] types = { predictionTransformerGenericType.GenericTypeArguments[0], typeof(TMetric), typeof(TResult) }; 687Type pfiGenericType = typeof(PermutationFeatureImportance<,,>).MakeGenericType(types); 724private static Type GetImplementedIPredictionTransformer(Type type) 726foreach (Type iType in type.GetInterfaces())
Text\NgramUtils.cs (1)
207public static bool IsValidNgramRawType(Type rawType)
UngroupTransform.cs (1)
506var rawItemType = info.ItemType.RawType;
Microsoft.TestUtilities (1)
XUnit\ConditionalTheoryDiscoverer.cs (1)
58var type = obj.GetType();
Microsoft.VisualBasic.Core (331)
Microsoft\VisualBasic\CompilerServices\ConversionResolution.vb (29)
139Dim Type1 As Type = MapTypeCodeToType(tc1) 140Dim Type2 As Type = MapTypeCodeToType(tc2) 300For Each interfaceConstraint As Type In GetInterfaceConstraints(sourceType) 313Dim classConstraint As Type = GetClassConstraint(sourceType) 335Dim classConstraint As Type = GetClassConstraint(targetType) 393Dim sourceElementType As Type = sourceArrayType.GetElementType 398Dim rawTargetInterface As Type = targetInterface.GetGenericTypeDefinition() 414GetType(System.Collections.Generic.IList(Of )).MakeGenericType(New Type() {sourceElementType})) 594Dim candidate As Type = types.Item(index) 621Dim candidate As Type = types.Item(index) 638ByVal targetType As Type, 639ByVal sourceType As Type, 759Dim sourceBases As List(Of Type) = New List(Of Type)(operatorSet.Count) 760Dim targetDeriveds As List(Of Type) = New List(Of Type)(operatorSet.Count) 761Dim sourceDeriveds As List(Of Type) = Nothing 762Dim targetBases As List(Of Type) = Nothing 765sourceDeriveds = New List(Of Type)(operatorSet.Count) 766targetBases = New List(Of Type)(operatorSet.Count) 1022Friend TargetType As Type 1023Friend SourceType As Type 1078ByVal targetType As Type, 1079ByVal sourceType As Type, 1099ByVal targetType As Type, 1100ByVal sourceType As Type, 1128Friend Type As Type 1180Friend Sub Insert(ByVal type As Type) 1194Friend Function Lookup(ByVal type As Type) As Boolean
Microsoft\VisualBasic\CompilerServices\Conversions.vb (19)
2332Dim ReflectedType As Type = GetType(T) 2371Private Shared Function CastSByteEnum(ByVal Expression As SByte, ByVal TargetType As Type) As Object 2376Private Shared Function CastByteEnum(ByVal Expression As Byte, ByVal TargetType As Type) As Object 2381Private Shared Function CastInt16Enum(ByVal Expression As Int16, ByVal TargetType As Type) As Object 2386Private Shared Function CastUInt16Enum(ByVal Expression As UInt16, ByVal TargetType As Type) As Object 2391Private Shared Function CastInt32Enum(ByVal Expression As Int32, ByVal TargetType As Type) As Object 2396Private Shared Function CastUInt32Enum(ByVal Expression As UInt32, ByVal TargetType As Type) As Object 2401Private Shared Function CastInt64Enum(ByVal Expression As Int64, ByVal TargetType As Type) As Object 2406Private Shared Function CastUInt64Enum(ByVal Expression As UInt64, ByVal TargetType As Type) As Object 2411Friend Shared Function ForceValueCopy(ByVal Expression As Object, ByVal TargetType As Type) As Object 2453Private Shared Function ChangeIntrinsicType(ByVal Expression As Object, ByVal TargetType As Type) As Object 2491ByVal TargetType As Type) As Object 2499ByVal TargetType As Type, 2516Dim SourceType As Type = Expression.GetType 2568ByVal TargetType As Type) As Object 2579ByVal TargetType As Type) As Object 2581Dim SourceType As Type = Expression.GetType 2674Friend Shared Function CanUserDefinedConvert(ByVal Expression As Object, ByVal TargetType As Type) As Boolean 2676Dim SourceType As Type = Expression.GetType
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (9)
821Public Sub New(ByVal t As Type) 1365Dim ObjectType As Type = GetType(Object) 1366Dim ObjectRefType As Type = ObjectType.MakeByRefType() 1367Dim CallSiteBinderType As Type = GetType(CallSiteBinder) 1370Dim CallSiteSignature(ArgLength + 2) As Type 1379Dim CallSiteDelegate As Type = Expression.GetDelegateType(CallSiteSignature) 1380Dim CallSiteType As Type = GetType(CallSite(Of )).MakeGenericType(CallSiteDelegate) 1450Dim delegateArgTypes(arguments.Length + 2) As Type 1477Dim delegateArgTypes(2) As Type
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (13)
57ByVal objType As Type, 218ByVal objType As Type, 244ByVal objType As Type, 257ByRef objType As Type, 480Private Shared Sub CheckForClassExtendingCOMClass(ByVal objType As Type) 497Dim objType As Type 658ByVal typ As Type, 734Dim objType As Type 763Dim elemType As Type 924ByVal objType As Type, 938ByVal objType As Type, 1069ByVal objType As Type, 1200ByVal objType As Type) As <DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)> IReflect
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (15)
368ByVal TypeArguments As Type(), 418ByVal typeArguments As Type(), 823ByVal Type As Type, 827ByVal TypeArguments() As Type, 862ByVal type As Type, 866ByVal typeArguments() As Type, 878ByVal Type As Type, 882ByVal TypeArguments As Type()) 909ByVal type As Type, 913ByVal typeArguments As Type()) 925ByVal Type As Type, 929ByVal TypeArguments As Type(), 1270Dim customModifierTypes As Type() = method?.ReturnParameter.GetRequiredCustomModifiers() 1272For Each customModifierType As Type In customModifierTypes 1288ByVal typeArguments As Type(),
Microsoft\VisualBasic\CompilerServices\ObjectFlowControl.vb (13)
39Private _enumType As Type 40Private _widestType As Type 52Private Shared Function GetWidestType(ByVal type1 As System.Type, ByVal type2 As System.Type) As Type 78Private Shared Function GetWidestType(ByVal type1 As System.Type, ByVal type2 As System.Type, ByVal type3 As System.Type) As Type 86ByVal sourceType As Type, 88ByVal targetType As Type) As Object 102ByVal forLoopArgumentType As Type) As Method 155Dim startType As Type = Start.GetType() 156Dim limitType As Type = Limit.GetType() 157Dim stepType As Type = StepValue.GetType() 159Dim widestType As Type = GetWidestType(stepType, startType, limitType) 185Dim currentEnumType As Type = Nothing 275Dim widestType As Type = GetWidestType(MapTypeCodeToType(counterTypeCode), loopFor._widestType)
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (14)
232Friend Shared Function TypeFromTypeCode(ByVal vartyp As TypeCode) As Type 297Friend Shared Function IsWiderNumeric(ByVal Type1 As Type, ByVal Type2 As Type) As Boolean 327Friend Shared Function IsWideningConversion(ByVal FromType As Type, ByVal ToType As Type) As Boolean 1123Dim Type1 As Type 1210Dim Type1 As Type = Nothing 1211Dim Type2 As Type = Nothing 1307Dim Type1 As Type = Nothing 1308Dim Type2 As Type = Nothing 1404Dim Type1 As Type = Nothing 1405Dim Type2 As Type = Nothing 3516Friend Overloads Shared Function CTypeHelper(ByVal obj As Object, ByVal toType As Type) As Object 3550Dim toTypeCode As TypeCode = Type.GetTypeCode(toType)
Microsoft\VisualBasic\CompilerServices\Operators.Resolution.vb (3)
61Dim commonAncestor As Type = type1 133Dim leftType As Type 134Dim rightType As Type = Nothing
Microsoft\VisualBasic\CompilerServices\Operators.vb (34)
54Private Shared Function GetEnumResult(ByVal left As Object, ByVal right As Object) As Type 68Dim leftType As Type = left.GetType 1192Private Shared Function NotSByte(ByVal operand As SByte, ByVal operandType As Type) As Object 1201Private Shared Function NotByte(ByVal operand As Byte, ByVal operandType As Type) As Object 1210Private Shared Function NotInt16(ByVal operand As Int16, ByVal operandType As Type) As Object 1219Private Shared Function NotUInt16(ByVal operand As UInt16, ByVal operandType As Type) As Object 1228Private Shared Function NotInt32(ByVal operand As Int32, ByVal operandType As Type) As Object 1237Private Shared Function NotUInt32(ByVal operand As UInt32, ByVal operandType As Type) As Object 1250Private Shared Function NotInt64(ByVal operand As Int64, ByVal operandType As Type) As Object 1259Private Shared Function NotUInt64(ByVal operand As UInt64, ByVal operandType As Type) As Object 1592Private Shared Function AndSByte(ByVal left As SByte, ByVal right As SByte, Optional ByVal enumType As Type = Nothing) As Object 1599Private Shared Function AndByte(ByVal left As Byte, ByVal right As Byte, Optional ByVal enumType As Type = Nothing) As Object 1606Private Shared Function AndInt16(ByVal left As Int16, ByVal right As Int16, Optional ByVal enumType As Type = Nothing) As Object 1613Private Shared Function AndUInt16(ByVal left As UInt16, ByVal right As UInt16, Optional ByVal enumType As Type = Nothing) As Object 1620Private Shared Function AndInt32(ByVal left As Int32, ByVal right As Int32, Optional ByVal enumType As Type = Nothing) As Object 1627Private Shared Function AndUInt32(ByVal left As UInt32, ByVal right As UInt32, Optional ByVal enumType As Type = Nothing) As Object 1634Private Shared Function AndInt64(ByVal left As Int64, ByVal right As Int64, Optional ByVal enumType As Type = Nothing) As Object 1641Private Shared Function AndUInt64(ByVal left As UInt64, ByVal right As UInt64, Optional ByVal enumType As Type = Nothing) As Object 1964Private Shared Function OrSByte(ByVal left As SByte, ByVal right As SByte, Optional ByVal enumType As Type = Nothing) As Object 1971Private Shared Function OrByte(ByVal left As Byte, ByVal right As Byte, Optional ByVal enumType As Type = Nothing) As Object 1978Private Shared Function OrInt16(ByVal left As Int16, ByVal right As Int16, Optional ByVal enumType As Type = Nothing) As Object 1985Private Shared Function OrUInt16(ByVal left As UInt16, ByVal right As UInt16, Optional ByVal enumType As Type = Nothing) As Object 1992Private Shared Function OrInt32(ByVal left As Int32, ByVal right As Int32, Optional ByVal enumType As Type = Nothing) As Object 1999Private Shared Function OrUInt32(ByVal left As UInt32, ByVal right As UInt32, Optional ByVal enumType As Type = Nothing) As Object 2006Private Shared Function OrInt64(ByVal left As Int64, ByVal right As Int64, Optional ByVal enumType As Type = Nothing) As Object 2013Private Shared Function OrUInt64(ByVal left As UInt64, ByVal right As UInt64, Optional ByVal enumType As Type = Nothing) As Object 2357Private Shared Function XorSByte(ByVal left As SByte, ByVal right As SByte, Optional ByVal enumType As Type = Nothing) As Object 2364Private Shared Function XorByte(ByVal left As Byte, ByVal right As Byte, Optional ByVal enumType As Type = Nothing) As Object 2371Private Shared Function XorInt16(ByVal left As Int16, ByVal right As Int16, Optional ByVal enumType As Type = Nothing) As Object 2378Private Shared Function XorUInt16(ByVal left As UInt16, ByVal right As UInt16, Optional ByVal enumType As Type = Nothing) As Object 2385Private Shared Function XorInt32(ByVal left As Int32, ByVal right As Int32, Optional ByVal enumType As Type = Nothing) As Object 2392Private Shared Function XorUInt32(ByVal left As UInt32, ByVal right As UInt32, Optional ByVal enumType As Type = Nothing) As Object 2399Private Shared Function XorInt64(ByVal left As Int64, ByVal right As Int64, Optional ByVal enumType As Type = Nothing) As Object 2406Private Shared Function XorUInt64(ByVal left As UInt64, ByVal right As UInt64, Optional ByVal enumType As Type = Nothing) As Object
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (65)
67Dim type1 As Type = shorterSignature(i).ParameterType 68Dim type2 As Type = longerSignature(i).ParameterType 90ByVal leftType As Type, 91ByVal rightType As Type, 121ByVal argumentType As Type, 134Dim leftType As Type = leftParameter.ParameterType 135Dim rightType As Type = rightParameter.ParameterType 235Dim leftType As Type = leftParameter.ParameterType 236Dim rightType As Type = rightParameter.ParameterType 240Dim rawLeftType As Type = rawLeftParameter.ParameterType 241Dim rawRightType As Type = rawRightParameter.ParameterType 303Dim leftType As Type = leftParameter.ParameterType 304Dim rightType As Type = rightParameter.ParameterType 308Dim rawLeftType As Type = rawLeftParameter.ParameterType 309Dim rawRightType As Type = rawRightParameter.ParameterType 342Dim leftDeclaringType As Type = leftMember.RawDeclaringType 343Dim rightDeclaringType As Type = rightMember.RawDeclaringType 486ByVal typeArguments As Type(), 718ByVal typeArguments As Type(), 745Dim currentScope As Type = members(index).DeclaringType 927ByVal targetType As Type, 928ByVal sourceType As Type, 985ByVal argumentType As Type, 986ByVal parameterType As Type, 987ByVal typeInferenceArguments As Type(), 1014Dim rawGenericParameterType As Type = parameterType.GetGenericTypeDefinition 1031GetType(System.Collections.Generic.IList(Of )).MakeGenericType(New Type() {argumentType.GetElementType}) 1057Dim base As Type = argumentType.BaseType 1073Dim implementedMatch As Type = Nothing 1074For Each implemented As Type In argumentType.GetInterfaces 1110ByVal argumentType As Type, 1111ByVal parameterType As Type, 1112ByVal typeInferenceArguments As Type(), 1145Dim bestMatchType As Type = Nothing 1153For Each possibleGenericType As Type In argumentType.GetInterfaces 1168Dim parameterTypeParameters As Type() = GetTypeArguments(parameterType) 1169Dim argumentTypeArguments As Type() = GetTypeArguments(bestMatchType) 1224Dim parameterType As Type = parameter.ParameterType 1225Dim argumentType As Type = GetArgumentType(argument) 1244Dim parameterType As Type = parameter.ParameterType 1250Dim argumentType As Type = GetArgumentType(argument) 1312Dim parameterType As Type = parameter.ParameterType 1318Dim argumentType As Type = GetArgumentType(argument) 1341ByVal parameterType As Type) As Object 1371Dim argumentType As Type = GetArgumentType(argument) 1412ByVal typeArguments As Type(), 1433typeArguments = New Type(targetProcedure.TypeParameters.Length - 1) {} 1668ByVal typeArguments As Type(), 1850ByVal typeArguments As Type(), 2059ByVal typeArguments As Type(), 2111ByVal typeArguments As Type()) 2131Private Shared Function GetArgumentType(ByVal argument As Object) As Type 2169Dim argumentType As Type = GetArgumentType(arguments(argIndex)) 2240Dim argumentType As Type = GetArgumentType(arguments(argIndex)) 2459ByVal substitution2 As Type, 2460ByVal substitution3 As Type) 2507ByVal typeArguments As Type(), 2517ByVal typeArguments As Type(), 2586ByVal typeArguments As Type(), 2608ByVal typeArguments As Type(), 2628ByVal typeArguments As Type(), 2650ByVal typeArguments As Type(), 2669ByVal typeArguments As Type(), 2703ByVal typeArguments As Type(), 2803ByVal typeArguments As Type(),
Microsoft\VisualBasic\CompilerServices\StructUtils.vb (1)
181Select Case Type.GetTypeCode(FieldType)
Microsoft\VisualBasic\CompilerServices\Symbols.vb (45)
60Friend Shared ReadOnly NoTypeArguments As Type() = Array.Empty(Of Type)() 61Friend Shared ReadOnly NoTypeParameters As Type() = Array.Empty(Of Type)() 205Friend Shared Function MapTypeCodeToType(ByVal typeCode As TypeCode) As <DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)> Type 434For Each implemented As Type In implementor.GetInterfaces 459For Each typeConstraint As Type In derived.GetGenericParameterConstraints 467For Each baseInterface As Type In derived.GetInterfaces 481Friend Shared Function IsGeneric(ByVal type As Type) As Boolean 485Friend Shared Function IsInstantiatedGeneric(ByVal type As Type) As Boolean 510Friend Shared Function GetTypeParameters(ByVal member As MemberInfo) As Type() 516Friend Shared Function GetTypeArguments(ByVal type As Type) As Type() 521Friend Shared Function GetInterfaceConstraints(<DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)> ByVal genericParameter As Type) As Type() 527Friend Shared Function GetClassConstraint(ByVal genericParameter As Type) As Type 533Dim classConstraint As Type = genericParameter.BaseType 538Friend Shared Function IndexIn(ByVal possibleGenericParameter As Type, ByVal genericMethodDef As MethodBase) As Integer 552Friend Shared Function RefersToGenericParameter(ByVal referringType As Type, ByVal method As MethodBase) As Boolean 571For Each param As Type In GetTypeArguments(referringType) 592Friend Shared Function RefersToGenericParameterCLRSemantics(ByVal referringType As Type, ByVal typ As Type) As Boolean 609For Each param As Type In GetTypeArguments(referringType) 677Friend Shared Function GetElementType(ByVal type As System.Type) As Type 684ByVal returnType As Type) As Boolean 757Dim leftType As Type = left.DeclaringType 758Dim rightType As Type = right.DeclaringType 778Private ReadOnly _type As Type 793ByVal type As Type) 809Dim curType As Type = _type 870Dim returnType As Type = Nothing 941For Each implemented As Type In _type.GetInterfaces() 968Dim classConstraint As Type = GetClassConstraint(_type) 1005For Each implemented As Type In _type.GetInterfaces() 1018Private Function LookupDefaultMembers(ByRef defaultMemberName As String, ByVal searchType As Type) As MemberInfo() 1027Dim current As Type = searchType 1212Dim elementType As Type = _type.GetElementType 1309Private _rawDeclaringType As Type 'The uninstantiated type containing this method. 1321Friend TypeArguments As Type() 'Set of type arguments either supplied or inferred for this method. 1404Friend ReadOnly Property DeclaringType() As Type 1410Friend ReadOnly Property RawDeclaringType() As Type 1460Friend ReadOnly Property TypeParameters() As Type() 1555Friend ReadOnly Type As Type 1557Friend Sub New(ByVal type As Type)
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (7)
49Private Shared ReadOnly s_voidType As Type = System.Type.GetType("System.Void") 441Private Shared Function GetArraySuffixAndElementType(ByRef typ As Type) As String 465Private Shared Function GetGenericArgsSuffix(ByVal typ As Type) As String 471Dim typeArgs As Type() = typ.GetGenericArguments 503Dim parameterType As Type = parameter.ParameterType 594For Each t As Type In GetTypeParameters(method) 637Dim propertyType As Type
Microsoft\VisualBasic\CompilerServices\Utils.vb (15)
124Public Function GetTypeCode(type As Type) As TypeCode 125Return Type.GetTypeCode(type) 236Private Function IsGenericallyEqual(t1 As Type, t2 As Type) As Boolean 247Dim t1def As Type = If(t1.IsConstructedGenericType, t1.GetGenericTypeDefinition(), t1) 248Dim t2def As Type = If(t2.IsConstructedGenericType, t2.GetGenericTypeDefinition(), t2) 259Private Function IsGenericallyEquivalentTo(t1 As Type, t2 As Type, member1 As MemberInfo, member2 As MemberInfo) As Boolean 295Dim args1 As Type() = t1.GetGenericArguments() 296Dim args2 As Type() = t2.GetGenericArguments() 321Private Function IsTypeParameterEquivalentToTypeInst(typeParam As Type, typeInst As Type, member As MemberInfo) As Boolean 334Dim args As Type() = If(method.IsGenericMethod, method.GetGenericArguments(), Nothing) 350Dim MemberInfo As Type = GetType(MethodBase) 351Dim [property] As PropertyInfo = MemberInfo.GetProperty("MetadataToken", GetType(Integer), Array.Empty(Of Type)())
Microsoft\VisualBasic\CompilerServices\VB6File.vb (8)
151Select Case Type.GetTypeCode(FieldType) 266Select Case Type.GetTypeCode(FieldType) 901Select Case Type.GetTypeCode(typ) 2137Dim typ As Type 2171Select Case Type.GetTypeCode(typ) 2233Dim SpcInfoType As Type = GetType(SpcInfo) 2234Dim CurrentType As Type = SpcInfoType 2264Select Case Type.GetTypeCode(CurrentType)
Microsoft\VisualBasic\CompilerServices\VB6RandomFile.vb (4)
208Select Case Type.GetTypeCode(typ) 307Dim typ As Type = Value.GetType().GetElementType 435Dim typ As Type 456Select Case Type.GetTypeCode(typ)
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (21)
156Dim ArgTypes() As Type 157Dim ArgType As Type = Nothing 158Dim ParmType As Type = Nothing 159Dim ParamArrayElementType As Type = Nothing 524ArgTypes = New Type(args.Length - 1) {} 609If (ArgType Is Type.Missing) AndAlso Parameters(ParmIndex).IsOptional Then 826If (ArgType Is Type.Missing) AndAlso Parameters(ParmIndex).IsOptional Then 1260Dim Type0, Type1 As Type 1265Dim ParamArrayElementType0 As Type = Nothing 1266Dim ParamArrayElementType1 As Type = Nothing 1480Dim paramType0, paramType1 As Type 1526Dim paramType1, paramType2 As Type 1593Public Overrides Function SelectMethod(ByVal bindingAttr As BindingFlags, ByVal match() As MethodBase, ByVal types() As Type, ByVal modifiers() As ParameterModifier) As MethodBase 1600Public Overrides Function SelectProperty(ByVal bindingAttr As BindingFlags, ByVal match() As PropertyInfo, ByVal returnType As Type, ByVal indexes() As Type, ByVal modifiers() As ParameterModifier) As PropertyInfo 1608Dim Type0, Type1 As Type 1756Public Overrides Function ChangeType(ByVal value As Object, ByVal typ As Type, ByVal culture As CultureInfo) As Object 1769Private Function BindingScore(ByVal Parameters() As ParameterInfo, ByVal paramOrder() As Integer, ByVal ArgTypes() As Type, ByVal IsPropertySet As Boolean, ByVal ParamArrayIndex As Integer) As BindScore 1772Dim ArgType, ParmType As Type 2036Private Function GetDefaultMemberName(ByVal typ As Type) As String 2255Friend Shared Sub SecurityCheckForLateboundCalls(ByVal member As MemberInfo, ByVal objType As Type, ByVal objIReflect As IReflect)
Microsoft\VisualBasic\ErrObject.vb (1)
370Dim typ As Type = e.GetType()
Microsoft\VisualBasic\FileIO\SpecialDirectories.vb (2)
165Dim type As Type = Type.GetType($"{typeName}, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError:=False)
Microsoft\VisualBasic\Information.vb (2)
285Select Case Type.GetTypeCode(typ) 450tc = Type.GetTypeCode(typ)
Microsoft\VisualBasic\Interaction.vb (7)
138Dim type As Type = Type.GetType("Microsoft.VisualBasic._Interaction, Microsoft.VisualBasic.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError:=False) 506Dim t As Type 523t = Type.GetTypeFromProgID(ProgId) 525t = Type.GetTypeFromProgID(ProgId, ServerName, True) 564Dim t As Type = Type.GetTypeFromProgID([Class])
Microsoft\VisualBasic\Strings.vb (4)
25Private Function GetFormat(ByVal service As Type) As Object Implements IFormatProvider.GetFormat 1347Dim typ As Type 1430Dim typ As Type 1792Dim typ As Type
Microsoft.VisualBasic.Tests (2)
Microsoft\VisualBasic\ApplicationServices\SingleInstanceTests.cs (1)
37var type = assembly.GetType("Microsoft.VisualBasic.ApplicationServices.SingleInstanceHelpers");
Microsoft\VisualBasic\MyServices\ClipboardProxyTests.cs (1)
154public static Type Resolver(TypeName typeName) =>
Microsoft.VisualStudio.LanguageServices (34)
artifacts\obj\Microsoft.VisualStudio.LanguageServices\Release\net472\DocumentOutline\DocumentOutlineView.g.cs (1)
102internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
artifacts\obj\Microsoft.VisualStudio.LanguageServices\Release\net472\ExtractClass\ExtractClassDialog.g.cs (1)
99internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
artifacts\obj\Microsoft.VisualStudio.LanguageServices\Release\net472\ExtractInterface\ExtractInterfaceDialog.g.cs (1)
109internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
artifacts\obj\Microsoft.VisualStudio.LanguageServices\Release\net472\GeneratedInternalTypeHelper.g.cs (2)
24protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) { 46protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
artifacts\obj\Microsoft.VisualStudio.LanguageServices\Release\net472\PickMembers\PickMembersDialog.g.cs (1)
141internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
DebuggerIntelliSense\DebuggerTextView.HACK_CompletionSession.cs (1)
52var shimControllerType = shimController.GetType();
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.cs (6)
31private readonly Type _typeIExtensionContent; 36internal VisualStudioDiagnosticAnalyzerProvider(object extensionManager, Type typeIExtensionContent) 58var extensionManagerType = _extensionManager.GetType(); 64var extensionType = extension.GetType(); 67var extension_HeaderType = extension_Header.GetType(); 114var contentType = content.GetType();
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.Factory.cs (2)
51var typeIExtensionContent = assembly.GetType("Microsoft.VisualStudio.ExtensionManager.IExtensionContent"); 52var type = assembly.GetType("Microsoft.VisualStudio.ExtensionManager.SVsExtensionManager");
DocumentOutline\DocumentSymbolDataViewModelSorter.cs (2)
22public object Convert(object[] values, Type targetType, object? parameter, CultureInfo culture) 42public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
ErrorReporting\VisualStudioErrorReportingService.ExceptionFormatting.cs (4)
92private static bool ShouldShowFrame(Type declaringType) 95private static string FormatFrame(MethodBase method, Type declaringType) 129private static bool FormatMethodName(StringBuilder stringBuilder, Type declaringType) 161private static void FormatGenericArguments(StringBuilder stringBuilder, Type[] genericTypeArguments)
LanguageService\AbstractPackage`2.cs (1)
113protected void RegisterLanguageService(Type t, Func<CancellationToken, Task<object>> serviceCreator)
Options\IVisualStudioStorageReadFallback.cs (1)
10internal delegate Optional<object?> TryReadValueDelegate(string storageKey, Type storageType, object? defaultValue);
Options\VisualStudioSettingsOptionPersister.cs (4)
89public Optional<object?> TryReadAndMonitorOptionValue(OptionKey2 primaryOptionKey, string primaryStorageKey, string storageKey, Type storageType, object? defaultValue) 96internal static Optional<object?> TryReadOptionValue(ISettingsManager manager, string storageKey, Type storageType, object? defaultValue) 110var underlyingType = Nullable.GetUnderlyingType(storageType); 226var type = value.GetType();
ProjectSystem\MetadataReferences\VisualStudioFrameworkAssemblyPathResolverFactory.cs (1)
87var type = assembly.GetType(name, throwOnError: false);
RoslynPackage.cs (2)
258protected override string GetToolWindowTitle(Type toolWindowType, int id) 261protected override Task<object?> InitializeToolWindowAsync(Type toolWindowType, int id, CancellationToken cancellationToken)
Utilities\BooleanReverseConverter.cs (2)
15public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 18public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Utilities\EnumBoolConverter.cs (2)
21public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 24public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Microsoft.VisualStudio.LanguageServices.CSharp (3)
artifacts\obj\Microsoft.VisualStudio.LanguageServices.CSharp\Release\net472\GeneratedInternalTypeHelper.g.cs (2)
24protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) { 46protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
artifacts\obj\Microsoft.VisualStudio.LanguageServices.CSharp\Release\net472\Options\Formatting\FormattingOptionPageControl.g.cs (1)
106internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
EditorConfigSettings\Aggregator\SettingsAggregatorTests.cs (1)
19public static Workspace CreateWorkspace(params Type[]? additionalParts)
Options\OptionViewModelTests.cs (1)
33public object GetService(Type serviceType)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Implementation\LanguageServer\ExportStatelessXamlLspServiceAttribute.cs (1)
15public ExportStatelessXamlLspServiceAttribute(Type handlerType) : base(handlerType, StringConstants.XamlLspLanguagesContract, WellKnownLspServerKinds.XamlLspServer)
Microsoft.Win32.Registry (3)
artifacts\obj\Microsoft.Win32.Registry\Debug\net10.0\Microsoft.Win32.Registry.notsupported.cs (3)
161public override System.Type AccessRightType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } } 162public override System.Type AccessRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } } 163public override System.Type AuditRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } }
MockHostTypes (1)
ServiceProvider.cs (1)
10public object GetService(Type serviceType) => null;
MSBuild (46)
BuildEnvironmentHelper.cs (1)
399var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
LoadedType.cs (5)
30internal LoadedType(Type type, AssemblyLoadInfo assemblyLoadInfo, Assembly loadedAssembly, Type iTaskItemType, bool loadedViaMetadataLoadContext = false) 50Type t = type; 95Type pt = props[i].PropertyType; 164internal Type Type { get; private set; }
LogMessagePacketBase.cs (4)
431Type eventDerivedType = _buildEvent.GetType(); 510Type eventDerivedType = _buildEvent.GetType(); 588private static Delegate CreateDelegateRobust(Type type, Object firstArgument, MethodInfo methodInfo) 679Type eventType = eventArg.GetType();
PrintLineDebugger.cs (1)
26var commonWriterType = typeof(ITask).Assembly.GetType("Microsoft.Build.Shared.Debugging.CommonWriter", true, false);
ReflectableTaskPropertyInfo.cs (2)
27private Type _taskType; 34internal ReflectableTaskPropertyInfo(TaskPropertyInfo taskPropertyInfo, Type taskType)
TaskLoader.cs (2)
35internal static bool IsTaskClass(Type type, object unused) 138Type taskType = taskInstanceInOtherAppDomain.GetType();
TaskParameter.cs (4)
105Type wrappedParameterType = wrappedParameter.GetType(); 122TypeCode typeCode = Type.GetTypeCode(wrappedParameterType.GetElementType()); 168TypeCode typeCode = Type.GetTypeCode(wrappedParameterType); 621Type elementType = _parameterTypeCode switch
TaskParameterTypeVerifier.cs (6)
23internal static bool IsValidScalarInputParameter(Type parameterType) => 29internal static bool IsValidVectorInputParameter(Type parameterType) 40internal static bool IsAssignableToITask(Type parameterType) 50internal static bool IsValueTypeOutputParameter(Type parameterType) 62internal static bool IsValidInputParameter(Type parameterType) 70internal static bool IsValidOutputParameter(Type parameterType)
TypeLoader.cs (19)
34private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>(); 39private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfReflectionOnlyLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>(); 44private Func<Type, object, bool> _isDesiredType; 68internal TypeLoader(Func<Type, object, bool> isDesiredType) 241private LoadedType GetLoadedType(ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> cache, string typeName, AssemblyLoadInfo assembly, bool useTaskHost) 273private Func<Type, object, bool> _isDesiredType; 283private ConcurrentDictionary<string, Type> _typeNameToType; 288private Dictionary<string, Type> _publicTypeNameToType; 307internal AssemblyInfoToLoadedTypes(Func<Type, object, bool> typeFilter, AssemblyLoadInfo loadInfo) 315_publicTypeNameToType = new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase); 332Type type = _typeNameToType.GetOrAdd(typeName, (key) => 339Type t2 = Type.GetType(typeName + "," + _assemblyLoadInfo.AssemblyName, false /* don't throw on error */, true /* case-insensitive */); 365foreach (KeyValuePair<string, Type> desiredTypeInAssembly in _publicTypeNameToType) 387foreach (Type publicType in loadedAssembly.GetExportedTypes()) 417Type[] allPublicTypesInAssembly = _loadedAssembly.GetExportedTypes(); 418foreach (Type publicType in allPublicTypesInAssembly)
XMake.cs (2)
1338Type t1 = loggers[0].GetType(); 1339Type t2 = typeof(ConsoleLogger);
MSBuildTaskHost (40)
AssemblyUtilities.cs (2)
69public static Type GetTypeInfo(this Type t)
BinaryTranslator.cs (1)
492Type enumType = value.GetType();
BuildEnvironmentHelper.cs (1)
399var testInfoType = frameworkAssembly.GetType("Microsoft.Build.Framework.TestInfo");
BuildExceptionSerializationHelper.cs (5)
14public TypeConstructionTuple(Type type, Func<string, Exception?, BuildExceptionBase> factory) 20public Type Type { get; } 29internal static bool IsSupportedExceptionType(Type type) 53Type exceptionType = typeConstructionTuple.Type; 71internal static string GetExceptionSerializationKey(Type exceptionType)
Concurrent\ConcurrentDictionary.cs (2)
66Type valueType = typeof(TValue); 72switch (Type.GetTypeCode(valueType))
LoadedType.cs (3)
30internal LoadedType(Type type, AssemblyLoadInfo assemblyLoadInfo, Assembly loadedAssembly, Type iTaskItemType, bool loadedViaMetadataLoadContext = false) 164internal Type Type { get; private set; }
LogMessagePacketBase.cs (4)
431Type eventDerivedType = _buildEvent.GetType(); 510Type eventDerivedType = _buildEvent.GetType(); 588private static Delegate CreateDelegateRobust(Type type, Object firstArgument, MethodInfo methodInfo) 679Type eventType = eventArg.GetType();
TaskLoader.cs (2)
35internal static bool IsTaskClass(Type type, object unused) 138Type taskType = taskInstanceInOtherAppDomain.GetType();
TaskParameter.cs (4)
105Type wrappedParameterType = wrappedParameter.GetType(); 122TypeCode typeCode = Type.GetTypeCode(wrappedParameterType.GetElementType()); 168TypeCode typeCode = Type.GetTypeCode(wrappedParameterType); 621Type elementType = _parameterTypeCode switch
TaskParameterTypeVerifier.cs (6)
23internal static bool IsValidScalarInputParameter(Type parameterType) => 29internal static bool IsValidVectorInputParameter(Type parameterType) 40internal static bool IsAssignableToITask(Type parameterType) 50internal static bool IsValueTypeOutputParameter(Type parameterType) 62internal static bool IsValidInputParameter(Type parameterType) 70internal static bool IsValidOutputParameter(Type parameterType)
TypeLoader.cs (10)
199private Concurrent.ConcurrentDictionary<string, Type> _typeNameToType; 204private Dictionary<string, Type> _publicTypeNameToType; 228_typeNameToType = new Concurrent.ConcurrentDictionary<string, Type>(StringComparer.OrdinalIgnoreCase); 229_publicTypeNameToType = new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase); 241Type type = _typeNameToType.GetOrAdd(typeName, (key) => 248Type t2 = Type.GetType(typeName + "," + _assemblyLoadInfo.AssemblyName, false /* don't throw on error */, true /* case-insensitive */); 274foreach (KeyValuePair<string, Type> desiredTypeInAssembly in _publicTypeNameToType) 316Type[] allPublicTypesInAssembly = _loadedAssembly.GetExportedTypes(); 317foreach (Type publicType in allPublicTypesInAssembly)
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1208[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Type))]
Mvc.Api.Analyzers.Test (11)
ActualApiResponseMetadataFactoryTest.cs (1)
441var controllerType = variant switch
MvcFactsTest.cs (5)
14private static readonly Type TestIsControllerActionType = typeof(TestIsControllerAction); 63private async Task IsControllerReturnsFalse(Type type) 77private async Task IsControllerReturnsTrue(Type type) 147private async Task IsActionReturnsFalse(Type type, string methodName) 194private async Task IsActionReturnsTrue(Type type, string methodName)
SymbolApiConventionMatcherTest.cs (2)
270public async Task IsTypeMatch_WithAny_ReturnsTrue(Type type, Type conventionType)
SymbolApiResponseMetadataProviderTest.cs (2)
293var type = typeof(GetDeclaredResponseMetadata_ApiConventionTypeAttributeOnType); 315var type = typeof(GetDeclaredResponseMetadata_ApiConventionTypeAttributeOnBaseType);
TestFiles\SymbolApiResponseMetadataProviderTest\GetResponseMetadataTests.cs (1)
59public Type Type { get; set; }
Mvc.RoutingWebSite (3)
ControllerRouteTokenTransformerConvention.cs (2)
10private readonly Type _controllerType; 12public ControllerRouteTokenTransformerConvention(Type controllerType, IOutboundParameterTransformer parameterTransformer)
RemoveControllerActionDescriptorProvider.cs (1)
45public Type ControllerType { get; set; }
netstandard (1)
netstandard.cs (1)
2209[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Type))]
PresentationBuildTasks (403)
MS\Internal\MarkupCompiler\MarkupCompiler.cs (28)
1041Type eventTarget; 1779private CodeExpression GetPropertyValueExpression(ITypeDescriptorContext ctx, Type typeToConvertTo, Object value, string attributeValue) 1889private Type GetEventHandlerType(MemberInfo memberInfo) 1891Type eventHandlerType = null; 1924Type eventTarget = cc != null ? cc.ElementType : miEvent.DeclaringType; 1932Type eventHandlerType = GetEventHandlerType(miEvent); 1969private CodeStatement AddCLREvent(Type eventTarget, CodeContext cc, CodeExpression ce, MarkupEventInfo mei) 2032Type eventHandlerType = GetEventHandlerType(mei.mi); 2177Type resourceDictionary = KnownTypes.Types[(int)KnownElements.ResourceDictionary]; 2178Type iNameScope = KnownTypes.Types[(int)KnownElements.INameScope]; 2182Type t = ((CodeContext)contexts[i]).ElementType; 2252Type currTypeArg = parserContext.XamlTypeMapper.GetTypeArgsType(_typeArgsList[i].Trim(), 2294private static CodeTypeReference GenerateConstructedTypeReference(Type t, string [] typeArgsList, string genericName) 2339private static CodeTypeReference GenerateConstructedTypeReference(Type t, string [] typeArgsList, Type refType, string refTypeFullName, string eventName) 2346Type[] refTypeParams = null; 2348Type[] typeParams = t.GetGenericArguments(); 2365foreach (Type typeParam in typeParams) 2446private CodeTypeDeclaration GenerateClass(string className, ref string modifier, Type baseClass, string baseClassFullName) 2490private CodeContext GenerateSubClass(ref string className, ref string modifier, Type baseClass, string baseClassFullName) 2565CodeParameterDeclarationExpression param1 = new CodeParameterDeclarationExpression(typeof(Type), DELEGATETYPE); 2758CodeParameterDeclarationExpression param1 = new CodeParameterDeclarationExpression(typeof(Type), TYPE); 2857param1 = new CodeParameterDeclarationExpression(typeof(Type), DELEGATETYPE); 2962internal string StartElement(ref string className, string subClassFullName, ref string modifier, Type elementType, string baseClassFullName) 3333internal CodeContext(Type elementType, string [] typeArgsList, string localElementFullName) 3340internal Type ElementType 3382private Type _elementType = null; 3392Type elementType,
MS\Internal\MarkupCompiler\ParserExtension.cs (4)
100Type rootType = isRootPublic ? xamlObjectNode.ElementType : typeof(ParserExtension); 286Type ownerTagType = typeAndSerializer.ObjectType; 396ref Type baseType, 397ref Type serializerType)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\AttributeData.cs (8)
56Type targetType, 58Type declaringType, 61Type serializerType, 82internal Type SerializerType; // Type of serializer (if any) 113Type targetType, 115Type declaringType, 134internal Type TargetType; // Target type 135internal Type DeclaringType; // Type where Attribute is declared
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (28)
94internal static Type GetKnownTypeFromId(short id) 123Type probeType = KnownTypes.Types[probe]; 158internal static short GetKnownTypeIdFromType(Type type) 280internal Type GetKnownConverterTypeFromType(Type type) 301if (type == typeof(System.Type)) 326private static Type GetKnownConverterTypeFromPropName( 327Type propOwnerType, 953internal short GetAttributeOrTypeId(BinaryWriter binaryWriter, Type declaringType, string memberName, out short typeId) 1207Type elementType, 1291Type owningType, // Actual type of the object the owns or declares this attribute 1293Type attributeType, // Type of the attribute or property itself; not its owner type 1304Type owningType, // Actual type of the object the owns or declares this attribute 1306Type attributeType, // Type of the attribute or property itself; not its owner type 1318Type serializerType = XamlTypeMapper.GetXamlSerializerForType(owningType); 1369Type ownerType, // Type of object that owns or declares this attribute 1370Type attributeType, // Type of the attribute or property itself; not its owner type 1374out Type converterOrSerializerType) 1485Type defaultTargetType) 1488Type targetType = null; 1534Type declaringType, // Type of object that owns or declares this attribute 1535Type attributeType) // Type of the attribute or property itself; not its owner type 1553private Type GetCustomConverter( 1555Type ownerType, // Type of object that owns or declares this attribute 1557Type attributeType) // Type of the attribute or property itself; not its owner type 1560Type converterType = GetKnownConverterTypeFromPropName(ownerType, fieldName); 1594private Type GetCustomSerializer( 1595Type type,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (6)
467static internal bool TreatAsIAddChild(Type parentObjectType) 472static internal BamlRecordType GetPropertyStartRecordType(Type propertyType, bool propertyCanWrite) 2649internal Type ValueType 2664internal Type SerializerType 2678Type _valueType; 2681Type _serializerType;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (3)
980Type converterOrSerializerType; 1016Type ownerType = _xamlTypeMapper.GetDependencyPropertyOwnerAndName(xamlProperty.Value, 1081Type typeValue = _xamlTypeMapper.GetTypeFromBaseString(xamlPropertyNode.Value,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypes.cs (2)
4776private Type InitializeOneType(KnownElements knownElement) 4778Type t = null;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypesHelper.cs (4)
47_typeTable =new Type[size]; 50public System.Type this[int index] 54Type t = _typeTable[index]; 75private Type[] _typeTable;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (25)
36ref Type baseType, 37ref Type serializerType); 64Type declaringType, // Type where propIdName is declared 89Type declaringType, 149private KnownElements GetKnownExtensionFromType(Type extensionType, out string propName) 189Type extensionType, 226Type extensionType, 300Type targetType) 444Type declaringType, // Type where attribute is declared 455Type targetType; 456Type serializerType; 478Type declaringType, // Type where propIdName is declared 491Type targetType; 492Type serializerType; 552out Type targetType, 553out Type serializerType) 639Type propertyType; 912Type extensionType) 1198private ParameterInfo[] FindLongestConstructor(Type extensionType, out int maxConstructorArguments) 1376Type declaringType; 1492Type parentType, 1510Type declaringType; 1545Type typeValue = _parserContext.XamlTypeMapper.GetTypeFromBaseString(value, 1645Type elementBaseType, 1652out Type declaringType, // type of the object that the field is on
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\ParserContext.cs (11)
196internal Dictionary<string, SpecialBracketCharacters> InitBracketCharacterCacheForType(Type type) 236_targetType = (Type) _langSpaceStack.Pop(); 311internal Type TargetType 698internal Dictionary<Type, Dictionary<string, SpecialBracketCharacters>> MasterBracketCharacterCache 704_masterBracketCharacterCache = new Dictionary<Type, Dictionary<string, SpecialBracketCharacters>>(); 825private Type _targetType; 826private Dictionary<Type, Dictionary<string, SpecialBracketCharacters>> _masterBracketCharacterCache; 846private Dictionary<string, SpecialBracketCharacters> BuildBracketCharacterCacheForType(Type extensionType) 850Type constructorArgumentType = null; 851Type markupExtensionBracketCharacterType = null; 861Type attributeType = attributeData.AttributeType;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (4)
293Type ownerTagType = typeAndSerializer.ObjectType; 406Type targetType = null; 550Type propertyType = XamlTypeMapper.GetPropertyType(_setterOrTriggerPropertyInfo); 1581Type _styleTargetTypeType;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TemplateXamlParser.cs (17)
330Type ownerTagType = typeAndSerializer.ObjectType; 455Type targetType = null; 466targetType = _IDTypes[_setterTargetNameOrConditionSourceName] as Type; 573Type propertyType = XamlTypeMapper.GetPropertyType(_setterOrTriggerPropertyMemberInfo); 829private void CommonElementStartProcessing (XamlNode xamlNode, Type elementType, ref StyleMode mode) 923private Type TargetType 1362xamlClrEventNode.ListenerType = (Type) _elementTypeStack.Peek(); 1490_IDTypes[xamlPropertyNode.Value] = _elementTypeStack.Peek() as Type; 1539Type t = (Type)_elementTypeStack.Peek(); 1766private Type ItemContainerTemplateType 1778private Type ItemContainerTemplateKeyType 1818Type _templateTargetTypeType; 1821Type _defaultTargetType; 1856Type _templateKeyType; 1859private static Type _itemContainerTemplateType; 1862private static Type _itemContainerTemplateKeyType;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TypeContext.cs (1)
68virtual public object GetService(Type serviceType)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlNodes.cs (40)
370Type converterType) 388internal Type ConverterType 403Type _converterType = null; 479internal Type PropDeclaringType 496internal Type PropValidType 523Type _validType; 524Type _declaringType; 661internal Type DefaultTargetType 671Type _defaultTargetType; 759internal Type ValueDeclaringType 801internal Type ValuePropertyType 866internal Type DefaultTargetType 903Type _valueDeclaringType; 905Type _valuePropertyType; 910Type _defaultTargetType; 932Type valueElementType, // Actual type of the valueTypeFullname. 971internal Type ValueElementType 996Type _valueElementType; 1089Type elementType, 1090Type serializerType) 1112Type elementType, 1113Type serializerType, 1150internal Type ElementType 1161internal Type SerializerType 1210Type _elementType; 1211Type _serializerType; 1267Type valueElementType) // Actual type of the valueTypeFullname. 1295internal Type ValueElementType 1302Type _valueElementType; 1688internal Type ListenerType 1765private Type _listenerType; 2071Type valueType) // Actual Type, if known. 2089internal Type ValueType 2095Type _valueType; 2156Type elementType, 2157Type serializerType) 2250internal Type PropDeclaringType 2267internal Type PropValidType 2281Type _declaringType; 2282Type _validType;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParseException.cs (1)
416Type objectType
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParser.cs (2)
1069ref Type baseType, 1070ref Type serializerType)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (117)
175ref Type baseType, 176ref Type serializerType) 230private static bool IsACollection(Type type) 249Type contentPropertyType = XamlTypeMapper.GetPropertyType(context.ContentPropertyInfo); 272Type t = ((Type)context.ContextData); 469ref Type baseType, 470ref Type serializerType) 619Type elementType, 620Type serializerType, 629ReflectionHelper.GetMscorlibType(typeof(IDictionary)).IsAssignableFrom(ParentContext.ContextData as Type)); 667Type elementType = (Type) CurrentContext.ContextDataType; 675Type propertyDeclaringType; 692Type converterType, 794Type typeValue = XamlTypeMapper.GetTypeFromBaseString(value, 844Type valueElementType, // Actual type of the valueTypeFullname. 864Type declaringType, // Type that corresponds to declaringTypeFullName (where the property is declared) 872Type propType = XamlTypeMapper.GetPropertyType(propertyMember); 1075Type valueElementType) 1141ref Type baseType, // Type of the dynamicObject - PropertyInfo, MethodInfo or DependencyProperty 1143ref Type declaringType) // Actual type corresponding to typeFullName 1336bool GetTrimSurroundingWhitespace(Type type) 1432delegate bool ContentValidator(Type type); 1466public Type ContextDataType 1473return _contextData as Type; 1530internal Type ChildPropertyType 1641Type _childPropertyType; 1686Type elementBaseType, 1693out Type declaringType, // type of the object that the field is on 1763Type elementBaseType, 1771ref Type declaringType, // type of the object that the field is on 1879static string GetContentPropertyName(Type type) 1908Type baseType = type; 1909Type attrType = KnownTypes.Types[(int)KnownElements.ContentPropertyAttribute]; 1910Type DOType = KnownTypes.Types[(int)KnownElements.DependencyObject]; 1911Type FEType = KnownTypes.Types[(int)KnownElements.FrameworkElement]; 1912Type FCEType = KnownTypes.Types[(int)KnownElements.FrameworkContentElement]; 2188Type elementType, 2286Type dependencyObjectType = KnownTypes.Types[(int)KnownElements.DependencyObject]; 2751Type parentType, // Type of parent, if known 2816Type declaringType = null; 2972Type parentType, 3008parentType.GetConstructor(Type.EmptyTypes) == null || 3062Type valueElementType = null; 3063Type valueSerializerType = null; 3114Type pType = ParentContext.ContextData as Type; 3164Type parentType, 3174Type declaringType, 3236Type propType; 3287parentType.GetConstructor(Type.EmptyTypes) == null || 3296if (propType == ReflectionHelper.GetMscorlibType(typeof(Type))) 3330Type parentType = XamlTypeMapper.GetType(parentTypeNamespace, parentTypeName); 3336private string GetRuntimeNamePropertyName(Type objectType) 3410Type baseType = objectType; 3411Type attrType = KnownTypes.Types[(int)KnownElements.RuntimeNamePropertyAttribute]; 3412Type TimelineType = KnownTypes.Types[(int)KnownElements.Timeline]; 3413Type FEType = KnownTypes.Types[(int)KnownElements.FrameworkElement]; 3414Type FCEType = KnownTypes.Types[(int)KnownElements.FrameworkContentElement]; 3415Type BSBType = KnownTypes.Types[(int)KnownElements.BeginStoryboard]; 3481Type parentType, 3508private bool PropertyIsWriteable(object propertyMember, Type declaringType) 3570Type elementBaseType = null; 3574Type serializerType = null; 3671Type declaringType = null; 3694Type propertyType = XamlTypeMapper.GetPropertyType(dynamicObject); 3930Type propertyType, // Type of the property 3931Type serializerType, // Type of serializer for the property 3937Type declaringType, // Actual type that corresponds to typeFullName 4163Type propertyType, // Type of the property 4183Type propertyType, // Type of the property 4184Type serializerType, 4223Type propertyType, // Type of the property 4224Type serializerType, // Type of serializer for the property 4263Type propertyType, // Type of the property 4319Type serializerType, 4333Type currentObjectType = CurrentContext.ContextDataType; 4351FirstTagName = $"{((Type)GrandParentContext.ContextData).Name}.{GrandParentContext.ChildTagLocalName}"; 4410ParentContext.ContextDataType.GetConstructor(Type.EmptyTypes) == null)) 4492Type parentElementType = CurrentContext.ContextDataType; 4516private void LoadContentPropertyInfo(Type elementType) 4532Type propertyDeclaringType; 4554Type elementType, 4558out Type propertyDeclaringType) 4566Type propertyBaseType = null; 4624Type propertyDeclaringType = XamlTypeMapper.GetDeclaringType(contentPropertyInfo); 4645Type parentType = ParentContext.ContextDataType; 4668Type arrayType = ParentContext.ContextDataType; 4669Type objectType = CurrentContext.ContextDataType; 4700Type elementType = CurrentContext.ContextDataType; 4715Type contentPropertyType = XamlTypeMapper.GetPropertyType(CurrentContext.ContentPropertyInfo); 4774Type converterType = XamlTypeMapper.GetTypeConverterType(elementType); 4792Type converterType = XamlTypeMapper.GetTypeConverterType(elementType); 4813internal static bool CanCollectionTypeAcceptStrings( Type collectionType ) 4833internal static bool CanCollectionTypeAcceptStringsHelper( Type propertyType ) 4840Type collectionItemType = GetCollectionItemType(propertyType); 4876internal static Type GetCollectionItemType( Type collectionType ) 4880Type iCollectionT = collectionType.GetInterface("System.Collections.Generic.ICollection`1"); 4920internal static bool CanWrapStringAsItemType( Type collectionType, Type collectionItemType ) 4922Type contentWrapper = null; //e.g. Run 4949contentWrapper = attributes[i].ConstructorArguments[0].Value as Type; 5695private bool IsWhitespaceSignificantAttributePresent(Type collectionType) 5708Type baseType = collectionType; 5709Type attrType = KnownTypes.Types[(int)KnownElements.WhitespaceSignificantCollectionAttribute]; 5737Type propertyType) 5742internal Type PropertyType 5769private Type _propertyType; 6456Type typeRightTag = elementNode.ElementType; 6771private bool IsAssignableToIXmlSerializable(Type type) 6831Type _definitionScopeType; 6846private Type _typeIXmlSerializable; 6854Type _ownerType; 6857public XamlPropertyFullName(Type ownerType, string name) 6864public Type OwnerType { get { return _ownerType; } }
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (57)
106public Type GetType( 721Type propType, 776Type owner, 939Type owner, 963static private bool IsAllowedEventDelegateType(Type delegateType) 1214Type owner, 1244Type owner, 1274Type objectType = typeAndSerializer.ObjectType; 1295Type dependencyObjectType = KnownTypes.Types[(int)KnownElements.DependencyObject]; 1429Type baseType = owner; 1454Type dependencyObjectType = KnownTypes.Types[(int)KnownElements.DependencyObject]; 1846Type typeValue = null; 1903Type ownerType, 2021internal static Type GetPropertyType(object propertyMember) 2023Type propertyType; 2038out Type propertyType, 2117internal static Type GetDeclaringType(object propertyMember) 2119Type validType = null; 2242internal Type GetTargetTypeAndMember(string valueParam, 2257Type targetType = null; 2293internal Type GetDependencyPropertyOwnerAndName(string memberValue, 2295Type defaultTargetType, 2298Type targetType = GetTargetTypeAndMember(memberValue, context, false, out memberName); 2325internal MemberInfo GetStaticMemberInfo(Type targetType, string memberName, bool fieldInfoOnly) 2365private MemberInfo GetStaticMemberInfo(Type targetType, string memberName, bool fieldInfoOnly, bool tryInternal) 2487private static bool IsInternalAllowedOnType(Type type) 2538Type objectType = GetObjectType(namespaceMap, localName, knownTypesOnly); 2588private Type GetObjectType( 2596Type type = null; 2664internal int GetCustomBamlSerializerIdForType(Type objectType) 2705internal Type GetXamlSerializerForType(Type objectType) 2846internal Type GetTypeFromBaseString( 2852Type keyObject = null; 2921internal Type GetTypeArgsType( 2927Type t = null; 2983private TypeInformationCacheData GetCachedInformationForType(Type type) 3103internal object CreateInstance(Type t) 3439internal Type GetTypeConverterType(Type type) 3443Type converterType = null; 3514internal Type GetPropertyConverterType(Type propType, object dpOrPiOrMi) 3517Type converterType = null; 3528converterType = (Type)ret; 3725internal bool GetCachedTrimSurroundingWhitespace(Type t) 3743private bool GetTrimSurroundingWhitespace(Type type) 3925internal TypeInformationCacheData(Type baseType) 3962internal Type TypeConverterType 4008Type ownerType, 4054Type converter) 4062Type _baseType; 4070Type _typeConverterType; 4080Type ot, 4093public Type OwnerType; 4201public Type ObjectType = null; 4202public Type SerializerType = null;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\SystemResourceKey.cs (1)
377internal static short GetBamlIdBasedOnSystemResourceKeyId(Type targetType, string memberName)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (32)
82internal static Type GetQualifiedType(string typeName) 91return Type.GetType(nameFrags[0]); 121internal static bool IsNullableType(Type type) 126internal static bool IsInternalType(Type type) 128Type origType = type; 148internal static bool IsPublicType(Type type) 165internal static Type GetFrameworkType(string assemblyName, Type type) 183internal static Type GetMscorlibType(Type type) 189internal static Type GetSystemType(Type type) 215internal static string GetTypeConverterAttributeData(Type type, out Type converterType) 221internal static string GetTypeConverterAttributeData(MemberInfo mi, out Type converterType) 229private static string GetCustomAttributeData(MemberInfo mi, Type attrType, out Type typeValue) 240internal static string GetCustomAttributeData(Type t, Type attrType, bool allowZeroArgs) 242Type typeValue = null; 252private static string GetCustomAttributeData(IList<CustomAttributeData> list, Type attrType, out Type typeValue, bool allowTypeAlso, bool allowZeroArgs) 273internal static string GetCustomAttributeData(Type t, 274Type attrType, 277out Type typeValue) 281Type currentType = t; 316Type attrType, 317out Type typeValue, 338if (attrValue == null && allowTypeAlso && tca.ArgumentType == GetMscorlibType(typeof(Type))) 343typeValue = tca.Value as Type; 486Type typeValue = null; 505internal static bool IsInternalAllowedOnType(Type type)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (11)
101internal static Type GetConverterType(MemberInfo memberInfo) 106string converterName = ReflectionHelper.GetTypeConverterAttributeData(memberInfo, out Type converterType); 110internal static Type? GetConverterType(Type type) 115string? converterName = ReflectionHelper.GetTypeConverterAttributeData(type, out Type? converterType); 119private static Type? GetConverterTypeFromName(string? converterName) 121Type? converterType = null; 148internal static Type GetCoreConverterTypeFromCustomType(Type type) 150Type converterType = null; 226else if (typeof(Type).IsAssignableFrom(type))
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlWrappingReader.cs (1)
56public override System.Type ValueType { get { return _reader.ValueType; } }
PresentationCore (422)
MS\Internal\IListConverters.cs (9)
29public override bool CanConvertFrom(ITypeDescriptorContext td, Type t) 37public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 65public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 82internal abstract object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType); 108internal override object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 150internal override object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 191internal override object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 233internal override object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 271internal override object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
MS\Internal\Ink\ExtendedProperty.cs (6)
49Type type1 = this.Value.GetType(); 50Type type2 = that.Value.GetType(); 54Type elementType1 = type1.GetElementType(); 55Type elementType2 = type2.GetElementType(); 175Type type = _value.GetType(); 190Type elementType = type.GetElementType();
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (2)
806Type valueType = value.GetType(); 824Type t = value.GetType();
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (3)
687public static readonly Type StylusTip = typeof(Int32); 688public static readonly Type IsHollow = typeof(bool); 689public static readonly Type StylusTipTransform = typeof(string);
MS\Internal\Ink\InkSerializedFormat\SerializationHelper.cs (1)
209public static VarEnum ConvertToVarEnum(Type type, bool throwOnError)
MS\Internal\TextFormatting\FullTextLine.cs (3)
402Type t = caughtException.GetType(); 409new Type[] { typeof(Exception) } 420new Type[] { typeof(string), typeof(Exception) }
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Commands\CommandLibraryHelper.cs (1)
25internal static RoutedUICommand CreateUICommand(string name, Type ownerType, byte commandId)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\WindowsRuntime\ReflectionHelper.cs (18)
58public static TResult ReflectionStaticCall<TResult>(this Type type, string methodName) 63method = type.GetMethod(methodName, Type.EmptyTypes); 91public static TResult ReflectionStaticCall<TResult, TArg>(this Type type, string methodName, TArg arg) 96method = type.GetMethod(methodName, new Type[] { typeof(TArg) }); 146method = obj.GetType().GetMethod(methodName, Type.EmptyTypes); 178method = obj.GetType().GetMethod(methodName, new Type[] { typeof(TArg1) }); 232method = obj.GetType().GetMethod(methodName, new Type[] { typeof(TArg1), typeof(TArg2) }); 307public static object ReflectionNew(this Type type) 309ConstructorInfo constructor = type.GetConstructor(Type.EmptyTypes); 332public static object ReflectionNew<TArg1>(this Type type, TArg1 arg1) 334ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(TArg1) }); 359public static object ReflectionNew<TArg1, TArg2>(this Type type, TArg1 arg1, TArg2 arg2) 361ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(TArg1), typeof(TArg2) }); 380/// <exception cref="AmbiguousMatchException">More than one property is found with the specified name. See <see cref="Type.GetProperty(string)"/></exception> 387Type type = obj.GetType(); 405/// <exception cref="AmbiguousMatchException">More than one property is found with the specified name. See <see cref="Type.GetProperty(string)"/></exception> 421/// <exception cref="AmbiguousMatchException">More than one property is found with the specified name. See <see cref="Type.GetProperty(string)"/></exception> 425public static TResult ReflectionStaticGetProperty<TResult>(this Type type, string propertyName)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\PerfService.cs (1)
39Type type = key.GetType();
System\Windows\BinaryFormat\BinaryFormatWriter.cs (3)
187Type type = primitive.GetType(); 297Type type = list.GetType(); 541Type type = value.GetType();
System\Windows\BinaryFormat\FormatterConverterStub.cs (1)
26public object Convert(object value, Type type) => default!;
System\Windows\BinaryFormat\TypeInfo.cs (2)
41internal static PrimitiveType GetPrimitiveType(Type type) => Type.GetTypeCode(type) switch
System\Windows\CultureInfoConverter.cs (4)
48public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType) 62public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 118Type destinationType) 135new Type[] { typeof(string) },
System\Windows\dataobject.cs (11)
108public DataObject(Type format, object data) 202public object GetData(Type format) 213public bool GetDataPresent(Type format) 311public void SetData(Type format, object data) 2423public Object GetData(Type format) 2438public bool GetDataPresent(Type format) 2521public void SetData(Type format, Object data) 3275public override Type BindToType(string assemblyName, string typeName) 3326public Object GetData(Type format) 3341public bool GetDataPresent(Type format) 3452public void SetData(Type format, Object data)
System\Windows\Diagnostics\XamlSourceInfoHelper.cs (1)
77Type type = typeof(System.Xaml.XamlObjectEventArgs);
System\Windows\DurationConverter.cs (4)
23public override bool CanConvertFrom(ITypeDescriptorContext td, Type t) 42public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 102Type destinationType) 114mi = typeof(Duration).GetConstructor(new Type[] { typeof(TimeSpan) });
System\Windows\EventManager.cs (6)
53Type handlerType, 54Type ownerType) 89Type classType, 145Type classType, 215public static RoutedEvent[] GetRoutedEventsForOwner(Type ownerType) 247internal static RoutedEvent GetRoutedEventFromName(string name, Type ownerType)
System\Windows\FontStretchConverter.cs (4)
20public override bool CanConvertFrom(ITypeDescriptorContext td, Type t) 38public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 88public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 94MethodInfo mi = typeof(FontStretch).GetMethod("FromOpenTypeStretch", new Type[]{typeof(int)});
System\Windows\FontStyleConverter.cs (4)
20public override bool CanConvertFrom(ITypeDescriptorContext td, Type t) 38public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 88public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 94ConstructorInfo ci = typeof(FontStyle).GetConstructor(new Type[]{typeof(int)});
System\Windows\FontWeightConverter.cs (4)
20public override bool CanConvertFrom(ITypeDescriptorContext td, Type t) 38public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 88public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 94MethodInfo mi = typeof(FontWeight).GetMethod("FromOpenTypeWeight", new Type[]{typeof(int)});
System\Windows\Generated\ContentElement.cs (1)
26static private readonly Type _typeofThis = typeof(ContentElement);
System\Windows\Generated\TextDecoration.cs (1)
267Type typeofThis = typeof(TextDecoration);
System\Windows\Generated\UIElement.cs (2)
26static private readonly Type _typeofThis = typeof(UIElement); 734internal static void RegisterEvents(Type type)
System\Windows\Generated\UIElement3D.cs (1)
24static private readonly Type _typeofThis = typeof(UIElement3D);
System\Windows\GlobalEventManager.cs (6)
19Type handlerType, 20Type ownerType) 50Type classType, 147internal static void AddOwner(RoutedEvent routedEvent, Type ownerType) 211internal static RoutedEvent[] GetRoutedEventsForOwner(Type ownerType) 244Type ownerType,
System\Windows\IDataObject.cs (3)
34object GetData(Type format); 58bool GetDataPresent(Type format); 108void SetData(Type format, object data);
System\Windows\Ink\DrawingAttributes.cs (1)
706Type t = propertyData.GetType();
System\Windows\Ink\StrokeCollectionConverter.cs (4)
34public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 114public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 136ConstructorInfo ci = typeof(StrokeCollection).GetConstructor(new Type[] { typeof(Stream) });
System\Windows\Input\Command\CanExecuteChangedEventManager.cs (1)
164Type managerType = typeof(CanExecuteChangedEventManager);
System\Windows\Input\Command\CommandManager.cs (12)
182public static void RegisterClassInputBinding(Type type, InputBinding inputBinding) 211public static void RegisterClassCommandBinding(Type type, CommandBinding commandBinding) 318Type classType = targetElement.GetType(); 367Type classType = targetElement.GetType(); 544Type senderType = sender.GetType(); 550ValueTuple<Type, CommandBinding>? tuple = default; // zero or one binding 551List<ValueTuple<Type, CommandBinding>> list = default; // more than one 556Type classType = senderType; 576list ??= new List<ValueTuple<Type, CommandBinding>>(8) 581list.Add(new ValueTuple<Type, CommandBinding>(classType, commandBinding)); 602Type classType = list[i].Item1; 901Type managerType = typeof(RequerySuggestedEventManager);
System\Windows\Input\Command\KeyGestureConverter.cs (3)
30public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 136public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Input\Command\MouseActionConverter.cs (3)
21public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 33public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 83public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Input\Command\MouseGestureConverter.cs (3)
31public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 113public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 140public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Input\Command\RoutedCommand.cs (5)
35public RoutedCommand(string name, Type ownerType) : this(name, ownerType, null) 45public RoutedCommand(string name, Type ownerType, InputGestureCollection inputGestures) 67internal RoutedCommand(string name, Type ownerType, byte commandId) : this(name, ownerType, null) 192public Type OwnerType 463private Type _ownerType;
System\Windows\Input\Command\RoutedUICommand.cs (3)
34public RoutedUICommand(string text, string name, Type ownerType) 46public RoutedUICommand(string text, string name, Type ownerType, InputGestureCollection inputGestures) 59internal RoutedUICommand(string name, Type ownerType, byte commandId):base(name, ownerType, commandId)
System\Windows\Input\Command\SecureUICommand.cs (1)
30internal SecureUICommand(string name, Type ownerType, byte commandId)
System\Windows\Input\CursorConverter.cs (3)
26public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 41public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 207public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Input\InputScopeConverter.cs (3)
38public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 62public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 148public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Input\InputScopeNameConverter.cs (3)
38public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 62public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 130public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (2)
97Type managerType = typeof(DispatcherShutdownStartedEventManager); 191bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs args)
System\Windows\InterOp\HwndMouseInputProvider.cs (2)
1101Type windowChromeWorker = presentationFramework.GetType("System.Windows.Shell.WindowChromeWorker"); 1125Type type = rootVisual?.GetType();
System\Windows\InterOp\HwndSource.cs (1)
397internal override IInputProvider GetInputProvider(Type inputDevice)
System\Windows\Markup\XmlLanguageConverter.cs (4)
41public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType) 55public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 111Type destinationType) 128new Type[] { typeof(string) },
System\Windows\Media\Animation\Animatable.cs (2)
116Type propertyType, 117Type ownerType,
System\Windows\Media\Animation\AnimationStorage.cs (1)
1113private static IndependentAnimationStorage CreateIndependentAnimationStorageForType(Type type)
System\Windows\Media\Animation\AnimationTimeline.cs (1)
137public abstract Type TargetPropertyType { get; }
System\Windows\Media\Animation\Generated\BooleanAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\ByteAnimation.cs (2)
47Type typeofProp = typeof(Byte?); 48Type typeofThis = typeof(ByteAnimation);
System\Windows\Media\Animation\Generated\ByteAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\CharAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\ColorAnimation.cs (2)
47Type typeofProp = typeof(Color?); 48Type typeofThis = typeof(ColorAnimation);
System\Windows\Media\Animation\Generated\ColorAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\DecimalAnimation.cs (2)
47Type typeofProp = typeof(Decimal?); 48Type typeofThis = typeof(DecimalAnimation);
System\Windows\Media\Animation\Generated\DecimalAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\DoubleAnimation.cs (2)
47Type typeofProp = typeof(Double?); 48Type typeofThis = typeof(DoubleAnimation);
System\Windows\Media\Animation\Generated\DoubleAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\Int16Animation.cs (2)
47Type typeofProp = typeof(Int16?); 48Type typeofThis = typeof(Int16Animation);
System\Windows\Media\Animation\Generated\Int16AnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\Int32Animation.cs (2)
47Type typeofProp = typeof(Int32?); 48Type typeofThis = typeof(Int32Animation);
System\Windows\Media\Animation\Generated\Int32AnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\Int64Animation.cs (2)
47Type typeofProp = typeof(Int64?); 48Type typeofThis = typeof(Int64Animation);
System\Windows\Media\Animation\Generated\Int64AnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\MatrixAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\ObjectAnimationBase.cs (1)
111public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\Point3DAnimation.cs (2)
48Type typeofProp = typeof(Point3D?); 49Type typeofThis = typeof(Point3DAnimation);
System\Windows\Media\Animation\Generated\Point3DAnimationBase.cs (1)
90public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\PointAnimation.cs (2)
47Type typeofProp = typeof(Point?); 48Type typeofThis = typeof(PointAnimation);
System\Windows\Media\Animation\Generated\PointAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\QuaternionAnimation.cs (2)
48Type typeofProp = typeof(Quaternion?); 49Type typeofThis = typeof(QuaternionAnimation);
System\Windows\Media\Animation\Generated\QuaternionAnimationBase.cs (1)
90public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\RectAnimation.cs (2)
47Type typeofProp = typeof(Rect?); 48Type typeofThis = typeof(RectAnimation);
System\Windows\Media\Animation\Generated\RectAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\Rotation3DAnimation.cs (2)
48Type typeofProp = typeof(Rotation3D); 49Type typeofThis = typeof(Rotation3DAnimation);
System\Windows\Media\Animation\Generated\Rotation3DAnimationBase.cs (1)
87public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\SingleAnimation.cs (2)
47Type typeofProp = typeof(Single?); 48Type typeofThis = typeof(SingleAnimation);
System\Windows\Media\Animation\Generated\SingleAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\SizeAnimation.cs (2)
47Type typeofProp = typeof(Size?); 48Type typeofThis = typeof(SizeAnimation);
System\Windows\Media\Animation\Generated\SizeAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\StringAnimationBase.cs (1)
85public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\TimelineGroup.cs (1)
177Type typeofThis = typeof(TimelineGroup);
System\Windows\Media\Animation\Generated\Vector3DAnimation.cs (2)
48Type typeofProp = typeof(Vector3D?); 49Type typeofThis = typeof(Vector3DAnimation);
System\Windows\Media\Animation\Generated\Vector3DAnimationBase.cs (1)
90public override sealed Type TargetPropertyType
System\Windows\Media\Animation\Generated\VectorAnimation.cs (2)
47Type typeofProp = typeof(Vector?); 48Type typeofThis = typeof(VectorAnimation);
System\Windows\Media\Animation\Generated\VectorAnimationBase.cs (1)
88public override sealed Type TargetPropertyType
System\Windows\Media\Animation\KeySplineConverter.cs (4)
27public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptor, Type destinationType) 46public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 96Type destinationType) 104ConstructorInfo ci = typeof(KeySpline).GetConstructor(new Type[]
System\Windows\Media\Animation\KeyTimeConverter.cs (5)
26Type type) 46Type type) 131Type destinationType) 146mi = typeof(KeyTime).GetMethod("FromPercent", new Type[] { typeof(double) }); 152mi = typeof(KeyTime).GetMethod("FromTimeSpan", new Type[] { typeof(TimeSpan) });
System\Windows\Media\Animation\RepeatBehaviorConverter.cs (5)
29public override bool CanConvertFrom(ITypeDescriptorContext td, Type t) 48public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 112Type destinationType) 131mi = typeof(RepeatBehavior).GetConstructor(new Type[] { typeof(double) }); 137mi = typeof(RepeatBehavior).GetConstructor(new Type[] { typeof(TimeSpan) });
System\Windows\Media\BitmapCacheBrush.cs (1)
383private static void StaticInitialize(Type typeofThis)
System\Windows\Media\CharacterMetricsDictionary.cs (1)
206Type elementType = array.GetType().GetElementType();
System\Windows\Media\ColorConverter.cs (4)
21public override bool CanConvertFrom(ITypeDescriptorContext td, Type t) 39public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 98public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 104MethodInfo mi = typeof(Color).GetMethod("FromArgb", new Type[]{typeof(byte), typeof(byte), typeof(byte), typeof(byte)});
System\Windows\Media\CultureSpecificStringDictionary.cs (1)
169Type elementType = array.GetType().GetElementType();
System\Windows\Media\Effects\Generated\BevelBitmapEffect.cs (1)
287Type typeofThis = typeof(BevelBitmapEffect);
System\Windows\Media\Effects\Generated\BitmapEffectGroup.cs (1)
196Type typeofThis = typeof(BitmapEffectGroup);
System\Windows\Media\Effects\Generated\BitmapEffectInput.cs (1)
230Type typeofThis = typeof(BitmapEffectInput);
System\Windows\Media\Effects\Generated\BlurBitmapEffect.cs (1)
205Type typeofThis = typeof(BlurBitmapEffect);
System\Windows\Media\Effects\Generated\BlurEffect.cs (1)
304Type typeofThis = typeof(BlurEffect);
System\Windows\Media\Effects\Generated\DropShadowBitmapEffect.cs (1)
321Type typeofThis = typeof(DropShadowBitmapEffect);
System\Windows\Media\Effects\Generated\DropShadowEffect.cs (1)
409Type typeofThis = typeof(DropShadowEffect);
System\Windows\Media\Effects\Generated\EmbossBitmapEffect.cs (1)
213Type typeofThis = typeof(EmbossBitmapEffect);
System\Windows\Media\Effects\Generated\OuterGlowBitmapEffect.cs (1)
267Type typeofThis = typeof(OuterGlowBitmapEffect);
System\Windows\Media\Effects\Generated\PixelShader.cs (1)
277Type typeofThis = typeof(PixelShader);
System\Windows\Media\Effects\Generated\ShaderEffect.cs (1)
274Type typeofThis = typeof(ShaderEffect);
System\Windows\Media\Effects\ShaderEffect.cs (8)
313Type ownerType, 324Type ownerType, 344Type t = DetermineShaderConstantType(dp.PropertyType, PixelShader); 828internal static Type DetermineShaderConstantType(Type type, PixelShader pixelShader) 830Type result = null; 873Type t = value.GetType(); 955Type t = value.GetType();
System\Windows\Media\FamilyMapCollection.cs (1)
94Type elementType = array.GetType().GetElementType();
System\Windows\Media\FamilyTypefaceCollection.cs (1)
372Type elementType = array.GetType().GetElementType();
System\Windows\Media\FontFamilyConverter.cs (3)
25public override bool CanConvertFrom(ITypeDescriptorContext td, Type t) 39public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 120public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media\Generated\ArcSegment.cs (1)
262Type typeofThis = typeof(ArcSegment);
System\Windows\Media\Generated\BezierSegment.cs (1)
235Type typeofThis = typeof(BezierSegment);
System\Windows\Media\Generated\BitmapCache.cs (1)
306Type typeofThis = typeof(BitmapCache);
System\Windows\Media\Generated\BitmapCacheBrush.cs (1)
511Type typeofThis = typeof(BitmapCacheBrush);
System\Windows\Media\Generated\Brush.cs (1)
433Type typeofThis = typeof(Brush);
System\Windows\Media\Generated\BrushConverter.cs (3)
28public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 46public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 114public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media\Generated\CacheModeConverter.cs (3)
28public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 46public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 114public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media\Generated\CombinedGeometry.cs (1)
428Type typeofThis = typeof(CombinedGeometry);
System\Windows\Media\Generated\DashStyle.cs (1)
325Type typeofThis = typeof(DashStyle);
System\Windows\Media\Generated\DoubleCollectionConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media\Generated\DrawingBrush.cs (1)
367Type typeofThis = typeof(DrawingBrush);
System\Windows\Media\Generated\DrawingGroup.cs (1)
844Type typeofThis = typeof(DrawingGroup);
System\Windows\Media\Generated\DrawingImage.cs (1)
304Type typeofThis = typeof(DrawingImage);
System\Windows\Media\Generated\EllipseGeometry.cs (1)
352Type typeofThis = typeof(EllipseGeometry);
System\Windows\Media\Generated\GeneralTransformGroup.cs (1)
184Type typeofThis = typeof(GeneralTransformGroup);
System\Windows\Media\Generated\Geometry.cs (1)
353Type typeofThis = typeof(Geometry);
System\Windows\Media\Generated\GeometryConverter.cs (3)
28public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 46public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 114public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media\Generated\GeometryDrawing.cs (1)
431Type typeofThis = typeof(GeometryDrawing);
System\Windows\Media\Generated\GeometryGroup.cs (1)
483Type typeofThis = typeof(GeometryGroup);
System\Windows\Media\Generated\GlyphRunDrawing.cs (1)
346Type typeofThis = typeof(GlyphRunDrawing);
System\Windows\Media\Generated\GradientBrush.cs (1)
276Type typeofThis = typeof(GradientBrush);
System\Windows\Media\Generated\GuidelineSet.cs (1)
351Type typeofThis = typeof(GuidelineSet);
System\Windows\Media\Generated\ImageBrush.cs (1)
367Type typeofThis = typeof(ImageBrush);
System\Windows\Media\Generated\ImageDrawing.cs (1)
325Type typeofThis = typeof(ImageDrawing);
System\Windows\Media\Generated\Int32CollectionConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media\Generated\LinearGradientBrush.cs (1)
275Type typeofThis = typeof(LinearGradientBrush);
System\Windows\Media\Generated\LineGeometry.cs (1)
305Type typeofThis = typeof(LineGeometry);
System\Windows\Media\Generated\LineSegment.cs (1)
193Type typeofThis = typeof(LineSegment);
System\Windows\Media\Generated\MatrixTransform.cs (1)
262Type typeofThis = typeof(MatrixTransform);
System\Windows\Media\Generated\MediaTimeline.cs (1)
195Type typeofThis = typeof(MediaTimeline);
System\Windows\Media\Generated\PathFigure.cs (1)
261Type typeofThis = typeof(PathFigure);
System\Windows\Media\Generated\PathFigureCollectionConverter.cs (3)
28public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 46public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 114public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media\Generated\PathGeometry.cs (1)
278Type typeofThis = typeof(PathGeometry);
System\Windows\Media\Generated\PathSegment.cs (1)
196Type typeofThis = typeof(PathSegment);
System\Windows\Media\Generated\Pen.cs (1)
550Type typeofThis = typeof(Pen);
System\Windows\Media\Generated\PointCollectionConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media\Generated\PolyBezierSegment.cs (1)
197Type typeofThis = typeof(PolyBezierSegment);
System\Windows\Media\Generated\PolyLineSegment.cs (1)
197Type typeofThis = typeof(PolyLineSegment);
System\Windows\Media\Generated\PolyQuadraticBezierSegment.cs (1)
197Type typeofThis = typeof(PolyQuadraticBezierSegment);
System\Windows\Media\Generated\QuadraticBezierSegment.cs (1)
200Type typeofThis = typeof(QuadraticBezierSegment);
System\Windows\Media\Generated\RadialGradientBrush.cs (1)
327Type typeofThis = typeof(RadialGradientBrush);
System\Windows\Media\Generated\RectangleGeometry.cs (1)
351Type typeofThis = typeof(RectangleGeometry);
System\Windows\Media\Generated\RotateTransform.cs (1)
315Type typeofThis = typeof(RotateTransform);
System\Windows\Media\Generated\ScaleTransform.cs (1)
348Type typeofThis = typeof(ScaleTransform);
System\Windows\Media\Generated\SkewTransform.cs (1)
348Type typeofThis = typeof(SkewTransform);
System\Windows\Media\Generated\SolidColorBrush.cs (1)
308Type typeofThis = typeof(SolidColorBrush);
System\Windows\Media\Generated\StreamGeometry.cs (1)
188Type typeofThis = typeof(StreamGeometry);
System\Windows\Media\Generated\TextEffect.cs (1)
281Type typeofThis = typeof(TextEffect);
System\Windows\Media\Generated\TileBrush.cs (1)
405Type typeofThis = typeof(TileBrush);
System\Windows\Media\Generated\TransformConverter.cs (3)
28public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 46public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 114public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media\Generated\TransformGroup.cs (1)
433Type typeofThis = typeof(TransformGroup);
System\Windows\Media\Generated\TranslateTransform.cs (1)
282Type typeofThis = typeof(TranslateTransform);
System\Windows\Media\Generated\VectorCollectionConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media\Generated\VideoDrawing.cs (1)
310Type typeofThis = typeof(VideoDrawing);
System\Windows\Media\Generated\VisualBrush.cs (1)
406Type typeofThis = typeof(VisualBrush);
System\Windows\Media\ImageSourceConverter.cs (3)
31public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 49public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 193public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media\Imaging\Generated\BitmapImage.cs (1)
493Type typeofThis = typeof(BitmapImage);
System\Windows\Media\Imaging\Generated\ColorConvertedBitmap.cs (1)
362Type typeofThis = typeof(ColorConvertedBitmap);
System\Windows\Media\Imaging\Generated\CroppedBitmap.cs (1)
305Type typeofThis = typeof(CroppedBitmap);
System\Windows\Media\Imaging\Generated\FormatConvertedBitmap.cs (1)
363Type typeofThis = typeof(FormatConvertedBitmap);
System\Windows\Media\Imaging\Generated\TransformedBitmap.cs (1)
327Type typeofThis = typeof(TransformedBitmap);
System\Windows\Media\Imaging\PropVariant.cs (4)
124internal void InitVector(Array array, Type type, VarEnum varEnum) 129internal void Init(Array array, Type type, VarEnum vt) 240Type type = value.GetType(); 327Type type = value.GetType();
System\Windows\Media\Imaging\WriteableBitmap.cs (3)
386Type elementType; 490Type elementType; 1059out Type elementType)
System\Windows\Media\PixelFormatConverter.cs (4)
24public override bool CanConvertFrom(ITypeDescriptorContext td, Type t) 42public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 87public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 100ConstructorInfo ci = typeof(PixelFormat).GetConstructor(new Type[]{typeof(string)});
System\Windows\Media\RequestCachePolicyConverter.cs (5)
21public override bool CanConvertFrom(ITypeDescriptorContext td, Type t) 41public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 102Type destinationType) 115ConstructorInfo ci = typeof(HttpRequestCachePolicy).GetConstructor(new Type[] { typeof(HttpRequestCachePolicy) }); 130ConstructorInfo ci = typeof(RequestCachePolicy).GetConstructor(new Type[] { typeof(RequestCachePolicy) });
System\Windows\Media\VisualTreeHelper.cs (1)
221internal static bool IsAncestorOf(DependencyObject ancestor, DependencyObject descendant, Type stopType)
System\Windows\Media3D\Generated\AxisAngleRotation3D.cs (1)
286Type typeofThis = typeof(AxisAngleRotation3D);
System\Windows\Media3D\Generated\Camera.cs (1)
333Type typeofThis = typeof(Camera);
System\Windows\Media3D\Generated\DiffuseMaterial.cs (1)
362Type typeofThis = typeof(DiffuseMaterial);
System\Windows\Media3D\Generated\DirectionalLight.cs (1)
278Type typeofThis = typeof(DirectionalLight);
System\Windows\Media3D\Generated\EmissiveMaterial.cs (1)
334Type typeofThis = typeof(EmissiveMaterial);
System\Windows\Media3D\Generated\GeneralTransform3DGroup.cs (1)
184Type typeofThis = typeof(GeneralTransform3DGroup);
System\Windows\Media3D\Generated\GeometryModel3D.cs (1)
458Type typeofThis = typeof(GeometryModel3D);
System\Windows\Media3D\Generated\Light.cs (1)
192Type typeofThis = typeof(Light);
System\Windows\Media3D\Generated\MaterialGroup.cs (1)
433Type typeofThis = typeof(MaterialGroup);
System\Windows\Media3D\Generated\Matrix3DConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media3D\Generated\MatrixCamera.cs (1)
293Type typeofThis = typeof(MatrixCamera);
System\Windows\Media3D\Generated\MatrixTransform3D.cs (1)
255Type typeofThis = typeof(MatrixTransform3D);
System\Windows\Media3D\Generated\MeshGeometry3D.cs (1)
416Type typeofThis = typeof(MeshGeometry3D);
System\Windows\Media3D\Generated\Model3D.cs (1)
333Type typeofThis = typeof(Model3D);
System\Windows\Media3D\Generated\Model3DGroup.cs (1)
454Type typeofThis = typeof(Model3DGroup);
System\Windows\Media3D\Generated\OrthographicCamera.cs (1)
302Type typeofThis = typeof(OrthographicCamera);
System\Windows\Media3D\Generated\PerspectiveCamera.cs (1)
302Type typeofThis = typeof(PerspectiveCamera);
System\Windows\Media3D\Generated\Point3DCollectionConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media3D\Generated\Point3DConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media3D\Generated\Point4DConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media3D\Generated\PointLightBase.cs (1)
287Type typeofThis = typeof(PointLightBase);
System\Windows\Media3D\Generated\ProjectionCamera.cs (1)
287Type typeofThis = typeof(ProjectionCamera);
System\Windows\Media3D\Generated\QuaternionConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media3D\Generated\QuaternionRotation3D.cs (1)
265Type typeofThis = typeof(QuaternionRotation3D);
System\Windows\Media3D\Generated\Rect3DConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media3D\Generated\RotateTransform3D.cs (1)
409Type typeofThis = typeof(RotateTransform3D);
System\Windows\Media3D\Generated\ScaleTransform3D.cs (1)
437Type typeofThis = typeof(ScaleTransform3D);
System\Windows\Media3D\Generated\Size3DConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media3D\Generated\SpecularMaterial.cs (1)
362Type typeofThis = typeof(SpecularMaterial);
System\Windows\Media3D\Generated\SpotLight.cs (1)
374Type typeofThis = typeof(SpotLight);
System\Windows\Media3D\Generated\Transform3DGroup.cs (1)
433Type typeofThis = typeof(Transform3DGroup);
System\Windows\Media3D\Generated\TranslateTransform3D.cs (1)
326Type typeofThis = typeof(TranslateTransform3D);
System\Windows\Media3D\Generated\Vector3DCollectionConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Media3D\Generated\Vector3DConverter.cs (3)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 50public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 104public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\PresentationSource.cs (1)
58internal virtual IInputProvider GetInputProvider(Type inputDevice)
System\Windows\RoutedEvent.cs (8)
40public RoutedEvent AddOwner(Type ownerType) 77public Type HandlerType 88Type handlerType = handler.GetType(); 101public Type OwnerType 124Type handlerType, 125Type ownerType) 148private Type _handlerType; 149private Type _ownerType;
System\Windows\TextDecorationCollectionConverter.cs (4)
23public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 42public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 167public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 172new Type[]{typeof(IEnumerable<TextDecoration>)}
PresentationCore.Tests (6)
BinaryFormat\BinaryFormattedTypes.cs (4)
14public void Types_UseBinaryFormatter(Type type) 32public static TheoryData<Type> BinaryFormattedTypes_TestData => new() 43public void Types_DoNotUseBinaryFormatter(Type type) 52public static TheoryData<Type> NotBinaryFormattedTypes_TestData => new()
TestUtilities\BinaryFormatTestExtensions.cs (2)
34/// Returns `true` if the <see cref="Type"/> would use the <see cref="BinaryFormatter"/> for the purposes 37public static bool IsBinaryFormatted(this Type type)
PresentationFramework (1707)
HashHelper.cs (1)
10private static readonly Type[] s_unreliableTypes =
Microsoft\Win32\OpenFileDialog.cs (1)
232return (IFileDialog)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(CLSID.FileOpenDialog)));
Microsoft\Win32\OpenFolderDialog.cs (1)
262return (IFileDialog)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(CLSID.FileOpenDialog)));
Microsoft\Win32\SaveFileDialog.cs (1)
248return (IFileDialog)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(CLSID.FileSaveDialog)));
MS\Internal\Annotations\Anchoring\LocatorManager.cs (2)
187public void RegisterSelectionProcessor(SelectionProcessor processor, Type selectionType) 220public SelectionProcessor GetSelectionProcessor(Type selectionType)
MS\Internal\Annotations\Component\AdornerPresentationContext.cs (3)
100internal static void SetTypeZLevel(Type type, int level) 502Type type = component.GetType(); 554private static readonly Dictionary<Type, int> s_ZLevel = new();
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (4)
300internal override Type OwnerType 570internal override Type OwnerType 994Type elementType = cursor.GetElementType(LogicalDirection.Forward); 1018Type elementType = cursor.ParentType;
MS\Internal\Annotations\Serializer.cs (2)
39public Serializer(Type type) 55_ctor = type.GetConstructor(Array.Empty<Type>());
MS\Internal\AppModel\Journaling.cs (2)
678Type pfType = Type.GetType(this._typeName);
MS\Internal\AppModel\ReturnEventSaver.cs (1)
126Type.GetType(_returnList[i]._delegateTypeName),
MS\Internal\Commands\CommandHelpers.cs (13)
16internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler) 21internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler, 27internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler, 33internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler, 39internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler, 45internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler, 51internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler, 57internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler, 63internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler, 71internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, Key key, ModifierKeys modifierKeys, 77internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler, 84internal static void RegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler, 92private static void PrivateRegisterCommandHandler(Type controlType, RoutedCommand command, ExecutedRoutedEventHandler executedRoutedEventHandler,
MS\Internal\Controls\ConnectionPointCookie.cs (1)
23internal ConnectionPointCookie(object source, object sink, Type eventInterface)
MS\Internal\Data\AccessorTable.cs (6)
23internal AccessorInfo(object accessor, Type propertyType, object[] args) 31internal Type PropertyType { get { return _propertyType; } } 37private readonly Type _propertyType; // type of the property 50internal AccessorInfo this[SourceValueType sourceValueType, Type type, string name] 179public AccessorTableKey(SourceValueType sourceValueType, Type type, string name) 202private readonly Type _type;
MS\Internal\Data\BindingWorker.cs (2)
44internal virtual Type SourcePropertyType { get { return null; } } 47internal Type TargetPropertyType { get { return TargetProperty.PropertyType; } }
MS\Internal\Data\ClrBindingWorker.cs (5)
58Type targetType = targetDP.PropertyType; 113internal override Type SourcePropertyType 377internal void SetupDefaultValueConverter(Type type) 480Type type = PW.GetType(k); 495Type type = PW.GetType(k);
MS\Internal\Data\DataBindEngine.cs (6)
330internal ViewRecord GetViewRecord(object collection, CollectionViewSource key, Type collectionViewType, bool createView, Func<object, object> GetSourceItem) 359internal IValueConverter GetDefaultValueConverter(Type sourceType, 360Type targetType, 655private readonly Type _sourceType, _targetType; 658public ValueConverterTableKey(Type sourceType, Type targetType, bool targetToSource)
MS\Internal\Data\DefaultValueConverter.cs (51)
34protected DefaultValueConverter(TypeConverter typeConverter, Type sourceType, Type targetType, 56internal static IValueConverter Create(Type sourceType, 57Type targetType, 62Type innerType; 176internal static TypeConverter GetConverter(Type type) 195internal static object TryParse(object o, Type targetType, CultureInfo culture) 209new Type[] { StringType, typeof(System.Globalization.NumberStyles), typeof(System.IFormatProvider) }, 218new Type[] { StringType, typeof(System.IFormatProvider) }, 227new Type[] { StringType }, 250protected object ConvertFrom(object o, Type destinationType, DependencyObject targetElement, CultureInfo culture) 255protected object ConvertTo(object o, Type destinationType, DependencyObject targetElement, CultureInfo culture) 261protected void EnsureConverter(Type type) 275private object ConvertHelper(object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, bool isForward) 361protected Type _sourceType; 362protected Type _targetType; 369static Type StringType = typeof(String); 384public SourceDefaultValueConverter(TypeConverter typeConverter, Type sourceType, Type targetType, 397public object Convert(object o, Type type, object parameter, CultureInfo culture) 402public object ConvertBack(object o, Type type, object parameter, CultureInfo culture) 420public TargetDefaultValueConverter(TypeConverter typeConverter, Type sourceType, Type targetType, 432public object Convert(object o, Type type, object parameter, CultureInfo culture) 437public object ConvertBack(object o, Type type, object parameter, CultureInfo culture) 449public SystemConvertConverter(Type sourceType, Type targetType) 455public object Convert(object o, Type type, object parameter, CultureInfo culture) 460public object ConvertBack(object o, Type type, object parameter, CultureInfo culture) 469public static bool CanConvert(Type sourceType, Type targetType) 513private static bool CanConvertChar(Type type) 523Type _sourceType, _targetType; 526static readonly Type[] SupportedTypes = { 535static readonly Type[] CharSupportedTypes = { 557public ObjectTargetConverter(Type sourceType, DataBindEngine engine) : 569public object Convert(object o, Type type, object parameter, CultureInfo culture) 575public object ConvertBack(object o, Type type, object parameter, CultureInfo culture) 604public ObjectSourceConverter(Type targetType, DataBindEngine engine) : 616public object Convert(object o, Type type, object parameter, CultureInfo culture) 633public object ConvertBack(object o, Type type, object parameter, CultureInfo culture) 659public object Convert(object o, Type type, object parameter, CultureInfo culture) 672public object ConvertBack(object o, Type type, object parameter, CultureInfo culture) 690internal InterfaceConverter(Type sourceType, Type targetType) 702public object Convert(object o, Type type, object parameter, CultureInfo culture) 707public object ConvertBack(object o, Type type, object parameter, CultureInfo culture) 712private object ConvertTo(object o, Type type) 717Type _sourceType; 718Type _targetType; 728virtual public object GetService(Type serviceType)
MS\Internal\Data\DynamicObjectAccessor.cs (6)
17protected DynamicObjectAccessor(Type ownerType, string propertyName) 23public Type OwnerType { get { return _ownerType; } } 26public Type PropertyType { get { return typeof(object); } } 33Type _ownerType; 43protected DynamicPropertyAccessor(Type ownerType, string propertyName) 59protected DynamicIndexerAccessor(Type ownerType, string propertyName)
MS\Internal\Data\DynamicValueConverter.cs (11)
24internal DynamicValueConverter(bool targetToSourceNeeded, Type sourceType, Type targetType) 30internal object Convert(object value, Type targetType) 35public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 41Type sourceType = value.GetType(); 60public object ConvertBack(object value, Type sourceType, object parameter, CultureInfo culture) 66Type targetType = value.GetType(); 86private void EnsureConverter(Type sourceType, Type targetType) 117private Type _sourceType; 118private Type _targetType;
MS\Internal\Data\IndexedEnumerable.cs (4)
486Type srcType = collection.GetType(); 488MethodInfo mi = srcType.GetMethod("IndexOf", new Type[] { typeof(object) }); 669bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e) 677protected virtual bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
MS\Internal\Data\IndexerPropertyInfo.cs (5)
71public override Type PropertyType 81public override Type DeclaringType 86public override object[] GetCustomAttributes(Type attributeType, bool inherit) 96public override bool IsDefined(Type attributeType, bool inherit) 106public override Type ReflectedType
MS\Internal\Data\ObjectRef.cs (1)
544private DependencyObject FindAncestorOfType(Type type, int level, DependencyObject d, bool isTracing)
MS\Internal\Data\PropertyPathWorker.cs (13)
187internal Type GetType(int level) 700Type declaringType = (oldPI != null) ? oldPI.DeclaringType 872Type declaringType = (newPI != null) ? newPI.DeclaringType 1034Type oldType = ReflectionHelper.GetReflectionType(oldItem); 1035Type newType = ReflectionHelper.GetReflectionType(item); 1036Type sourceType = null; 1318private MemberInfo[] GetIndexers(Type type, int k) 1362Type paramType = (aryPI != null) ? aryPI[i].ParameterType : typeof(Object); 1460Type type = pi.DeclaringType; 1727bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e) 1851public Type type; // Type of the value (useful for Arrays) 1865static readonly IList<Type> IListIndexerAllowlist = new Type[]
MS\Internal\Data\StaticPropertyChangedEventManager.cs (10)
44public static void AddHandler(Type type, EventHandler<PropertyChangedEventArgs> handler, string propertyName) 55public static void RemoveHandler(Type type, EventHandler<PropertyChangedEventArgs> handler, string propertyName) 125Type managerType = typeof(StaticPropertyChangedEventManager); 152private void PrivateAddHandler(Type type, EventHandler<PropertyChangedEventArgs> handler, string propertyName) 177private void PrivateRemoveHandler(Type type, EventHandler<PropertyChangedEventArgs> handler, string propertyName) 254public TypeRecord(Type type, StaticPropertyChangedEventManager manager) 261public Type Type { get { return _type; } } 566Type _type; // the type whose static property-changes we're listening to 602public void StartListening(Type type) 613public void StopListening(Type type)
MS\Internal\Data\ValueChangedEventManager.cs (1)
271Type managerType = typeof(ValueChangedEventManager);
MS\Internal\Data\ValueTable.cs (1)
196bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
MS\Internal\Data\ViewManager.cs (4)
497internal ViewRecord GetViewRecord(object collection, CollectionViewSource cvs, Type collectionViewType, bool createView, Func<object, object> GetSourceItem) 687private ViewRecord GetExistingView(object collection, CollectionViewSource cvs, Type collectionViewType, Func<object, object> GetSourceItem) 833private void ValidateViewType(CollectionView cv, Type collectionViewType) 841Type cachedViewType = (cvp == null) ? cv.GetType() : cvp.ProxiedView.GetType();
MS\Internal\Data\XmlBindingWorker.cs (1)
403bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs args)
MS\Internal\Data\XmlNodeChangedEventManager.cs (1)
133Type managerType = typeof(XmlNodeChangedEventManager);
MS\Internal\Documents\FixedDocumentPaginator.cs (1)
196object IServiceProvider.GetService(Type serviceType)
MS\Internal\Documents\FixedDocumentSequencePaginator.cs (1)
196object IServiceProvider.GetService(Type serviceType)
MS\Internal\Documents\FlowDocumentPaginator.cs (1)
1067object IServiceProvider.GetService(Type serviceType)
MS\Internal\Documents\FlowDocumentView.cs (1)
739object IServiceProvider.GetService(Type serviceType)
MS\Internal\Documents\TextBoxView.cs (1)
59object IServiceProvider.GetService(Type serviceType)
MS\Internal\Globalization\BamlTreeUpdater.cs (1)
825Type type = assm.GetType(fullTypeName);
MS\Internal\Helper.cs (5)
584Type targetType = targetObject.GetType(); 644Type memberType; 720static EventHandler<System.Windows.Markup.XamlSetMarkupExtensionEventArgs> LookupSetMarkupExtensionHandler(Type type) 1524static readonly Type NullableType = Type.GetType("System.Nullable`1");
MS\Internal\Interop\InternalDispatchObject.cs (4)
89MethodInfo IReflect.GetMethod(string name, BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers) 105PropertyInfo IReflect.GetProperty(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) 132Type IReflect.UnderlyingSystemType
MS\Internal\IO\Packaging\PackageFilter.cs (2)
280Type filterType = Type.GetTypeFromCLSID(clsid);
MS\Internal\LayoutDump.cs (9)
151internal static void AddUIElementDumpHandler(Type type, DumpCustomUIElement dumper) 159internal static void AddDocumentPageDumpHandler(Type type, DumpCustomDocumentPage dumper) 264Type t = element.GetType(); 313Type t = page.GetType(); 900Type paragraphResultType = paragraph.GetType(); 903Type paraClientType = paraClient.GetType(); 928Type type = typeof(Table); 945Type paragraphResultType = paragraph.GetType(); 960Type typeOfCell = cell.GetType();
MS\Internal\PtsHost\FlowDocumentPage.cs (1)
1147object IServiceProvider.GetService(Type serviceType)
MS\Internal\SystemCoreHelper.cs (1)
21internal static object NewDynamicPropertyAccessor(Type ownerType, string propertyName)
MS\Internal\SystemDataHelper.cs (2)
38internal static bool IsSqlNullableType(Type type) 68internal static object NullValueForSqlNullableType(Type type)
MS\Internal\TraceData.cs (2)
249Type type = o.GetType(); 265static public string IdentifyWeakEvent(Type type)
MS\Internal\WeakHashtable.cs (1)
234public static IWeakHashtable FromKeyType(Type tKey)
MS\Internal\WindowsRuntime\Generated\WinRT\ComWrappersSupport.cs (7)
62Type type = o.GetType(); 104foreach (var iface in interfaces) 108var ifaceAbiType = iface.FindHelperType(); 117&& Projections.TryGetCompatibleWindowsRuntimeTypeForVariantType(iface, out var compatibleIface)) 119var compatibleIfaceAbiType = compatibleIface.FindHelperType(); 154Type type = obj.GetType(); 172public InspectableInfo(Type type, Guid[] iids)
MS\Internal\WindowsRuntime\Generated\WinRT\ComWrappersSupport.net5.cs (1)
47public static IntPtr AllocateVtableMemory(Type vtableType, int size) => RuntimeHelpers.AllocateTypeAssociatedMemory(vtableType, size);
MS\Internal\WindowsRuntime\Generated\WinRT\GuidGenerator.cs (7)
13public static Guid GetGUID(Type type) 18public static Guid GetIID(Type type) 28public static string GetSignature(Type type) 30var helperType = type.FindHelperType(); 36return (string)sigMethod.Invoke(null, new Type[] { }); 90if (Projections.TryGetDefaultInterfaceTypeForRuntimeClassType(type, out Type iface)) 130public static Guid CreateIID(Type type)
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (11)
344protected static readonly Type HelperType = typeof(T).GetHelperType(); 345protected static readonly Type AbiType = typeof(T).GetAbiType(); 346protected static readonly Type MarshalerType = typeof(T).GetMarshalerType(); 782private static readonly Type HelperType = typeof(T).GetHelperType(); 894var helperType = typeof(T).GetHelperType(); 899typeof(IObjectReference).GetMethod("As", Type.EmptyTypes).MakeGenericMethod(helperType.FindVftblType()) 935else if (Projections.TryGetMarshalerTypeForProjectedRuntimeClass(objRef, out Type type)) 984Type type = typeof(T); 1021else if (type.IsValueType || type == typeof(Type)) 1104public static readonly Type AbiType; 1105public static readonly Type RefAbiType;
MS\Internal\WindowsRuntime\Generated\WinRT\Projections.cs (39)
12private static readonly Dictionary<Type, Type> CustomTypeToHelperTypeMappings = new Dictionary<Type, Type>(); 13private static readonly Dictionary<Type, Type> CustomAbiTypeToTypeMappings = new Dictionary<Type, Type>(); 14private static readonly Dictionary<string, Type> CustomAbiTypeNameToTypeMappings = new Dictionary<string, Type>(); 15private static readonly Dictionary<Type, string> CustomTypeToAbiTypeNameMappings = new Dictionary<Type, string>(); 25private static void RegisterCustomAbiTypeMappingNoLock(Type publicType, Type abiType, string winrtTypeName, bool isRuntimeClass = false) 37public static Type FindCustomHelperTypeMapping(Type publicType) 44return CustomTypeToHelperTypeMappings.TryGetValue(publicType.GetGenericTypeDefinition(), out Type abiTypeDefinition) 48return CustomTypeToHelperTypeMappings.TryGetValue(publicType, out Type abiType) ? abiType : null; 56public static Type FindCustomPublicTypeForAbiType(Type abiType) 63return CustomAbiTypeToTypeMappings.TryGetValue(abiType.GetGenericTypeDefinition(), out Type publicTypeDefinition) 67return CustomAbiTypeToTypeMappings.TryGetValue(abiType, out Type publicType) ? publicType : null; 75public static Type FindCustomTypeForAbiTypeName(string abiTypeName) 80return CustomAbiTypeNameToTypeMappings.TryGetValue(abiTypeName, out Type type) ? type : null; 88public static string FindCustomAbiTypeNameForType(Type type) 101public static bool IsTypeWindowsRuntimeType(Type type) 103Type typeToTest = type; 111private static bool IsTypeWindowsRuntimeTypeNoArray(Type type) 117foreach (var arg in type.GetGenericArguments()) 136public static bool TryGetCompatibleWindowsRuntimeTypeForVariantType(Type type, out Type compatibleType) 144var definition = type.GetGenericTypeDefinition(); 153var newArguments = new Type[genericArguments.Length]; 177internal static bool TryGetDefaultInterfaceTypeForRuntimeClassType(Type runtimeClass, out Type defaultInterface) 190internal static Type GetDefaultInterfaceTypeForRuntimeClassType(Type runtimeClass) 192if (!TryGetDefaultInterfaceTypeForRuntimeClassType(runtimeClass, out Type defaultInterface)) 199internal static bool TryGetMarshalerTypeForProjectedRuntimeClass(IObjectReference objectReference, out Type type)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IEnumerable.cs (2)
423private static readonly Type get_Current_0_Type = Expression.GetDelegateType(new Type[] { typeof(void*), Marshaler<T>.AbiType.MakeByRefType(), typeof(int) });
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IReadOnlyList.cs (4)
213private static readonly Type GetAt_0_Type = Expression.GetDelegateType(new Type[] { typeof(void*), typeof(uint), Marshaler<T>.AbiType.MakeByRefType(), typeof(int) }); 214private static readonly Type IndexOf_2_Type = Expression.GetDelegateType(new Type[] { typeof(void*), Marshaler<T>.AbiType, typeof(uint).MakeByRefType(), typeof(byte).MakeByRefType(), typeof(int) });
MS\Internal\WindowsRuntime\Generated\WinRT\TypeExtensions.cs (18)
11public static Type FindHelperType(this Type type) 17Type customMapping = Projections.FindCustomHelperTypeMapping(type); 28return Type.GetType(helper) ?? Type.GetType(helperTypeName2); 31public static Type GetHelperType(this Type type) 33var helperType = type.FindHelperType(); 39public static Type GetGuidType(this Type type) 44public static Type FindVftblType(this Type helperType) 46Type vftblType = helperType.GetNestedType("Vftbl"); 58public static Type GetAbiType(this Type type) 63public static Type GetMarshalerType(this Type type) 68public static bool IsDelegate(this Type type)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\WindowsRuntime\ReflectionHelper.cs (18)
58public static TResult ReflectionStaticCall<TResult>(this Type type, string methodName) 63method = type.GetMethod(methodName, Type.EmptyTypes); 91public static TResult ReflectionStaticCall<TResult, TArg>(this Type type, string methodName, TArg arg) 96method = type.GetMethod(methodName, new Type[] { typeof(TArg) }); 146method = obj.GetType().GetMethod(methodName, Type.EmptyTypes); 178method = obj.GetType().GetMethod(methodName, new Type[] { typeof(TArg1) }); 232method = obj.GetType().GetMethod(methodName, new Type[] { typeof(TArg1), typeof(TArg2) }); 307public static object ReflectionNew(this Type type) 309ConstructorInfo constructor = type.GetConstructor(Type.EmptyTypes); 332public static object ReflectionNew<TArg1>(this Type type, TArg1 arg1) 334ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(TArg1) }); 359public static object ReflectionNew<TArg1, TArg2>(this Type type, TArg1 arg1, TArg2 arg2) 361ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(TArg1), typeof(TArg2) }); 380/// <exception cref="AmbiguousMatchException">More than one property is found with the specified name. See <see cref="Type.GetProperty(string)"/></exception> 387Type type = obj.GetType(); 405/// <exception cref="AmbiguousMatchException">More than one property is found with the specified name. See <see cref="Type.GetProperty(string)"/></exception> 421/// <exception cref="AmbiguousMatchException">More than one property is found with the specified name. See <see cref="Type.GetProperty(string)"/></exception> 425public static TResult ReflectionStaticGetProperty<TResult>(this Type type, string propertyName)
System\Windows\Application.cs (1)
219internal object GetService(Type serviceType)
System\Windows\AttachedPropertyBrowsableForChildrenAttribute.cs (1)
103Type ownerType = dp.OwnerType;
System\Windows\Automation\Peers\GridViewAutomationPeer.cs (1)
288internal static Visual FindVisualByType(Visual parent, Type type)
System\Windows\ComponentResourceKey.cs (3)
28public ComponentResourceKey(Type typeInTargetAssembly, object resourceId) 43public Type TypeInTargetAssembly 128private Type _typeInTargetAssembly;
System\Windows\ComponentResourceKeyConverter.cs (3)
30public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 49public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 95public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Controls\AlternationConverter.cs (2)
35public object Convert (object o, Type targetType, object parameter, CultureInfo culture) 52public object ConvertBack(object o, Type targetType, object parameter, CultureInfo culture)
System\Windows\Controls\BooleanToSelectiveScrollingOrientationConverter.cs (2)
24public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 43public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
System\Windows\Controls\BooleanToVisibilityConverter.cs (2)
26public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 49public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
System\Windows\Controls\BorderGapMaskConverter.cs (2)
33public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 133public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
System\Windows\Controls\ContentPresenter.cs (3)
204Type type; // unused 623internal static object DataTypeForItem(object item, DependencyObject target, out Type type) 1138object IServiceProvider.GetService(Type serviceType) { return null; }
System\Windows\Controls\DataGrid.cs (1)
38Type ownerType = typeof(DataGrid);
System\Windows\Controls\DataGridAutoGeneratingColumnEventArgs.cs (4)
24public DataGridAutoGeneratingColumnEventArgs(string propertyName, Type propertyType, DataGridColumn column) : 37Type propertyType, 80public Type PropertyType 137private Type _propertyType;
System\Windows\Controls\DataGridColumn.cs (1)
1158Type propertyType = itemProperty.PropertyType;
System\Windows\Controls\DataGridHeadersVisibilityToVisibilityConverter.cs (2)
25public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 63public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
System\Windows\Controls\DataGridLengthConverter.cs (5)
22public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 25TypeCode tc = Type.GetTypeCode(sourceType); 49public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 127Type destinationType) 142ConstructorInfo ci = typeof(DataGridLength).GetConstructor(new Type[] { typeof(double), typeof(DataGridLengthUnitType) });
System\Windows\Controls\DeferredRunTextReference.cs (1)
48internal override Type GetValueType()
System\Windows\Controls\DeferredSelectedIndexReference.cs (1)
48internal override Type GetValueType()
System\Windows\Controls\DeferredTextReference.cs (1)
56internal override Type GetValueType()
System\Windows\Controls\FlowDocumentScrollViewer.cs (1)
1885object IServiceProvider.GetService(Type serviceType)
System\Windows\Controls\GridViewHeaderRowPresenter.cs (1)
1177Type headerType = (srcHeader != null ? srcHeader.GetType() : typeof(GridViewColumnHeader));
System\Windows\Controls\GridViewRowPresenter.cs (3)
89Type oldType = (e.OldValue != null) ? e.OldValue.GetType() : null; 90Type newType = (e.NewValue != null) ? e.NewValue.GetType() : null; 695private Type _oldContentType;
System\Windows\Controls\Image.cs (3)
605Type managerType = typeof(DownloadCompletedEventManager); 729Type managerType = typeof(DownloadFailedEventManager); 853Type managerType = typeof(DecodeFailedEventManager);
System\Windows\Controls\InkCanvas.cs (4)
47Type ownerType = typeof(InkCanvas); 2452Type ownerType = typeof(InkCanvas); 3001public object Convert(object o, Type type, object parameter, System.Globalization.CultureInfo culture) 3016public object ConvertBack(object o, Type type, object parameter, System.Globalization.CultureInfo culture)
System\Windows\Controls\ItemCollection.cs (1)
1931bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
System\Windows\Controls\ItemContainerGenerator.cs (3)
1108Type sourceType = source.GetType(); 2352bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e) 2798private Type _containerType; // type of containers on the recycle queue
System\Windows\Controls\ItemsPanelTemplate.cs (3)
65internal override Type TargetTypeInternal 72internal override void SetTargetTypeInternal(Type targetType) 78static internal Type DefaultTargetType
System\Windows\Controls\ItemsPresenter.cs (1)
305Type type = null;
System\Windows\Controls\MenuScrollingVisibilityConverter.cs (2)
37public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 107public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
System\Windows\Controls\PasswordTextNavigator.cs (2)
243Type ITextPointer.GetElementType(LogicalDirection direction) 602Type ITextPointer.ParentType
System\Windows\Controls\Primitives\DataGridColumnHeadersPresenter.cs (1)
33Type ownerType = typeof(DataGridColumnHeadersPresenter);
System\Windows\Controls\Primitives\DocumentPageView.cs (2)
505protected object GetService(Type serviceType) 1023object IServiceProvider.GetService(Type serviceType)
System\Windows\Controls\Primitives\DocumentViewerBase.cs (1)
1767object IServiceProvider.GetService(Type serviceType)
System\Windows\Controls\Primitives\GridViewRowPresenterBase.cs (2)
321bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs args) 467Type managerType = typeof(InternalCollectionChangedEventManager);
System\Windows\Controls\Primitives\Selector.cs (3)
601Type selectedType = (value != null) ? value.GetType() : null; 623private bool VerifyEqual(object knownValue, Type knownType, object itemValue, DynamicValueConverter converter) 629Type itemType = itemValue.GetType();
System\Windows\Controls\StickyNote.cs (5)
80Type owner = typeof(StickyNoteControl); 1898public object Convert(object o, Type type, object parameter, CultureInfo culture) 1914public object ConvertBack(object o, Type type, object parameter, CultureInfo culture) 1924public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 1942public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
System\Windows\Controls\TextBlock.cs (3)
135Type parentType = _complexContent.TextContainer.Parent.GetType(); 137Type valueType = value.GetType(); 268object IServiceProvider.GetService(Type serviceType)
System\Windows\Controls\ToolBar.cs (1)
467Type feType = fe.GetType();
System\Windows\Controls\VirtualizationCacheLengthConverter.cs (5)
33public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType) 36TypeCode tc = Type.GetTypeCode(sourceType); 64public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 129public override object ConvertTo(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object value, Type destinationType) 145ConstructorInfo ci = typeof(VirtualizationCacheLength).GetConstructor(new Type[] { typeof(double), typeof(VirtualizationCacheLengthUnit) });
System\Windows\Controls\VirtualizingStackPanel.cs (1)
12252for (Type t = o.GetType(); !isWPFControl && t != null; t = t.BaseType)
System\Windows\Controls\WebBrowser.cs (2)
427Type t = value.GetType(); 1035return Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(CLSID.WebBrowser)));
System\Windows\ControlTemplate.cs (7)
43public ControlTemplate(Type targetType) 86public Type TargetType 129private void ValidateTargetType(Type targetType, string argName) 151internal override Type TargetTypeInternal 166internal override void SetTargetTypeInternal(Type targetType) 184private Type _targetType; 188internal static readonly Type DefaultTargetType = typeof(Control);
System\Windows\CornerRadiusConverter.cs (5)
37public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType) 40TypeCode tc = Type.GetTypeCode(sourceType); 68public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 128public override object ConvertTo(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object value, Type destinationType) 144ConstructorInfo ci = typeof(CornerRadius).GetConstructor(new Type[] { typeof(double), typeof(double), typeof(double), typeof(double) });
System\Windows\Data\Binding.cs (1)
677internal override ValidationRule LookupValidationRule(Type type)
System\Windows\Data\BindingBase.cs (3)
427internal ValidationRule GetValidationRule(Type type) 441internal virtual ValidationRule LookupValidationRule(Type type) 446internal static ValidationRule LookupValidationRule(Type type, Collection<ValidationRule> collection)
System\Windows\Data\BindingExpression.cs (9)
350internal Type ConverterSourceType 416internal void SetupDefaultValueConverter(Type type) 1265Type targetType = GetEffectiveTargetType(); 1624private object ConvertHelper(IValueConverter converter, object value, Type targetType, object parameter, CultureInfo culture) 1695Type sourceType, 1852Type sourceType = Worker.SourcePropertyType; 2188private bool IsValidValueForUpdate(object value, Type sourceType) 2552bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e) 2750Type _sourceType;
System\Windows\Data\BindingExpressionBase.cs (9)
135Type type = parent.GetType(); 492bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e) 1603internal object NullValueForType(Type type) 1621internal ValidationRule LookupValidationRule(Type type) 1920internal virtual bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e) 2563internal Type GetEffectiveTargetType() 2565Type targetType = TargetProperty.PropertyType; 2586Type targetType = TargetProperty.PropertyType; 2664Type targetType = TargetProperty.PropertyType;
System\Windows\Data\BindingListCollectionView.cs (1)
2196Type itemType;
System\Windows\Data\CollectionContainer.cs (2)
274bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e) 282protected virtual bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
System\Windows\Data\CollectionView.cs (7)
1453Type itemType; 1509internal Type GetItemType(bool useRepresentativeItem) 1511Type collectionType = SourceCollection.GetType(); 1512Type[] interfaces = collectionType.GetInterfaces(); 1520Type interfaceType = interfaces[i]; 1525Type[] typeParameters = interfaceType.GetGenericArguments(); 1528Type type = typeParameters[0];
System\Windows\Data\CollectionViewSource.cs (15)
158typeof(Type), 161(Type)null, 171public Type CollectionViewType 173get { return (Type) GetValue(CollectionViewTypeProperty); } 181Type oldCollectionViewType = (Type) e.OldValue; 182Type newCollectionViewType = (Type) e.NewValue; 196protected virtual void OnCollectionViewTypeChanged(Type oldCollectionViewType, Type newCollectionViewType) 202Type type = (Type)o; 730bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e) 738protected virtual bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e) 912void EnsureView(object source, Type collectionViewType)
System\Windows\Data\CompositeCollection.cs (2)
416bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e) 424protected virtual bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
System\Windows\Data\DataChangedEventManager.cs (1)
127Type managerType = typeof(DataChangedEventManager);
System\Windows\Data\IMultiValueConverter.cs (2)
52object Convert(object[] values, Type targetType, object parameter, CultureInfo culture); 92object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture);
System\Windows\Data\IValueConverter.cs (2)
62object Convert(object value, Type targetType, object parameter, CultureInfo culture); 89object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture);
System\Windows\Data\ListCollectionView.cs (2)
690Type itemType = GetItemType(true); 693_itemConstructor = itemType.GetConstructor(Type.EmptyTypes);
System\Windows\Data\MultiBinding.cs (1)
352internal override ValidationRule LookupValidationRule(Type type)
System\Windows\Data\MultiBindingExpression.cs (3)
42_tempTypes = new Type[count]; 1080internal override bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e) 1434Type[] _tempTypes;
System\Windows\Data\ObjectDataProvider.cs (3)
91public Type ObjectType 364private bool SetObjectType(Type newType) 671Type _objectType;
System\Windows\Data\RelativeSource.cs (3)
66public RelativeSource(RelativeSourceMode mode, Type ancestorType, int ancestorLevel) 164public Type AncestorType 298private Type _ancestorType;
System\Windows\Data\ValueConversionAttribute.cs (8)
50public ValueConversionAttribute(Type sourceType, Type targetType) 61public Type SourceType 69public Type TargetType 77public Type ParameterType 112private Type _sourceType; 113private Type _targetType; 114private Type _parameterType;
System\Windows\DataTemplate.cs (3)
134internal override Type TargetTypeInternal 141internal override void SetTargetTypeInternal(Type targetType) 165static internal Type DefaultTargetType
System\Windows\DeferrableContentConverter.cs (1)
16public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
System\Windows\DialogResultConverter.cs (3)
36public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType) 48public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 72Type destinationType)
System\Windows\Documents\DocumentSequence.cs (2)
66object IServiceProvider.GetService(Type serviceType) 1086object IServiceProvider.GetService(Type serviceType)
System\Windows\Documents\DocumentSequenceHighlightLayer.cs (2)
97internal override Type OwnerType 158internal override Type OwnerType
System\Windows\Documents\DocumentSequenceTextContainer.cs (1)
872internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction, Type highlightLayerOwnerType)
System\Windows\Documents\DocumentSequenceTextPointer.cs (4)
124Type ITextPointer.GetElementType(LogicalDirection direction) 325Type ITextPointer.ParentType 695public static Type GetElementType(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 707public static Type GetElementType(DocumentSequenceTextPointer thisTp)
System\Windows\Documents\DPTypeDescriptorContext.cs (1)
180object IServiceProvider.GetService(Type serviceType)
System\Windows\Documents\FixedDocument.cs (2)
91object IServiceProvider.GetService(Type serviceType) 1375object IServiceProvider.GetService(Type serviceType)
System\Windows\Documents\FixedElement.cs (1)
360internal Type Type
System\Windows\Documents\FixedTextPointer.cs (2)
160Type ITextPointer.GetElementType(LogicalDirection direction) 530Type ITextPointer.ParentType
System\Windows\Documents\FlowDocument.cs (2)
66static private readonly Type _typeofThis = typeof(FlowDocument); 1696object IServiceProvider.GetService(Type serviceType)
System\Windows\Documents\HighlightChangedEventArgs.cs (1)
27internal abstract Type OwnerType { get; }
System\Windows\Documents\HighlightLayer.cs (1)
78internal abstract Type OwnerType { get; }
System\Windows\Documents\Highlights.cs (5)
60internal virtual object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction, Type highlightLayerOwnerType) 261internal HighlightLayer GetLayer(Type highlightLayerType) 409internal LayerHighlightChangedEventArgs(ReadOnlyCollection<TextSegment> ranges, Type ownerType) 425internal override Type OwnerType 437private readonly Type _ownerType;
System\Windows\Documents\ITextPointer.cs (2)
123Type GetElementType(LogicalDirection direction); 176Type ParentType { get; }
System\Windows\Documents\MsSpellCheckLib\SpellChecker\SpellChecker.cs (4)
643private static readonly Dictionary<bool, List<Type>> SuppressedExceptions = new Dictionary<bool, List<Type>> 645{false, new List<Type>{ /*empty*/ }}, 646{true, new List<Type> { typeof(COMException), typeof(UnauthorizedAccessException)}}
System\Windows\Documents\MsSpellCheckLib\SpellCheckerFactory\SpellCheckerFactory.cs (4)
53private static Dictionary<bool, List<Type>> SuppressedExceptions = new Dictionary<bool, List<Type>> 55{false, new List<Type> { /* empty */ } }, 56{true, new List<Type> { typeof(COMException), typeof(UnauthorizedAccessException)} }
System\Windows\Documents\MsSpellCheckLib\Utils\RetryHelper.cs (8)
51List<Type> ignoredExceptions, 107List<Type> ignoredExceptions, 167List<Type> ignoredExceptions, 229List<Type> ignoredExceptions, 282private static bool MatchException(Exception exception, List<Type> exceptions) 287Type exceptionType = exception.GetType(); 289Type match = exceptions.Find((e) => e.IsAssignableFrom(exceptionType)); 297private static void ValidateExceptionTypeList(List<Type> exceptions)
System\Windows\Documents\NullTextNavigator.cs (2)
119Type ITextPointer.GetElementType(LogicalDirection direction) 408Type ITextPointer.ParentType
System\Windows\Documents\Serialization\SerializerDescriptor.cs (1)
92Type factoryType = factoryInstance.GetType();
System\Windows\Documents\SpellerHighlightLayer.cs (2)
102internal override Type OwnerType 219internal override Type OwnerType
System\windows\Documents\TextEditor.cs (4)
321internal static void RegisterCommandHandlers(Type controlType, bool acceptsRichContent, bool readOnly, bool registerEventListeners) 330if (((Type)_registeredEditingTypes[i]).IsAssignableFrom(controlType)) 338if (controlType.IsAssignableFrom((Type)_registeredEditingTypes[i])) 341SR.Format(SR.TextEditorCanNotRegisterCommandHandler, ((Type)_registeredEditingTypes[i]).Name, controlType.Name));
System\windows\Documents\TextEditorCharacters.cs (1)
29internal static void _RegisterClassHandlers(Type controlType, bool registerEventListeners)
System\windows\Documents\TextEditorContextMenu.cs (1)
33internal static void _RegisterClassHandlers(Type controlType, bool registerEventListeners)
System\windows\Documents\TextEditorCopyPaste.cs (1)
35internal static void _RegisterClassHandlers(Type controlType, bool acceptsRichContent, bool readOnly, bool registerEventListeners)
System\windows\Documents\TextEditorDragDrop.cs (1)
36internal static void _RegisterClassHandlers(Type controlType, bool readOnly, bool registerEventListeners)
System\windows\Documents\TextEditorLists.cs (1)
28internal static void _RegisterClassHandlers(Type controlType, bool registerEventListeners)
System\windows\Documents\TextEditorMouse.cs (1)
32internal static void _RegisterClassHandlers(Type controlType, bool registerEventListeners)
System\windows\Documents\TextEditorParagraphs.cs (1)
28internal static void _RegisterClassHandlers(Type controlType, bool acceptsRichContent, bool registerEventListeners)
System\windows\Documents\TextEditorSelection.cs (1)
32internal static void _RegisterClassHandlers(Type controlType, bool registerEventListeners)
System\windows\Documents\TextEditorSpelling.cs (1)
29internal static void _RegisterClassHandlers(Type controlType, bool registerEventListeners)
System\windows\Documents\TextEditorTables.cs (1)
28internal static void _RegisterClassHandlers(Type controlType, bool registerEventListeners)
System\windows\Documents\TextEditorTyping.cs (2)
51internal static void _RegisterClassHandlers(Type controlType, bool registerEventListeners) 818Type parentType = position.ParentType;
System\Windows\Documents\TextElement.cs (1)
804Type valueType = value.GetType();
System\Windows\Documents\TextElementCollection.cs (1)
600Type elementType = array.GetType().GetElementType();
System\Windows\Documents\TextPointer.cs (3)
1420Type containerType = this.TextContainer.Parent.GetType(); 2409Type ITextPointer.GetElementType(LogicalDirection direction) 3609Type ITextPointer.ParentType
System\Windows\Documents\TextPointerBase.cs (10)
182Type forwardType = forwardPosition.GetElementType(LogicalDirection.Forward); 183Type backwardType = backwardPosition.GetElementType(LogicalDirection.Backward); 227Type parentType = position.ParentType; 280private static bool IsInAncestorScope(ITextPointer position, Type allowedParentType, Type limitingType) 283Type parentType = navigator.ParentType; 317Type elementType; 594Type elementType = position.GetElementType(direction); 1513private static bool IsNextToRichBreak(ITextPointer thisPosition, LogicalDirection direction, Type lineBreakType) 1521Type neighbor = thisPosition.GetElementType(direction);
System\Windows\Documents\TextRangeBase.cs (1)
676Type elementType;
System\Windows\Documents\TextRangeSerialization.cs (16)
537Type elementType = textReader.ParentType; 539Type elementTypeStandardized = TextSchema.GetStandardElementType(elementType, reduceElement); 646Type rootType; 657Type contextType = context.ParentType; 764private static void WriteInheritableProperties(Type elementTypeStandardized, ITextPointer context, XmlWriter xmlWriter, bool onlyAffected, DependencyObject complexProperties) 829private static void WriteNoninheritableProperties(Type elementTypeStandardized, ITextPointer context, XmlWriter xmlWriter, bool onlyAffected, DependencyObject complexProperties) 839Type propertyOwnerType = context.ParentType; 908private static void WriteNoninheritableProperty(XmlWriter xmlWriter, DependencyProperty property, object propertyValue, Type propertyOwnerType, bool onlyAffected, DependencyObject complexProperties, object localValue) 948private static void WriteLocallySetProperties(Type elementTypeStandardized, ITextPointer context, XmlWriter xmlWriter, DependencyObject complexProperties) 1058private static void WriteComplexProperties(XmlWriter xmlWriter, DependencyObject complexProperties, Type elementType) 1087private static string GetPropertyNameForElement(DependencyProperty property, Type elementType, bool forceComplexName) 1115Type elementTypeStandardized = TextSchema.GetStandardElementType(element.GetType(), reduceElement); 1162Type elementTypeStandardized = typeof(Image); 1507private static void ValidateMergingPositions(Type itemType, TextPointer start, TextPointer end) 1598private static void ApplyContextualProperty(Type targetType, TextPointer start, TextPointer end, DependencyProperty property, object value) 1935private static string FilterNaNStringValueForDoublePropertyType(string stringValue, Type propertyType)
System\Windows\Documents\TextSchema.cs (25)
120internal static bool IsValidChild(TextElement parent, Type childType) 125internal static bool ValidateChild(TextElement parent, Type childType, bool throwIfIllegalChild, bool throwIfIllegalHyperlinkDescendent) 151internal static bool IsValidChild(TextPointer position, Type childType) 156internal static bool ValidateChild(TextPointer position, Type childType, bool throwIfIllegalChild, bool throwIfIllegalHyperlinkDescendent) 183internal static bool IsValidSibling(Type siblingType, Type newType) 216internal static bool IsValidChild(ITextPointer position, Type childType) 232internal static bool IsValidChildOfContainer(Type parentType, Type childType) 257internal static bool IsFormattingType(Type elementType) 268internal static bool IsKnownType(Type elementType) 274internal static bool IsNonFormattingInline(Type elementType) 279internal static bool IsMergeableInline(Type elementType) 284internal static bool IsNonMergeableInline(Type elementType) 303internal static bool AllowsParagraphMerging(Type elementType) 323internal static bool IsParagraphOrBlockUIContainer(Type elementType) 331internal static bool IsBlock(Type type) 337internal static bool IsBreak(Type type) 361internal static Type GetStandardElementType(Type type, bool reduceElement) 454internal static DependencyProperty[] GetInheritableProperties(Type type) 475internal static DependencyProperty[] GetNoninheritableProperties(Type type) 758Type propertyType = property.PropertyType; 804private static bool IsValidChild(Type parentType, Type childType)
System\windows\Documents\TextSelectionHighlightLayer.cs (2)
263internal override Type OwnerType 363internal override Type OwnerType
System\Windows\Documents\TextStore.cs (1)
4830for (Type t = o.GetType(); !isWPFControl && t != null; t = t.BaseType)
System\Windows\Documents\TextTreeDeleteContentUndoUnit.cs (2)
405internal ElementContentContainer(Type elementType, PropertyRecord[] localValues, ResourceDictionary resources, ContentContainer childContainer) 446private readonly Type _elementType;
System\Windows\Documents\TextTreeExtractElementUndoUnit.cs (1)
95private readonly Type _type;
System\Windows\Documents\Typography.cs (2)
20static private readonly Type _typeofThis = typeof(Typography); 21static private readonly Type _typeofBool = typeof(bool);
System\Windows\Documents\XPSS0ValidatingLoader.cs (2)
54List<Type> safeTypes = new List<Type> { typeof(System.Windows.ResourceDictionary) };
System\Windows\Documents\ZoomPercentageConverter.cs (2)
64public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 128public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
System\Windows\DynamicResourceExtensionConverter.cs (3)
27public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 39public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) 50return new InstanceDescriptor(typeof(DynamicResourceExtension).GetConstructor(new Type[] { typeof(object) }),
System\Windows\EventSetterHandlerConverter.cs (4)
18static Type s_ServiceProviderContextType; 23public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType) 39public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 90Type destinationType)
System\Windows\FigureLengthConverter.cs (5)
46Type sourceType) 49TypeCode tc = Type.GetTypeCode(sourceType); 80Type destinationType) 142Type destinationType) 158ConstructorInfo ci = typeof(FigureLength).GetConstructor(new Type[] { typeof(double), typeof(FigureUnitType) });
System\Windows\FontSizeConverter.cs (3)
30public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 44public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 98public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\FrameworkElement.cs (3)
103static private readonly Type _typeofThis = typeof(FrameworkElement); 1415internal static object FindTemplateResourceInternal(DependencyObject target, object item, Type templateType) 1423Type type;
System\Windows\FrameworkElementFactory.cs (7)
39public FrameworkElementFactory(Type type) : this(type, null) 58public FrameworkElementFactory(Type type, string name) 68public Type Type 1102internal static void AddNodeToLogicalTree( DependencyObject parent, Type type, 1176Type targetType = _frameworkTemplate.TargetTypeInternal; 1219Type targetType = _frameworkTemplate.TargetTypeInternal; 1270private Type _type;
System\Windows\FrameworkPropertyMetadata.cs (1)
635protected override void OnApply(DependencyProperty dp, Type targetType)
System\Windows\FrameworkTemplate.cs (5)
1316internal virtual Type TargetTypeInternal 1323internal abstract void SetTargetTypeInternal(Type targetType); 1486internal Dictionary<int, Type> ChildTypeFromChildIndex 1524private Dictionary<int, Type> _childTypeFromChildIndex = new Dictionary<int, Type>();
System\Windows\GridLengthConverter.cs (5)
49Type sourceType) 52TypeCode tc = Type.GetTypeCode(sourceType); 83Type destinationType) 162Type destinationType) 178ConstructorInfo ci = typeof(GridLength).GetConstructor(new Type[] { typeof(double), typeof(GridUnitType) });
System\Windows\Input\Command\CommandConverter.cs (10)
44public override bool CanConvertFrom( ITypeDescriptorContext context, Type sourceType ) 63public override bool CanConvertTo( ITypeDescriptorContext context, Type destinationType ) 103Type ownerType = GetTypeFromContext(context, typeName); 123internal static ICommand ConvertFromHelper(Type ownerType, string localName ) 168public override object ConvertTo( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) 195internal static bool IsKnownType( Type commandType ) 209private Type GetTypeFromContext( ITypeDescriptorContext context, string typeName ) 238private static RoutedUICommand GetKnownCommand( string localName, Type ownerType ) 757internal static object GetKnownControlCommand(Type ownerType, string commandName) 804static void VerifyCommandDoesntExist( Type type, string name )
System\Windows\Input\Command\CommandValueSerializer.cs (8)
18if (context == null || context.GetValueSerializerFor(typeof(Type)) == null) 36Type ownerType = command.OwnerType; 80typeSerializer = context.GetValueSerializerFor(typeof(Type)); 96public override IEnumerable<Type> TypeReferences(object value, IValueSerializerContext context) 105return new Type[] { command.OwnerType }; 118Type declaringType = null; 137ValueSerializer typeSerializer = context.GetValueSerializerFor(typeof(Type)); 145declaringType = typeSerializer.ConvertFromString(typeName, context) as Type;
System\Windows\Interop\ActiveXHost.cs (1)
273return Activator.CreateInstance(Type.GetTypeFromCLSID(clsid));
System\Windows\LengthConverter.cs (5)
43public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType) 46TypeCode tc = Type.GetTypeCode(sourceType); 73public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 136Type destinationType) 153ConstructorInfo ci = typeof(double).GetConstructor(new Type[] { typeof(double) });
System\Windows\LostFocusEventManager.cs (1)
141Type managerType = typeof(LostFocusEventManager);
System\Windows\Markup\AttributeData.cs (8)
56Type targetType, 58Type declaringType, 61Type serializerType, 82internal Type SerializerType; // Type of serializer (if any) 113Type targetType, 115Type declaringType, 134internal Type TargetType; // Target type 135internal Type DeclaringType; // Type where Attribute is declared
System\Windows\Markup\Baml2006\Baml2006KeyRecord.cs (3)
12public KeyRecord(bool shared, bool sharedSet, int valuePosition, Type keyType) : 77public Type KeyType 79get { return _data as Type; }
System\Windows\Markup\Baml2006\Baml2006KnownTypes.cs (4)
30private delegate Type LazyTypeOf(); 52public static Type GetAttachableTargetType(Int16 propertyId) 88public static Type GetKnownType(Int16 typeId) 2061public static Type GetTypeConverterForKnownProperty(Int16 propertyId)
System\Windows\Markup\Baml2006\Baml2006Reader.cs (15)
34private Dictionary<Type, TypeConverter> _enumTypeConverterMap = new Dictionary<Type, TypeConverter>(); 387internal Type GetTypeOfFirstStartObject(KeyRecord record) 883Type memberType; 989Type type = Baml2006SchemaContext.KnownTypes.GetKnownType(typeId); 1131Type rootType = _root.GetType(); 1371Type currentType = eventProperty.DeclaringType.UnderlyingType; 1543Type type = BamlSchemaContext.GetXamlType(_binaryReader.ReadInt16()).UnderlyingType; 1583Type propertyType = property.Type.UnderlyingType; 1640Type typeExtensionType = null; 1641Type memberType = null; 1657Type ownerType = null; 1752Type ownerType = null; 1907Type memberType = null; 2613private string GetStaticExtensionValue(short valueId, out Type memberType, out object providedValue)
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (4)
52public override XamlType GetXamlType(Type type) 143internal Type GetClrType(Int16 typeId) 525private Type ResolveBamlTypeToType(BamlType bamlType) 542Type type = ResolveBamlTypeToType(bamlType);
System\Windows\Markup\Baml2006\Baml6ConstructorInfo.cs (3)
9public Baml6ConstructorInfo(List<Type> types, Func<Object[], object> ctor) 15List<Type> _types; 18public List<Type> Types { get { return _types; } }
System\Windows\Markup\Baml2006\DeferredBinaryDeserializerExtension.cs (1)
65object IServiceProvider.GetService(Type serviceType)
System\Windows\Markup\Baml2006\TypeConverterMarkupExtension.cs (1)
33object IServiceProvider.GetService(Type serviceType)
System\Windows\Markup\Baml2006\WpfGeneratedKnownProperties.cs (405)
1718Type type = typeof(System.Windows.Controls.AccessText); 1735Type type = typeof(System.Windows.Media.Animation.BeginStoryboard); 1751Type type = typeof(System.Windows.Media.Effects.BitmapEffectGroup); 1767Type type = typeof(System.Windows.Controls.Border); 1784Type type = typeof(System.Windows.Controls.Border); 1801Type type = typeof(System.Windows.Controls.Border); 1818Type type = typeof(System.Windows.Controls.Primitives.ButtonBase); 1835Type type = typeof(System.Windows.Controls.Primitives.ButtonBase); 1853Type type = typeof(System.Windows.Controls.Primitives.ButtonBase); 1869Type type = typeof(System.Windows.Controls.Primitives.ButtonBase); 1887Type type = typeof(System.Windows.Controls.ColumnDefinition); 1904Type type = typeof(System.Windows.Controls.ColumnDefinition); 1921Type type = typeof(System.Windows.Controls.ColumnDefinition); 1938Type type = typeof(System.Windows.Controls.ContentControl); 1956Type type = typeof(System.Windows.Controls.ContentControl); 1972Type type = typeof(System.Windows.Controls.ContentControl); 1988Type type = typeof(System.Windows.Controls.ContentControl); 2006Type type = typeof(System.Windows.ContentElement); 2023Type type = typeof(System.Windows.Controls.ContentPresenter); 2041Type type = typeof(System.Windows.Controls.ContentPresenter); 2058Type type = typeof(System.Windows.Controls.ContentPresenter); 2074Type type = typeof(System.Windows.Controls.ContentPresenter); 2090Type type = typeof(System.Windows.Controls.ContentPresenter); 2107Type type = typeof(System.Windows.Controls.Control); 2124Type type = typeof(System.Windows.Controls.Control); 2141Type type = typeof(System.Windows.Controls.Control); 2158Type type = typeof(System.Windows.Controls.Control); 2175Type type = typeof(System.Windows.Controls.Control); 2192Type type = typeof(System.Windows.Controls.Control); 2209Type type = typeof(System.Windows.Controls.Control); 2226Type type = typeof(System.Windows.Controls.Control); 2243Type type = typeof(System.Windows.Controls.Control); 2260Type type = typeof(System.Windows.Controls.Control); 2277Type type = typeof(System.Windows.Controls.Control); 2294Type type = typeof(System.Windows.Controls.Control); 2311Type type = typeof(System.Windows.Controls.Control); 2328Type type = typeof(System.Windows.Controls.Control); 2344Type type = typeof(System.Windows.Controls.Control); 2361Type type = typeof(System.Windows.Controls.DockPanel); 2378Type type = typeof(System.Windows.Controls.DockPanel); 2395Type type = typeof(System.Windows.Controls.Primitives.DocumentViewerBase); 2411Type type = typeof(System.Windows.Media.DrawingGroup); 2427Type type = typeof(System.Windows.Controls.FlowDocumentReader); 2443Type type = typeof(System.Windows.Controls.FlowDocumentScrollViewer); 2459Type type = typeof(System.Windows.FrameworkContentElement); 2475Type type = typeof(System.Windows.FrameworkElement); 2492Type type = typeof(System.Windows.FrameworkElement); 2509Type type = typeof(System.Windows.FrameworkElement); 2526Type type = typeof(System.Windows.FrameworkElement); 2543Type type = typeof(System.Windows.FrameworkElement); 2560Type type = typeof(System.Windows.FrameworkElement); 2577Type type = typeof(System.Windows.FrameworkElement); 2594Type type = typeof(System.Windows.FrameworkElement); 2611Type type = typeof(System.Windows.FrameworkElement); 2628Type type = typeof(System.Windows.FrameworkElement); 2644Type type = typeof(System.Windows.FrameworkElement); 2661Type type = typeof(System.Windows.FrameworkElement); 2678Type type = typeof(System.Windows.Media.GeneralTransformGroup); 2694Type type = typeof(System.Windows.Media.GeometryGroup); 2710Type type = typeof(System.Windows.Media.GradientBrush); 2726Type type = typeof(System.Windows.Controls.Grid); 2743Type type = typeof(System.Windows.Controls.Grid); 2760Type type = typeof(System.Windows.Controls.Grid); 2777Type type = typeof(System.Windows.Controls.Grid); 2794Type type = typeof(System.Windows.Controls.GridViewColumn); 2812Type type = typeof(System.Windows.Controls.HeaderedContentControl); 2830Type type = typeof(System.Windows.Controls.HeaderedContentControl); 2848Type type = typeof(System.Windows.Controls.HeaderedContentControl); 2864Type type = typeof(System.Windows.Controls.HeaderedContentControl); 2880Type type = typeof(System.Windows.Controls.HeaderedItemsControl); 2898Type type = typeof(System.Windows.Controls.HeaderedItemsControl); 2916Type type = typeof(System.Windows.Controls.HeaderedItemsControl); 2932Type type = typeof(System.Windows.Controls.HeaderedItemsControl); 2948Type type = typeof(System.Windows.Documents.Hyperlink); 2965Type type = typeof(System.Windows.Controls.Image); 2982Type type = typeof(System.Windows.Controls.Image); 2999Type type = typeof(System.Windows.Controls.ItemsControl); 3015Type type = typeof(System.Windows.Controls.ItemsControl); 3031Type type = typeof(System.Windows.Controls.ItemsControl); 3047Type type = typeof(System.Windows.Controls.ItemsControl); 3063Type type = typeof(System.Windows.Controls.ItemsControl); 3079Type type = typeof(System.Windows.Controls.ItemsControl); 3095Type type = typeof(System.Windows.Media.Media3D.MaterialGroup); 3111Type type = typeof(System.Windows.Media.Media3D.Model3DGroup); 3127Type type = typeof(System.Windows.Controls.Page); 3145Type type = typeof(System.Windows.Controls.Panel); 3162Type type = typeof(System.Windows.Shapes.Path); 3179Type type = typeof(System.Windows.Media.PathFigure); 3195Type type = typeof(System.Windows.Media.PathGeometry); 3212Type type = typeof(System.Windows.Controls.Primitives.Popup); 3228Type type = typeof(System.Windows.Controls.Primitives.Popup); 3245Type type = typeof(System.Windows.Controls.Primitives.Popup); 3262Type type = typeof(System.Windows.Controls.Primitives.Popup); 3279Type type = typeof(System.Windows.Controls.RowDefinition); 3296Type type = typeof(System.Windows.Controls.RowDefinition); 3313Type type = typeof(System.Windows.Controls.RowDefinition); 3330Type type = typeof(System.Windows.Controls.ScrollViewer); 3347Type type = typeof(System.Windows.Controls.ScrollViewer); 3364Type type = typeof(System.Windows.Controls.ScrollViewer); 3381Type type = typeof(System.Windows.Shapes.Shape); 3398Type type = typeof(System.Windows.Shapes.Shape); 3415Type type = typeof(System.Windows.Shapes.Shape); 3432Type type = typeof(System.Windows.Controls.TextBlock); 3449Type type = typeof(System.Windows.Controls.TextBlock); 3466Type type = typeof(System.Windows.Controls.TextBlock); 3483Type type = typeof(System.Windows.Controls.TextBlock); 3500Type type = typeof(System.Windows.Controls.TextBlock); 3517Type type = typeof(System.Windows.Controls.TextBlock); 3534Type type = typeof(System.Windows.Controls.TextBlock); 3551Type type = typeof(System.Windows.Controls.TextBlock); 3568Type type = typeof(System.Windows.Controls.TextBlock); 3585Type type = typeof(System.Windows.Controls.TextBlock); 3602Type type = typeof(System.Windows.Controls.TextBlock); 3619Type type = typeof(System.Windows.Controls.TextBox); 3636Type type = typeof(System.Windows.Controls.TextBox); 3653Type type = typeof(System.Windows.Documents.TextElement); 3670Type type = typeof(System.Windows.Documents.TextElement); 3687Type type = typeof(System.Windows.Documents.TextElement); 3704Type type = typeof(System.Windows.Documents.TextElement); 3721Type type = typeof(System.Windows.Documents.TextElement); 3738Type type = typeof(System.Windows.Documents.TextElement); 3755Type type = typeof(System.Windows.Documents.TextElement); 3772Type type = typeof(System.Windows.Media.Animation.TimelineGroup); 3788Type type = typeof(System.Windows.Controls.Primitives.Track); 3805Type type = typeof(System.Windows.Controls.Primitives.Track); 3822Type type = typeof(System.Windows.Controls.Primitives.Track); 3839Type type = typeof(System.Windows.Controls.Primitives.Track); 3856Type type = typeof(System.Windows.Controls.Primitives.Track); 3873Type type = typeof(System.Windows.Controls.Primitives.Track); 3890Type type = typeof(System.Windows.Media.Media3D.Transform3DGroup); 3906Type type = typeof(System.Windows.Media.TransformGroup); 3922Type type = typeof(System.Windows.UIElement); 3939Type type = typeof(System.Windows.UIElement); 3956Type type = typeof(System.Windows.UIElement); 3973Type type = typeof(System.Windows.UIElement); 3990Type type = typeof(System.Windows.UIElement); 4007Type type = typeof(System.Windows.Controls.Viewport3D); 4024Type type = typeof(System.Windows.Controls.AdornedElementPlaceholder); 4041Type type = typeof(System.Windows.Documents.AdornerDecorator); 4058Type type = typeof(System.Windows.Documents.AnchoredBlock); 4075Type type = typeof(System.Windows.Markup.ArrayExtension); 4092Type type = typeof(System.Windows.Documents.BlockUIContainer); 4109Type type = typeof(System.Windows.Documents.Bold); 4126Type type = typeof(System.Windows.Media.Animation.BooleanAnimationUsingKeyFrames); 4143Type type = typeof(System.Windows.Controls.Border); 4160Type type = typeof(System.Windows.Controls.Primitives.BulletDecorator); 4177Type type = typeof(System.Windows.Controls.Button); 4195Type type = typeof(System.Windows.Controls.Primitives.ButtonBase); 4213Type type = typeof(System.Windows.Media.Animation.ByteAnimationUsingKeyFrames); 4230Type type = typeof(System.Windows.Controls.Canvas); 4247Type type = typeof(System.Windows.Media.Animation.CharAnimationUsingKeyFrames); 4264Type type = typeof(System.Windows.Controls.CheckBox); 4282Type type = typeof(System.Windows.Media.Animation.ColorAnimationUsingKeyFrames); 4299Type type = typeof(System.Windows.Controls.ComboBox); 4316Type type = typeof(System.Windows.Controls.ComboBoxItem); 4334Type type = typeof(System.Windows.Controls.ContextMenu); 4351Type type = typeof(System.Windows.Controls.ControlTemplate); 4368Type type = typeof(System.Windows.DataTemplate); 4385Type type = typeof(System.Windows.DataTrigger); 4402Type type = typeof(System.Windows.Media.Animation.DecimalAnimationUsingKeyFrames); 4419Type type = typeof(System.Windows.Controls.Decorator); 4436Type type = typeof(System.Windows.Controls.DockPanel); 4453Type type = typeof(System.Windows.Controls.DocumentViewer); 4469Type type = typeof(System.Windows.Media.Animation.DoubleAnimationUsingKeyFrames); 4486Type type = typeof(System.Windows.EventTrigger); 4503Type type = typeof(System.Windows.Controls.Expander); 4521Type type = typeof(System.Windows.Documents.Figure); 4538Type type = typeof(System.Windows.Documents.FixedDocument); 4555Type type = typeof(System.Windows.Documents.FixedDocumentSequence); 4572Type type = typeof(System.Windows.Documents.FixedPage); 4589Type type = typeof(System.Windows.Documents.Floater); 4606Type type = typeof(System.Windows.Documents.FlowDocument); 4623Type type = typeof(System.Windows.Controls.FlowDocumentPageViewer); 4639Type type = typeof(System.Windows.FrameworkTemplate); 4656Type type = typeof(System.Windows.Controls.Grid); 4673Type type = typeof(System.Windows.Controls.GridView); 4690Type type = typeof(System.Windows.Controls.GridViewColumnHeader); 4708Type type = typeof(System.Windows.Controls.GroupBox); 4726Type type = typeof(System.Windows.Controls.GroupItem); 4744Type type = typeof(System.Windows.Controls.HeaderedContentControl); 4762Type type = typeof(System.Windows.Controls.HeaderedItemsControl); 4779Type type = typeof(System.Windows.HierarchicalDataTemplate); 4796Type type = typeof(System.Windows.Documents.Hyperlink); 4813Type type = typeof(System.Windows.Controls.InkCanvas); 4830Type type = typeof(System.Windows.Controls.InkPresenter); 4847Type type = typeof(System.Windows.Documents.InlineUIContainer); 4864Type type = typeof(System.Windows.Input.InputScopeName); 4882Type type = typeof(System.Windows.Media.Animation.Int16AnimationUsingKeyFrames); 4899Type type = typeof(System.Windows.Media.Animation.Int32AnimationUsingKeyFrames); 4916Type type = typeof(System.Windows.Media.Animation.Int64AnimationUsingKeyFrames); 4933Type type = typeof(System.Windows.Documents.Italic); 4950Type type = typeof(System.Windows.Controls.ItemsControl); 4967Type type = typeof(System.Windows.Controls.ItemsPanelTemplate); 4984Type type = typeof(System.Windows.Controls.Label); 5002Type type = typeof(System.Windows.Media.LinearGradientBrush); 5018Type type = typeof(System.Windows.Documents.List); 5035Type type = typeof(System.Windows.Controls.ListBox); 5052Type type = typeof(System.Windows.Controls.ListBoxItem); 5070Type type = typeof(System.Windows.Documents.ListItem); 5087Type type = typeof(System.Windows.Controls.ListView); 5104Type type = typeof(System.Windows.Controls.ListViewItem); 5122Type type = typeof(System.Windows.Media.Animation.MatrixAnimationUsingKeyFrames); 5139Type type = typeof(System.Windows.Controls.Menu); 5156Type type = typeof(System.Windows.Controls.Primitives.MenuBase); 5173Type type = typeof(System.Windows.Controls.MenuItem); 5190Type type = typeof(System.Windows.Media.Media3D.ModelVisual3D); 5207Type type = typeof(System.Windows.Data.MultiBinding); 5224Type type = typeof(System.Windows.MultiDataTrigger); 5241Type type = typeof(System.Windows.MultiTrigger); 5258Type type = typeof(System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames); 5275Type type = typeof(System.Windows.Documents.PageContent); 5292Type type = typeof(System.Windows.Navigation.PageFunctionBase); 5310Type type = typeof(System.Windows.Controls.Panel); 5327Type type = typeof(System.Windows.Documents.Paragraph); 5344Type type = typeof(System.Windows.Media.Animation.ParallelTimeline); 5360Type type = typeof(System.Windows.Media.Animation.Point3DAnimationUsingKeyFrames); 5377Type type = typeof(System.Windows.Media.Animation.PointAnimationUsingKeyFrames); 5394Type type = typeof(System.Windows.Data.PriorityBinding); 5411Type type = typeof(System.Windows.Media.Animation.QuaternionAnimationUsingKeyFrames); 5428Type type = typeof(System.Windows.Media.RadialGradientBrush); 5444Type type = typeof(System.Windows.Controls.RadioButton); 5462Type type = typeof(System.Windows.Media.Animation.RectAnimationUsingKeyFrames); 5479Type type = typeof(System.Windows.Controls.Primitives.RepeatButton); 5497Type type = typeof(System.Windows.Controls.RichTextBox); 5514Type type = typeof(System.Windows.Controls.RichTextBox); 5531Type type = typeof(System.Windows.Media.Animation.Rotation3DAnimationUsingKeyFrames); 5548Type type = typeof(System.Windows.Documents.Run); 5565Type type = typeof(System.Windows.Controls.ScrollViewer); 5583Type type = typeof(System.Windows.Documents.Section); 5600Type type = typeof(System.Windows.Controls.Primitives.Selector); 5617Type type = typeof(System.Windows.Media.Animation.SingleAnimationUsingKeyFrames); 5634Type type = typeof(System.Windows.Media.Animation.SizeAnimationUsingKeyFrames); 5651Type type = typeof(System.Windows.Documents.Span); 5668Type type = typeof(System.Windows.Controls.StackPanel); 5685Type type = typeof(System.Windows.Controls.Primitives.StatusBar); 5702Type type = typeof(System.Windows.Controls.Primitives.StatusBarItem); 5720Type type = typeof(System.Windows.Media.Animation.Storyboard); 5736Type type = typeof(System.Windows.Media.Animation.StringAnimationUsingKeyFrames); 5753Type type = typeof(System.Windows.Style); 5770Type type = typeof(System.Windows.Controls.TabControl); 5787Type type = typeof(System.Windows.Controls.TabItem); 5805Type type = typeof(System.Windows.Controls.Primitives.TabPanel); 5822Type type = typeof(System.Windows.Documents.Table); 5839Type type = typeof(System.Windows.Documents.TableCell); 5856Type type = typeof(System.Windows.Documents.TableRow); 5873Type type = typeof(System.Windows.Documents.TableRowGroup); 5890Type type = typeof(System.Windows.Controls.TextBlock); 5907Type type = typeof(System.Windows.Media.Animation.ThicknessAnimationUsingKeyFrames); 5924Type type = typeof(System.Windows.Controls.Primitives.ToggleButton); 5942Type type = typeof(System.Windows.Controls.ToolBar); 5959Type type = typeof(System.Windows.Controls.Primitives.ToolBarOverflowPanel); 5976Type type = typeof(System.Windows.Controls.Primitives.ToolBarPanel); 5993Type type = typeof(System.Windows.Controls.ToolBarTray); 6010Type type = typeof(System.Windows.Controls.ToolTip); 6028Type type = typeof(System.Windows.Controls.TreeView); 6045Type type = typeof(System.Windows.Controls.TreeViewItem); 6062Type type = typeof(System.Windows.Trigger); 6079Type type = typeof(System.Windows.Documents.Underline); 6096Type type = typeof(System.Windows.Controls.Primitives.UniformGrid); 6113Type type = typeof(System.Windows.Controls.UserControl); 6131Type type = typeof(System.Windows.Media.Animation.Vector3DAnimationUsingKeyFrames); 6148Type type = typeof(System.Windows.Media.Animation.VectorAnimationUsingKeyFrames); 6165Type type = typeof(System.Windows.Controls.Viewbox); 6182Type type = typeof(System.Windows.Media.Media3D.Viewport3DVisual); 6199Type type = typeof(System.Windows.Controls.VirtualizingPanel); 6216Type type = typeof(System.Windows.Controls.VirtualizingStackPanel); 6233Type type = typeof(System.Windows.Window); 6251Type type = typeof(System.Windows.Controls.WrapPanel); 6268Type type = typeof(System.Windows.Data.XmlDataProvider); 6285Type type = typeof(System.Windows.Controls.ControlTemplate); 6302Type type = typeof(System.Windows.DataTemplate); 6319Type type = typeof(System.Windows.DataTemplate); 6338Type type = typeof(System.Windows.Controls.ControlTemplate); 6342typeof(System.Type), // type 6347bamlMember.TypeConverterType = typeof(System.Type); 6349bamlMember.SetDelegate = delegate(object target, object value) { ((System.Windows.Controls.ControlTemplate)target).TargetType = (System.Type)value; }; 6358Type type = typeof(System.Windows.FrameworkElement); 6376Type type = typeof(System.Windows.FrameworkTemplate); 6395Type type = typeof(System.Windows.Controls.Grid); 6412Type type = typeof(System.Windows.Controls.Grid); 6429Type type = typeof(System.Windows.MultiTrigger); 6446Type type = typeof(System.Windows.NameScope); 6462Type type = typeof(System.Windows.Style); 6466typeof(System.Type), // type 6471bamlMember.TypeConverterType = typeof(System.Type); 6473bamlMember.SetDelegate = delegate(object target, object value) { ((System.Windows.Style)target).TargetType = (System.Type)value; }; 6482Type type = typeof(System.Windows.Style); 6499Type type = typeof(System.Windows.Setter); 6517Type type = typeof(System.Windows.Setter); 6536Type type = typeof(System.Windows.Data.Binding); 6554Type type = typeof(System.Windows.ComponentResourceKey); 6573Type type = typeof(System.Windows.ComponentResourceKey); 6577typeof(System.Type), // type 6582bamlMember.TypeConverterType = typeof(System.Type); 6583bamlMember.SetDelegate = delegate(object target, object value) { ((System.Windows.ComponentResourceKey)target).TypeInTargetAssembly = (System.Type)value; }; 6592Type type = typeof(System.Windows.Data.Binding); 6609Type type = typeof(System.Windows.Data.Binding); 6628Type type = typeof(System.Windows.Data.Binding); 6645Type type = typeof(System.Windows.Data.Binding); 6663Type type = typeof(System.Windows.Media.Animation.Timeline); 6680Type type = typeof(System.Windows.Style); 6698Type type = typeof(System.Windows.Data.Binding); 6716Type type = typeof(System.Windows.Data.Binding); 6734Type type = typeof(System.Windows.ResourceDictionary); 6752Type type = typeof(System.Windows.Trigger); 6770Type type = typeof(System.Windows.Trigger); 6789Type type = typeof(System.Windows.Data.RelativeSource); 6793typeof(System.Type), // type 6798bamlMember.TypeConverterType = typeof(System.Type); 6799bamlMember.SetDelegate = delegate(object target, object value) { ((System.Windows.Data.RelativeSource)target).AncestorType = (System.Type)value; }; 6808Type type = typeof(System.Windows.UIElement); 6825Type type = typeof(System.Windows.FrameworkContentElement); 6842Type type = typeof(System.Windows.FrameworkContentElement); 6860Type type = typeof(System.Windows.Style); 6878Type type = typeof(System.Windows.FrameworkTemplate); 6896Type type = typeof(System.Windows.Application); 6914Type type = typeof(System.Windows.Data.MultiBinding); 6931Type type = typeof(System.Windows.Data.MultiBinding); 6950Type type = typeof(System.Windows.Media.LinearGradientBrush); 6967Type type = typeof(System.Windows.Media.LinearGradientBrush); 6984Type type = typeof(System.Windows.Input.CommandBinding); 7002Type type = typeof(System.Windows.Condition); 7021Type type = typeof(System.Windows.Condition); 7039Type type = typeof(System.Windows.Condition); 7056Type type = typeof(System.Windows.Data.BindingBase); 7075Type type = typeof(System.Windows.Window); 7092Type type = typeof(System.Windows.Window); 7109Type type = typeof(System.Windows.Window); 7126Type type = typeof(System.Windows.Shapes.Shape); 7143Type type = typeof(System.Windows.Shapes.Shape); 7160Type type = typeof(System.Windows.Shapes.Shape); 7177Type type = typeof(System.Windows.Media.TileBrush); 7194Type type = typeof(System.Windows.Media.TileBrush); 7211Type type = typeof(System.Windows.Media.TileBrush); 7228Type type = typeof(System.Windows.Media.GeometryDrawing); 7244Type type = typeof(System.Windows.Controls.TextBox); 7261Type type = typeof(System.Windows.Controls.StackPanel); 7278Type type = typeof(System.Windows.Controls.Primitives.Track); 7295Type type = typeof(System.Windows.Controls.Primitives.Track); 7312Type type = typeof(System.Windows.Controls.Primitives.Track); 7329Type type = typeof(System.Windows.EventTrigger); 7347Type type = typeof(System.Windows.Input.InputBinding); 7364Type type = typeof(System.Windows.Input.KeyBinding); 7382Type type = typeof(System.Windows.Controls.TextBox); 7399Type type = typeof(System.Windows.Controls.TextBlock); 7416Type type = typeof(System.Windows.Navigation.JournalEntryUnifiedViewConverter); 7433Type type = typeof(System.Windows.Media.GradientBrush); 7450Type type = typeof(System.Windows.Controls.MenuItem); 7468Type type = typeof(System.Windows.DataTrigger); 7487Type type = typeof(System.Windows.DataTrigger); 7504Type type = typeof(System.Windows.Setter); 7523Type type = typeof(System.Windows.ResourceDictionary); 7541Type type = typeof(System.Windows.Media.Animation.BeginStoryboard); 7559Type type = typeof(System.Windows.ResourceDictionary); 7576Type type = typeof(System.Windows.Input.KeyboardNavigation); 7593Type type = typeof(System.Windows.Input.KeyboardNavigation); 7610Type type = typeof(System.Windows.Controls.Primitives.ScrollBar); 7627Type type = typeof(System.Windows.Trigger); 7646Type type = typeof(System.Windows.EventTrigger); 7664Type type = typeof(System.Windows.Controls.DefinitionBase); 7681Type type = typeof(System.Windows.Controls.ToolTipService); 7699Type type = typeof(System.Windows.Media.PathFigure); 7716Type type = typeof(System.Windows.Media.PathFigure); 7733Type type = typeof(System.Windows.Controls.Primitives.ButtonBase); 7750Type type = typeof(System.Windows.Documents.Block); 7767Type type = typeof(System.Windows.UIElement); 7784Type type = typeof(System.Windows.Media.Pen); 7801Type type = typeof(System.Windows.Controls.Primitives.BulletDecorator); 7818Type type = typeof(System.Windows.UIElement); 7835Type type = typeof(System.Windows.UIElement); 7852Type type = typeof(System.Windows.UIElement); 7869Type type = typeof(System.Windows.Media.SolidColorBrush); 7886Type type = typeof(System.Windows.Media.Brush); 7903Type type = typeof(System.Windows.Controls.Primitives.TextBoxBase); 7920Type type = typeof(System.Windows.Media.PathSegment); 7937Type type = typeof(System.Windows.Controls.VirtualizingPanel); 7954Type type = typeof(System.Windows.Shapes.Shape); 7971Type type = typeof(System.Windows.Controls.Frame); 7988Type type = typeof(System.Windows.Controls.Frame); 8005Type type = typeof(System.Windows.Media.Animation.Storyboard); 8022Type type = typeof(System.Windows.Data.XmlDataProvider); 8040Type type = typeof(System.Windows.Controls.Primitives.Selector); 8057Type type = typeof(System.Windows.DataTemplate); 8077Type type = typeof(System.Windows.Shapes.Shape); 8094Type type = typeof(System.Windows.UIElement); 8111Type type = typeof(System.Windows.Controls.MenuItem); 8128Type type = typeof(System.Windows.Controls.Panel); 8145Type type = typeof(System.Windows.Data.Binding); 8163Type type = typeof(System.Windows.Window); 8180Type type = typeof(System.Windows.Data.ObjectDataProvider); 8184typeof(System.Type), // type 8189bamlMember.TypeConverterType = typeof(System.Type); 8190bamlMember.SetDelegate = delegate(object target, object value) { ((System.Windows.Data.ObjectDataProvider)target).ObjectType = (System.Type)value; }; 8199Type type = typeof(System.Windows.Controls.ToolBar); 8217Type type = typeof(System.Windows.Controls.Primitives.TextBoxBase); 8234Type type = typeof(System.Windows.Controls.Primitives.TextBoxBase); 8251Type type = typeof(System.Windows.FrameworkElement); 8268Type type = typeof(System.Windows.MultiDataTrigger); 8285Type type = typeof(System.Windows.Input.KeyBinding); 8302Type type = typeof(System.Windows.Data.Binding); 8321Type type = typeof(System.Windows.Controls.Canvas); 8338Type type = typeof(System.Windows.Controls.Canvas); 8355Type type = typeof(System.Windows.Controls.Canvas); 8372Type type = typeof(System.Windows.Controls.Canvas); 8389Type type = typeof(System.Windows.Media.Animation.Storyboard);
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (22)
1774new List<Type>() { typeof(System.Type) }, 1778(System.Type)arguments[0]); 1854new List<Type>() { typeof(System.String) }, 2697new List<Type>() { typeof(System.Object) }, 2827new List<Type>() { typeof(System.Type), typeof(System.Object) }, 2831(System.Type)arguments[0], 3167new List<Type>() { typeof(System.Object) }, 4035new List<Type>() { typeof(System.Object) }, 8296new List<Type>() { typeof(System.Windows.Data.RelativeSourceMode) }, 8303new List<Type>() { typeof(System.Windows.Data.RelativeSourceMode), typeof(System.Type), typeof(System.Int32) }, 8308(System.Type)arguments[1], 9426new List<Type>() { typeof(System.String) }, 9445new List<Type>() { typeof(System.Object) }, 9877new List<Type>() { typeof(System.Windows.DependencyProperty) }, 10091new List<Type>() { typeof(System.String) }, 10653new List<Type>() { typeof(System.Type) }, 10657(System.Type)arguments[0]); 11832new List<Type>() { typeof(System.Object) },
System\Windows\Markup\Baml2006\WpfKnownMember.cs (6)
29Type _deferringLoader; 30Type _typeConverterType; 31Type _type; 81Type type, 139public Type TypeConverterType 166public Type DeferringLoaderType
System\Windows\Markup\Baml2006\WpfKnownMemberInvoker.cs (3)
50Type declaringType = _member.UnderlyingMember.DeclaringType; 53Type[] args = new Type[] { typeof(DependencyObject) };
System\Windows\Markup\Baml2006\WpfKnownType.cs (11)
30Type _underlyingType; 37Type _deferringLoader; 38Type _typeConverterType; 67Type underlyingType) 75Type underlyingType, 231public Type TypeConverterType 241public Type DeferringLoaderType 337foreach (Type type in info.Types) 363object[] ICustomAttributeProvider.GetCustomAttributes(Type attributeType, bool inherit) 385private bool TryGetCustomAttribute(Type attributeType, out Attribute result) 416bool ICustomAttributeProvider.IsDefined(Type attributeType, bool inherit)
System\Windows\Markup\Baml2006\WpfMemberInvoker.cs (3)
70Type declaringType = _member.UnderlyingMember.DeclaringType; 73Type[] args = new Type[] { typeof(DependencyObject) };
System\Windows\Markup\Baml2006\WpfSharedBamlSchemaContext.cs (9)
34private Dictionary<Type, XamlType> _masterTypeTable; 57_masterTypeTable = new Dictionary<Type, XamlType>(256); 176public override XamlType GetXamlType(Type type) 189private XamlType GetUnknownXamlType(Type type) 205internal XamlType GetKnownXamlType(Type type) 247internal XamlValueConverter<XamlDeferringLoader> GetDeferringLoader(Type loaderType) 252internal XamlValueConverter<TypeConverter> GetTypeConverter(Type converterType) 274internal Type ResolvePrefixedNameWithAdditionalWpfSemantics(string prefixedName, DependencyObject element) 299Type result = System.Windows.Markup.XamlTypeMapper.GetTypeFromName(prefixedName, element);
System\Windows\Markup\Baml2006\WpfSharedXamlSchemaContext.cs (5)
19public override XamlType GetXamlType(Type type) 42internal static void RequireRuntimeType(Type type) 47Type runtimeType = typeof(object).GetType(); 60private Dictionary<Type, XamlType> _masterTypeTable = new Dictionary<Type, XamlType>();
System\Windows\Markup\Baml2006\WpfXamlType.cs (1)
75public WpfXamlType(Type type, XamlSchemaContext schema, bool isBamlScenario, bool useV3Rules)
System\Windows\Markup\BamlCollectionHolder.cs (1)
77internal Type PropertyType
System\Windows\Markup\BamlMapTable.cs (47)
94internal static Type GetKnownTypeFromId(short id) 123Type probeType = KnownTypes.Types[probe]; 158internal static short GetKnownTypeIdFromType(Type type) 196internal static KnownElements GetKnownTypeConverterIdFromType(Type type) 203else if (type == typeof(System.Type)) 226internal TypeConverter GetKnownConverterFromType(Type type) 246internal static TypeConverter GetKnownConverterFromType_NoCache(Type type) 280internal Type GetKnownConverterTypeFromType(Type type) 301if (type == typeof(System.Type)) 326private static Type GetKnownConverterTypeFromPropName( 327Type propOwnerType, 401internal Type GetTypeFromId(short id) 403Type type = null; 511private short GetAssemblyIdForType(Type t) 531Type propType, 578Type t = GetTypeFromId(typeId); 642Type ownerType = record.OwnerType; 756internal Type GetTypeFromTypeInfo(BamlTypeInfoRecord typeInfo) 776Type type = assembly.GetType(typeInfo.TypeFullName); 789private Type GetAttributeOwnerType(BamlAttributeInfoRecord bamlAttributeInfoRecord) 811internal Type GetCLRPropertyTypeAndNameFromId(short attributeId, out string propName) 814Type propType = null; 847internal DependencyProperty GetDependencyPropertyValueFromId(short memberId, string memberName, out Type declaringType) 894Type declaringType = GetTypeFromId(ownerTypeId); 940Type ownerType = GetAttributeOwnerType(bamlAttributeInfoRecord); 953internal short GetAttributeOrTypeId(BinaryWriter binaryWriter, Type declaringType, string memberName, out short typeId) 1207Type elementType, 1291Type owningType, // Actual type of the object the owns or declares this attribute 1293Type attributeType, // Type of the attribute or property itself; not its owner type 1304Type owningType, // Actual type of the object the owns or declares this attribute 1306Type attributeType, // Type of the attribute or property itself; not its owner type 1318Type serializerType = XamlTypeMapper.GetXamlSerializerForType(owningType); 1369Type ownerType, // Type of object that owns or declares this attribute 1370Type attributeType, // Type of the attribute or property itself; not its owner type 1374out Type converterOrSerializerType) 1485Type defaultTargetType) 1488Type targetType = null; 1534Type declaringType, // Type of object that owns or declares this attribute 1535Type attributeType) // Type of the attribute or property itself; not its owner type 1553private Type GetCustomConverter( 1555Type ownerType, // Type of object that owns or declares this attribute 1557Type attributeType) // Type of the attribute or property itself; not its owner type 1560Type converterType = GetKnownConverterTypeFromPropName(ownerType, fieldName); 1594private Type GetCustomSerializer( 1595Type type, 1709private TypeConverter GetConverterFromCache(Type type)
System\Windows\Markup\BamlReader.cs (3)
1031Type propertyType = attrInfo.GetPropertyType(); 1040Type declaringType = null; 2183Type converter = MapTable.GetTypeFromId(converterTypeId);
System\Windows\Markup\BamlRecordReader.cs (37)
839out Type delayCreatedType, 843Type elementType = MapTable.GetTypeFromId(typeId); 881protected ReaderFlags GetFlagsFromType(Type elementType) 1000Type delayCreatedType = null; 1247Type elementType = MapTable.GetTypeFromId(bamlElementRecord.TypeId); 1390Type elementType = ParentContext.ExpectedType; 1419Type t = param as Type; 1468Type ownerType = ParserContext.TargetType; 2094Type declaringType = null; 2099out Type declaringType) 2138internal object GetCustomValue(BamlPropertyCustomRecord bamlPropertyRecord, Type propertyType, string propertyName) 2644Type valueType = MapTable.GetTypeFromId(bamlPropertyRecord.TypeId); 3027Type expectedType = holder.PropertyType; 3354Type keyType = MapTable.GetTypeFromId(bamlDefAttributeRecord.TypeId); 3671Type propertyType = null; 3745static private Type NullableType = typeof(Nullable<>); 3747static internal bool IsNullable(Type t) 3754internal object OptionallyMakeNullable(Type propertyType, object o, string propName) 3761((Type)propertyType.GetGenericArguments()[0]).Name, 3772static internal bool TryOptionallyMakeNullable( Type propertyType, string propName, ref object o ) 3778Type genericType = (Type)propertyType.GetGenericArguments()[0]; 3954Type propertyType, 3996Type propertyType) 4005if (propertyType == typeof(Type)) 4028object GetObjectFromString(Type type, string s, short converterTypeId) 4282Type expectedType, 4292Type expectedType, 4766Type parentType = GetParentType(); 4784Type parentType = GetParentType(); 4799private Type GetParentType() 4855Type elementType; 5106Type currentParentType; 5212Type type, 5763Type currentParentType = currentParent.GetType(); 5822public Type PropertyType
System\Windows\Markup\BamlRecords.cs (15)
467static internal bool TreatAsIAddChild(Type parentObjectType) 472static internal BamlRecordType GetPropertyStartRecordType(Type propertyType, bool propertyCanWrite) 2649internal Type ValueType 2664internal Type SerializerType 2678Type _valueType; 2681Type _serializerType; 2721internal object GetCustomValue(BinaryReader reader, Type propertyType, short serializerId, BamlRecordReader bamlRecordReader) 4379internal Type Type 4463Type _type; 4535internal Type SerializerType 4560Type _serializerType; 4660internal Type GetPropertyType() 4662Type validType = null; 4804internal Type OwnerType 4947Type _ownerType = null;
System\Windows\Markup\BamlRecordWriter.cs (3)
980Type converterOrSerializerType; 1016Type ownerType = _xamlTypeMapper.GetDependencyPropertyOwnerAndName(xamlProperty.Value, 1081Type typeValue = _xamlTypeMapper.GetTypeFromBaseString(xamlPropertyNode.Value,
System\Windows\Markup\BamlWriter.cs (26)
83ref Type baseType, 84ref Type serializerType) 208Type elementType = GetType(assemblyName, typeFullName); 209Type serializerType = _xamlTypeMapper.GetXamlSerializerForType(elementType); 308Type declaringType; 336Type propType = XamlTypeMapper.GetPropertyType(dpOrPi); 339Type ownerType = null; 380Type typeValue = _xamlTypeMapper.GetTypeFromBaseString(data.Args, 436Type declaringType; 538Type valueElementType = null; 539Type valueSerializerType = null; 625Type ownerType; 626Type propertyType = null; 857Type typeConverter=null; 1088private Type GetType( 1096Type objectType = assembly.GetType(typeFullName); 1114Type ownerType, 1181out Type ownerType) 1198private MethodInfo GetMi(Type ownerType, string propName) 1230out Type ownerType) 1262private void Push(BamlRecordType recordType, Type elementType) 1285private Type PeekElementType() 1332Type elementType) : this(recordType) 1348public Type ElementType 1355Type _elementType; 1415sealed protected override bool AllowInternalType(Type type)
System\Windows\Markup\DependencyPropertyConverter.cs (7)
32public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 51public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 88public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 98Type type = null; 211if (firstAmbientValue.Value is Type) 213type = (Type)firstAmbientValue.Value; 241private static Type GetTypeFromName(XamlSchemaContext schemaContext,
System\Windows\Markup\KnownTypes.cs (2)
5550private Type InitializeOneType(KnownElements knownElement) 5552Type t = null;
System\Windows\Markup\KnownTypesHelper.cs (4)
47_typeTable =new Type[size]; 50public System.Type this[int index] 54Type t = _typeTable[index]; 75private Type[] _typeTable;
System\Windows\Markup\MarkupExtensionParser.cs (25)
36ref Type baseType, 37ref Type serializerType); 64Type declaringType, // Type where propIdName is declared 89Type declaringType, 149private KnownElements GetKnownExtensionFromType(Type extensionType, out string propName) 189Type extensionType, 226Type extensionType, 300Type targetType) 444Type declaringType, // Type where attribute is declared 455Type targetType; 456Type serializerType; 478Type declaringType, // Type where propIdName is declared 491Type targetType; 492Type serializerType; 552out Type targetType, 553out Type serializerType) 639Type propertyType; 912Type extensionType) 1198private ParameterInfo[] FindLongestConstructor(Type extensionType, out int maxConstructorArguments) 1376Type declaringType; 1492Type parentType, 1510Type declaringType; 1545Type typeValue = _parserContext.XamlTypeMapper.GetTypeFromBaseString(value, 1645Type elementBaseType, 1652out Type declaringType, // type of the object that the field is on
System\Windows\Markup\ParserContext.cs (11)
196internal Dictionary<string, SpecialBracketCharacters> InitBracketCharacterCacheForType(Type type) 236_targetType = (Type) _langSpaceStack.Pop(); 311internal Type TargetType 698internal Dictionary<Type, Dictionary<string, SpecialBracketCharacters>> MasterBracketCharacterCache 704_masterBracketCharacterCache = new Dictionary<Type, Dictionary<string, SpecialBracketCharacters>>(); 825private Type _targetType; 826private Dictionary<Type, Dictionary<string, SpecialBracketCharacters>> _masterBracketCharacterCache; 846private Dictionary<string, SpecialBracketCharacters> BuildBracketCharacterCacheForType(Type extensionType) 850Type constructorArgumentType = null; 851Type markupExtensionBracketCharacterType = null; 861Type attributeType = attributeData.AttributeType;
System\Windows\Markup\Primitives\ElementMarkupObject.cs (47)
47public override Type ObjectType 210Type ownerType = dpd.DependencyProperty.OwnerType; 237Type instanceType = instance.GetType(); 286public ShouldSerializeKey(Type type, string propertyName) 321private Type _type; 400private static Type[] _shouldSerializeArgsObject = new Type[] { typeof(DependencyObject) }; 401private static Type[] _shouldSerializeArgsManager = new Type[] { typeof(XamlDesignerSerializationManager) }; 402private static Type[] _shouldSerializeArgsMode = new Type[] { typeof(XamlWriterMode) }; 403private static Type[] _shouldSerializeArgsObjectManager = new Type[] { typeof(DependencyObject), typeof(XamlDesignerSerializationManager) }; 496Type keyType = GetDictionaryKeyType(dictionary); 617static readonly List<Type> EmptyTypes = new List<Type>(); 619public override IEnumerable<Type> TypeReferences 645protected abstract Type GetObjectType(); 681private static Dictionary<Type, Type> _keyTypeMap; 683private static Type GetDictionaryKeyType(IDictionary value) 685Type type = value.GetType(); 686Type result; 689_keyTypeMap = new Dictionary<Type, Type>(); 692foreach (Type interfaceType in type.GetInterfaces()) 696Type genericTypeDefinition = interfaceType.GetGenericTypeDefinition(); 726protected override Type GetObjectType() 750public override Type PropertyType 885Type propertyType, 910Type type = value as Type; 916if( propertyType == typeof(Type) ) 931ValueSerializer typeSerializer = context.GetValueSerializerFor(typeof(Type)); 972public override Type PropertyType 1012public override IEnumerable<Type> TypeReferences 1031internal ElementPseudoPropertyBase(object value, Type type, ElementMarkupObject obj) : base(obj) 1037public override Type PropertyType 1052public override IEnumerable<Type> TypeReferences 1054get { return Array.Empty<Type>(); } 1058private Type _type; 1066internal ElementKey(object value, Type type, ElementMarkupObject obj) : base(value, type, obj) { } 1084internal ElementConstructorArgument(object value, Type type, ElementMarkupObject obj) : base(value, type, obj) { } 1102internal ElementItemsPseudoProperty(IEnumerable value, Type type, ElementMarkupObject obj) : base(value, type, obj) 1141internal ElementDictionaryItemsPseudoProperty(IDictionary value, Type type, ElementMarkupObject obj) : base(value, type, obj) 1194public ValueSerializer GetValueSerializerFor(Type type) 1249public object GetService(Type serviceType)
System\Windows\Markup\Primitives\ExtensionSimplifierMarkupObject.cs (4)
35public override Type ObjectType 87public override Type PropertyType 97public override IEnumerable<Type> TypeReferences 313ValueSerializer typeSerializer = _context.GetValueSerializerFor(typeof(Type));
System\Windows\Markup\Primitives\FrameworkElementFactoryMarkupObject.cs (7)
42public override Type ObjectType 174public override Type PropertyType 206protected override Type GetObjectType() 264protected override Type GetObjectType() 274public override Type PropertyType 333protected override Type GetObjectType() 343public override Type PropertyType
System\Windows\Markup\Primitives\MarkupWriter.cs (27)
136internal static void VerifyTypeIsSerializable(Type type) 743List<Type> wrapperTypes = GetWrapperTypes(contentProperty.PropertyType); 1031Type tagType = property.Value.GetType(); 1079private List<Type> GetWrapperTypes(Type type) 1086List<Type> wrapperTypes = new List<Type>(); 1097private MarkupProperty GetWrappedProperty(List<Type> wrapperTypes, MarkupObject item) 1117private bool IsInTypes(Type type, List<Type> types) 1119foreach (Type t in types) 1145private bool IsCollectionType(Type type) 1172List<Type> wrapperTypes = GetWrapperTypes(contentProperty.PropertyType); 1395public void MakeAddressable(IEnumerable<Type> types) 1398foreach (Type type in types) 1402public string MakeAddressable(Type type) 1458if (descriptor.PropertyType == typeof(Type)) 1464public ValueSerializer GetValueSerializerFor(Type type) 1466if (type == typeof(Type)) 1496public object GetService(Type serviceType) 1522Type type = value as Type; 1533public override IEnumerable<Type> TypeReferences(object value, IValueSerializerContext context) 1535Type type = value as Type; 1537return new Type[] { type }; 1604public static string GetNamespaceUriFor(Type type)
System\Windows\Markup\ProvideValueServiceProvider.cs (2)
52Type IXamlTypeResolver.Resolve(string qualifiedTypeName) // E.g. foo:Class 98public object GetService(Type service)
System\Windows\Markup\ReaderContextStackData.cs (2)
25Type _expectedType; 82internal Type ExpectedType
System\Windows\Markup\RestrictiveXamlXmlReader.cs (6)
23private static readonly Type DependencyObjectType = typeof(System.Windows.DependencyObject); 79internal RestrictiveXamlXmlReader(XmlReader xmlReader, XamlSchemaContext schemaContext, XamlXmlReaderSettings settings, List<Type> safeTypes) : base(xmlReader, schemaContext, settings) 83foreach (Type safeType in safeTypes) 182private bool IsAllowedType(Type type) 214HashSet<Type> _safeTypesSet = new HashSet<Type>() {
System\Windows\Markup\RoutedEventConverter.cs (6)
20public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType) 36public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 59Type type = null; 98type = firstAmbientValue.Value as Type; 109Type currentType = type; 138Type destinationType)
System\Windows\Markup\RoutedEventValueSerializer.cs (11)
17return ValueSerializer.GetSerializerFor(typeof(Type), context) != null; 22return ValueSerializer.GetSerializerFor(typeof(Type), context) != null; 30ValueSerializer typeSerializer = ValueSerializer.GetSerializerFor(typeof(Type), context); 39static Dictionary<Type, Type> initializedTypes = new Dictionary<Type, Type>(); 41static void ForceTypeConstructors(Type currentType) 54ValueSerializer typeSerializer = ValueSerializer.GetSerializerFor(typeof(Type), context); 60Type type = typeSerializer.ConvertFromString(value.Substring(0, index), context) as Type;
System\Windows\Markup\SetterTriggerConditionValueConverter.cs (3)
30public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 49public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 75public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Markup\TemplateKeyConverter.cs (3)
30public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 41public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 66public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Markup\TypeContext.cs (1)
68virtual public object GetService(Type serviceType)
System\Windows\Markup\XamlNodes.cs (35)
370Type converterType) 388internal Type ConverterType 403Type _converterType = null; 479internal Type PropDeclaringType 496internal Type PropValidType 523Type _validType; 524Type _declaringType; 661internal Type DefaultTargetType 671Type _defaultTargetType; 759internal Type ValueDeclaringType 801internal Type ValuePropertyType 866internal Type DefaultTargetType 903Type _valueDeclaringType; 905Type _valuePropertyType; 910Type _defaultTargetType; 932Type valueElementType, // Actual type of the valueTypeFullname. 971internal Type ValueElementType 996Type _valueElementType; 1089Type elementType, 1090Type serializerType) 1112Type elementType, 1113Type serializerType, 1150internal Type ElementType 1161internal Type SerializerType 1210Type _elementType; 1211Type _serializerType; 2071Type valueType) // Actual Type, if known. 2089internal Type ValueType 2095Type _valueType; 2156Type elementType, 2157Type serializerType) 2250internal Type PropDeclaringType 2267internal Type PropValidType 2281Type _declaringType; 2282Type _validType;
System\Windows\Markup\XamlParseException.cs (2)
313Type objectType) 416Type objectType
System\Windows\Markup\XamlReader.cs (2)
831List<Type> safeTypes) 1061Type internalTypeHelper = null;
System\Windows\Markup\XamlStyleSerializer.cs (1)
80Type styleTargetType = Style.DefaultTargetType;
System\Windows\Markup\XamlTypeMapper.cs (83)
106public Type GetType( 447Type owner, 451Type baseType = null; 503Type propType, 721Type propType, 776Type owner, 801Type ownerType, 822Type currentParentType, 864Type propertyOwnerType = attributeInfo.OwnerType; 939Type owner, 1182protected virtual bool AllowInternalType(Type type) 1187private bool IsInternalTypeAllowedInFullTrust(Type type) 1214Type owner, 1244Type owner, 1274Type objectType = typeAndSerializer.ObjectType; 1295Type dependencyObjectType = KnownTypes.Types[(int)KnownElements.DependencyObject]; 1429Type baseType = owner; 1454Type dependencyObjectType = KnownTypes.Types[(int)KnownElements.DependencyObject]; 1589Type owner, 1631Type owner, 1634ref Type baseType, 1766ref Type ownerType) 1903Type ownerType, 1995Type ownerType) 1998Type currentType = ownerType; 2021internal static Type GetPropertyType(object propertyMember) 2023Type propertyType; 2038out Type propertyType, 2117internal static Type GetDeclaringType(object propertyMember) 2119Type validType = null; 2156internal static Type GetTypeFromName(string typeName, DependencyObject element) 2208Type t = assy.GetType(fullTypeName); 2228Type t = assy.GetType(fullTypeName); 2242internal Type GetTargetTypeAndMember(string valueParam, 2257Type targetType = null; 2293internal Type GetDependencyPropertyOwnerAndName(string memberValue, 2295Type defaultTargetType, 2298Type targetType = GetTargetTypeAndMember(memberValue, context, false, out memberName); 2325internal MemberInfo GetStaticMemberInfo(Type targetType, string memberName, bool fieldInfoOnly) 2365private MemberInfo GetStaticMemberInfo(Type targetType, string memberName, bool fieldInfoOnly, bool tryInternal) 2538Type objectType = GetObjectType(namespaceMap, localName, knownTypesOnly); 2588private Type GetObjectType( 2596Type type = null; 2664internal int GetCustomBamlSerializerIdForType(Type objectType) 2705internal Type GetXamlSerializerForType(Type objectType) 2721internal static Type GetInternalTypeHelperTypeFromAssembly(ParserContext pc) 2729Type ithType = a.GetType($"{GeneratedNamespace}.{GeneratedInternalTypeHelperClassName}"); 2749Type ithType = GetInternalTypeHelperTypeFromAssembly(pc); 2757internal static object CreateInternalInstance(ParserContext pc, Type type) 2801internal static Delegate CreateDelegate(ParserContext pc, Type delegateType, object target, string handler) 2846internal Type GetTypeFromBaseString( 2852Type keyObject = null; 2983private TypeInformationCacheData GetCachedInformationForType(Type type) 3004private Type GetCachedBaseType(Type t) 3060ref Type ownerType) 3083Type ownerType) 3103internal object CreateInstance(Type t) 3398private string GetCachedNamespace(Type t) 3439internal Type GetTypeConverterType(Type type) 3443Type converterType = null; 3470internal TypeConverter GetTypeConverter(Type type) 3490Type converterType = TypeConverterHelper.GetConverterType(type); 3514internal Type GetPropertyConverterType(Type propType, object dpOrPiOrMi) 3517Type converterType = null; 3558internal TypeConverter GetPropertyConverter(Type propType, object dpOrPiOrMi) 3581Type converterType = TypeConverterHelper.GetConverterType(memberInfo); 3636internal ConstructorData GetConstructors(Type type) 3725internal bool GetCachedTrimSurroundingWhitespace(Type t) 3743private bool GetTrimSurroundingWhitespace(Type type) 3925internal TypeInformationCacheData(Type baseType) 3946internal Type BaseType 3962internal Type TypeConverterType 4008Type ownerType, 4062Type _baseType; 4070Type _typeConverterType; 4080Type ot, 4093public Type OwnerType; 4201public Type ObjectType = null; 4202public Type SerializerType = null;
System\Windows\Markup\XamlTypeMapperSchemaContext.cs (5)
27Dictionary<Type, XamlType> _allowedInternalTypes; 93public override XamlType GetXamlType(Type type) 306private XamlType GetInternalType(Type type, XamlType sharedSchemaXamlType) 312_allowedInternalTypes = new Dictionary<Type, XamlType>(); 414public VisibilityMaskingXamlType(Type underlyingType, XamlSchemaContext schemaContext)
System\Windows\Markup\XmlnsCache.cs (1)
275private Attribute[] GetAttributes(Assembly asm, Type attrType)
System\Windows\Media\Animation\Generated\ThicknessAnimation.cs (2)
46Type typeofProp = typeof(Thickness?); 47Type typeofThis = typeof(ThicknessAnimation);
System\Windows\Media\Animation\Generated\ThicknessAnimationBase.cs (1)
87public override sealed Type TargetPropertyType
System\Windows\Navigation\JournalEntryListConverter.cs (4)
33public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 43public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 110public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) 132public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
System\Windows\Navigation\NavigationService.cs (1)
3281Type type = ccs.GetType();
System\Windows\PropertyPath.cs (9)
57public Type type; // user-specified type 305internal object ResolvePropertyName(int level, object item, Type ownerType, object context) 547object ResolvePropertyName(string name, object item, Type ownerType, object context, bool throwOnError) 652private PropertyInfo GetPropertyHelper(Type ownerType, string propertyName) 777object GetTypedParamValue(string param, Type type, bool throwOnError) 832Type GetTypeFromName(string name, object context) 881ValueSerializer typeSerializer = ValueSerializer.GetSerializerFor(typeof(Type), serializerContext); 883return typeSerializer.ConvertFromString(name, serializerContext) as Type; 905Type type = wpfSharedSchemaContext.ResolvePrefixedNameWithAdditionalWpfSemantics(name, hostElement);
System\Windows\PropertyPathConverter.cs (5)
44public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType) 65public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 130Type destinationType) 166typeSerializer = ValueSerializer.GetSerializerFor(typeof(Type), serializerContext); 203Type type; // the accessor's ownerType, or type of indexer parameter
System\Windows\ResourceDictionary.cs (5)
527internal Type GetValueType(object key, out bool found) 530Type valueType = null; 1358private Type GetTypeOfFirstObject(KeyRecord keyRecord) 1360Type rootType = _reader.GetTypeOfFirstStartObject(keyRecord); 2409HasImplicitStyles = ((key as Type) != null);
System\Windows\ResourceReferenceExpressionConverter.cs (3)
34public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 61public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 111public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Shell\JumpList.cs (3)
469var destinationList = (ICustomDestinationList)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(CLSID.DestinationList))); 805var shellObjectCollection = (IObjectCollection)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(CLSID.EnumerableObjectCollection))); 893var link = (IShellLinkW)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(CLSID.ShellLink)));
System\Windows\Standard\ComGuids.cs (1)
70return (T)System.Activator.CreateInstance(System.Type.GetTypeFromCLSID(new System.Guid(clsid)));
System\Windows\Standard\Verify.cs (4)
250public static void TypeSupportsInterface(Type type, Type interfaceType, string parameterName) 273internal static void ImplementsInterface(object parameter, Type interfaceType, string parameterName) 280foreach (var ifaceType in parameter.GetType().GetInterfaces())
System\Windows\Style.cs (6)
50public Style(Type targetType) 62public Style(Type targetType, Style basedOn) 151public Type TargetType 477Type elementType = element.GetType(); 950internal static readonly Type DefaultTargetType = typeof(IFrameworkInputElement); 954private Type _targetType = DefaultTargetType;
System\Windows\StyleHelper.cs (8)
246Type themeStyleTypeKey = themeStyleKey as Type; 673Type valueType = deferredReference.GetValueType(); 2685Type sourceNodeType; 5889Type stateType = (state != null) ? state.GetType() : null; 5900Type cachedType = bindingValueCache.BindingValueType; 5981internal BindingValueCache(Type bindingValueType, object valueAsBindingValueType) 5987internal readonly Type BindingValueType;
System\Windows\StyleTypedPropertyAttribute.cs (2)
33public Type StyleTargetType 40private Type _styleTargetType;
System\Windows\SystemKeyConverter.cs (6)
38public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 57public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 108public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 138Type keyType = SystemKeyConverter.GetSystemClassType(keyId); 145ValueSerializer typeSerializer = valueSerializerContext.GetValueSerializerFor(typeof(Type)); 162internal static Type GetSystemClassType(SystemResourceKeyID id)
System\Windows\SystemResourceKey.cs (1)
377internal static short GetBamlIdBasedOnSystemResourceKeyId(Type targetType, string memberName)
System\Windows\SystemResources.cs (9)
114Type typeKey = null; 120typeKey = key as Type; 348Type typeKey, 813Type knownTypeHelper = assembly.GetType("Microsoft.Windows.Themes.KnownTypeHelper"); 1794internal override Type GetValueType() 1908internal override Type GetValueType() 1964if ((key is Type || key is ResourceKey) && _canCacheAsThemeResource && canCache) 1977internal override Type GetValueType() 2021internal override Type GetValueType()
System\Windows\TemplateBindingExpressionConverter.cs (2)
28public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 40public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
System\Windows\TemplateBindingExtensionConverter.cs (3)
31public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 43public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 54return new InstanceDescriptor(typeof(TemplateBindingExtension).GetConstructor(new Type[] { typeof(DependencyProperty) }),
System\Windows\TemplateContent.cs (9)
846Type typeofValue = xamlReader.Value.GetType(); 895Type typeofValue = xamlReader.Type.UnderlyingType; 1019private static bool CheckSpecialCasesShareable(Type typeofValue, DependencyProperty property) 1158private bool IsTypeShareable(Type type) 1164type == typeof(string) || type == typeof(Uri) || type == typeof(Type) 1210Type targetType, 1319Type targetType, 1426object IServiceProvider.GetService(Type serviceType) 1446Type IXamlTypeResolver.Resolve(string qualifiedTypeName)
System\Windows\TemplateKey.cs (5)
118Type type = DataType as Type; 131Type type = _dataType as Type; 162else if (!(dataType is Type) && !(dataType is String))
System\Windows\TemplatePartAttribute.cs (2)
36public Type Type 43private Type _type;
System\Windows\ThemeModeConverter.cs (5)
32public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType) 34return Type.GetTypeCode(sourceType) == TypeCode.String; 45public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 94Type destinationType) 106ConstructorInfo ci = typeof(ThemeMode).GetConstructor(new Type[] { typeof(string) });
System\Windows\ThicknessConverter.cs (5)
38public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType) 41TypeCode tc = Type.GetTypeCode(sourceType); 69public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType) 121public override object ConvertTo(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object value, Type destinationType) 133ConstructorInfo ci = typeof(Thickness).GetConstructor(new Type[] { typeof(double), typeof(double), typeof(double), typeof(double) });
System\Windows\Window.cs (1)
6470taskbarList = (ITaskbarList)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(CLSID.TaskbarList)));
PresentationFramework.Aero (4)
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (2)
28public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 117public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\KnownTypeHelper.cs (2)
132Type type = typeof(Microsoft.Windows.Themes.ScrollChrome); 214public ThemesKnownType(XamlSchemaContext xsc, int bamlNumber, string name, Type type) :
PresentationFramework.Aero2 (4)
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (2)
28public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 117public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\KnownTypeHelper.cs (2)
132Type type = typeof(Microsoft.Windows.Themes.ScrollChrome); 214public ThemesKnownType(XamlSchemaContext xsc, int bamlNumber, string name, Type type) :
PresentationFramework.AeroLite (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\KnownTypeHelper.cs (2)
132Type type = typeof(Microsoft.Windows.Themes.ScrollChrome); 214public ThemesKnownType(XamlSchemaContext xsc, int bamlNumber, string name, Type type) :
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (2)
28public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 182public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
PresentationFramework.Classic (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\KnownTypeHelper.cs (2)
50Type type = typeof(Microsoft.Windows.Themes.ClassicBorderDecorator); 214public ThemesKnownType(XamlSchemaContext xsc, int bamlNumber, string name, Type type) :
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (2)
28public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 182public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
PresentationFramework.Fluent (4)
Controls\AnimationFactorToValueConverter.cs (2)
9public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 29public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
Controls\FallbackBrushConverter.cs (2)
10public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 26public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
PresentationFramework.Luna (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\KnownTypeHelper.cs (2)
132Type type = typeof(Microsoft.Windows.Themes.ScrollChrome); 214public ThemesKnownType(XamlSchemaContext xsc, int bamlNumber, string name, Type type) :
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (2)
28public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 182public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
PresentationFramework.Royale (4)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\KnownTypeHelper.cs (2)
132Type type = typeof(Microsoft.Windows.Themes.ScrollChrome); 214public ThemesKnownType(XamlSchemaContext xsc, int bamlNumber, string name, Type type) :
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (2)
28public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 182public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
PresentationFramework-SystemCore (12)
DynamicAccessorImpl.cs (11)
20internal DynamicPropertyAccessorImpl(Type ownerType, string propertyName) 63Type delegateType, callsiteType; 66Type[] typeArgs; 70typeArgs = new Type[rank+3]; 79callsiteType = typeof(CallSite<>).MakeGenericType(new Type[]{ delegateType }); 80createMethod = callsiteType.GetMethod("Create", new Type[]{ typeof(CallSiteBinder) }); 89typeArgs = new Type[rank+4]; 99callsiteType = typeof(CallSite<>).MakeGenericType(new Type[]{ delegateType }); 100createMethod = callsiteType.GetMethod("Create", new Type[]{ typeof(CallSiteBinder) }); 232public static DynamicMetaObject ThrowExpression(string message, Type returnType) 237typeof(InvalidOperationException).GetConstructor(new Type[] { typeof(string) }),
SystemCoreExtension.cs (1)
24internal override object NewDynamicPropertyAccessor(Type ownerType, string propertyName)
PresentationFramework-SystemData (4)
SystemDataExtension.cs (4)
39internal override bool IsSqlNullableType(Type type) 77Type pdType = pd.GetType(); 240static Type s_DataTablePropertyDescriptorType; 241static Type s_DataRelationPropertyDescriptorType;
PresentationFramework-SystemXmlLinq (6)
SystemXmlLinqExtension.cs (6)
48Type pdType = pd.GetType(); 62Type pdType = pd.GetType(); 67private static Type s_XElementElementsPropertyDescriptorType; 68private static Type s_XElementDescendantsPropertyDescriptorType; 69private static Type s_XElementAttributePropertyDescriptorType; 70private static Type s_XElementElementPropertyDescriptorType;
PresentationUI (4)
MS\Internal\Documents\DocumentSignatureManager.cs (1)
1215Type t = typeof(CryptographicException);
MS\Internal\Documents\PeoplePickerWrapper.cs (2)
120Type commonQueryType = Type.GetTypeFromCLSID(UnsafeNativeMethods.CLSID_CommonQuery);
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (1)
311string name, string text, Type valueType, int minWidth)
ReachFramework (146)
AlphaFlattener\Utility.cs (1)
921Type typ = segment.GetType();
Packaging\XpsFixedPageReaderWriter.cs (3)
222Type resourceType, 776Type resourceType, 1805Type resourceType,
Packaging\XpsInterleavingPolicy.cs (4)
231Type classType 640Type classType 671public Type ClassType 684private Type _classType;
Packaging\XpsResourcePolicy.cs (5)
80Type serviceType 152Type serviceType 171Type serviceType 311Dictionary<Type, object> _objDict = new Dictionary<Type, object>();
Serialization\ColorTypeConverter.cs (4)
51Type sourceType 76Type destinationType 142Type destinationType 247Type type
Serialization\FontTypeConverter.cs (4)
49Type sourceType 74Type destinationType 140Type destinationType 236Type type
Serialization\ImageSourceTypeConverter.cs (4)
54Type sourceType 79Type destinationType 146Type destinationType 318Type type
Serialization\Manager\MetroSerializationManager.cs (20)
97Type objectType 129Type 131Type objectType 134Type serializerType = null; 167Type serializedObjectType 184Type writerType 198Type writerType 214Type resourceType 234Type resourceType, 251Type resourceType 271Type resourceType, 512Type serializerType = cacheItem.SerializerType; 698Type type = serializableObject.GetType(); 708Type serializerType = _serializationManager.GetSerializerType(type); 757Type type = serializableObject.GetType(); 802Type serializerTypeForProperty = null; 807Type propertyType = dependencyProperty.PropertyType; 939Type serializableObjectType 952Type serializerType = _serializationManager.GetSerializerType(serializableObjectType); 1064CreateReachSerializer(Type serializerType)
Serialization\Manager\NGCSerializationManager.cs (12)
182Type objectType 213Type 215Type objectType 218Type serializerType = null; 274Type writerType 284Type writerType 294Type resourceType 304Type resourceType, 315Type resourceType 325Type resourceType, 657Type serializedObjectType = serializedObject.GetType(); 690Type serializedObjectType = serializedObject.GetType();
Serialization\Manager\NGCSerializationManagerAsync.cs (12)
422Type objectType 453Type 455Type objectType 458Type serializerType = null; 514Type writerType 524Type writerType 534Type resourceType 544Type resourceType, 555Type resourceType 565Type resourceType, 928Type serializedObjectType = serializedObject.GetType(); 989Type serializedObjectType = serializedObject.GetType();
Serialization\Manager\ReachDocumentSequenceSerializer.cs (1)
180if (propertyValue is Type)
Serialization\Manager\ReachDocumentSequenceSerializerAsync.cs (1)
218if (propertyValue is Type)
Serialization\Manager\ReachFixedDocumentSerializer.cs (1)
259if (propertyValue is Type)
Serialization\Manager\ReachFixedDocumentSerializerAsync.cs (1)
299if (propertyValue is Type)
Serialization\Manager\ReachFixedPageSerializer.cs (1)
335if (propertyValue is Type)
Serialization\Manager\ReachFixedPageSerializerAsync.cs (1)
307if (propertyValue is Type)
Serialization\Manager\ReachNamespaceInfo.cs (4)
21Type type, 104this[Type type] 124Type type 133Type type,
Serialization\Manager\ReachSerializableProperties.cs (4)
429Type valueType = Value.GetType(); 561Type 566Type type = null; 774Type valueType = Value.GetType();
Serialization\Manager\ReachSerializationCacheItems.cs (16)
16Type type, 33Type objectType; 44Type type 56Type type, 57Type serializerType 69Type type, 105Type serializerTypeForProperty = null; 161Type 186out Type serializerTypeForProperty, 258Type type; 261Type serializerType; 297Type serializerTypeForProperty, 330Type 423Type serializerTypeForProperty; 444Type serializerTypeForProperty, 469out Type serializerTypeForProperty,
Serialization\Manager\XpsOMFixedPageSerializer.cs (1)
293if (propertyValue is Type)
Serialization\Manager\XpsOMSerializationManager.cs (13)
140Type 142Type objectType 145Type serializerType = null; 243Type serializedObjectType 294Type objectType 300internal override Xml.XmlWriter AcquireXmlWriter(Type writerType) 321Type writerType 370Type writerType 398Type resourceType 408Type resourceType, 445Type resourceType 481Type resourceType, 580DecrementRefCntByType(Type writerType)
Serialization\Manager\XpsOMSerializationManagerAsync.cs (3)
295Type 297Type objectType 300Type serializerType = null;
Serialization\Manager\XpsSerializationManager.cs (15)
266Type objectType 297Type 299Type objectType 302Type serializerType = null; 399Type serializedObjectType 430Type writerType 468GetTypeRefCnt(Type writerType) 494DecrementRefCntByType(Type writerType) 522Type writerType 593Type resourceType 629Type resourceType, 666Type resourceType 698Type resourceType, 1065Type serializedObjectType = serializedObject.GetType(); 1463Type[] _xpsTypesRequiringXMLNS =
Serialization\Manager\XpsSerializationManagerAsync.cs (3)
391Type 393Type objectType 396Type serializerType = null;
Serialization\Manager\XpsTokenContext.cs (1)
82Type serviceType
Serialization\VisualTreeFlattener.cs (10)
32Type destinationType 58Type destinationType 174internal override String GetXmlNSForType(Type objectType) 179internal override XmlWriter AcquireXmlWriter(Type writerType) 184internal override void ReleaseXmlWriter(Type writerType) 189internal override XpsResourceStream AcquireResourceStream(Type resourceType) 194internal override XpsResourceStream AcquireResourceStream(Type resourceType, String resourceID) 199internal override void ReleaseResourceStream(Type resourceType) 204internal override void ReleaseResourceStream(Type resourceType, String resourceID) 238internal override TypeConverter GetTypeConverter(Type objType)
Serialization\XpsFontSerializationService.cs (1)
38SignalCommit( Type type )
Replay (2)
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
30return !(Type.GetType("Mono.Runtime") is null); 50return !(Type.GetType("Mono.RuntimeStructs", throwOnError: false) is null);
Roslyn.VisualStudio.DiagnosticsWindow (9)
Panels\TelemetryPanel.xaml.cs (7)
60var seenType = new HashSet<Type>(); 81foreach (var type in module.GetTypes()) 95void ScanType(Type type, StringBuilder typeDiscovered) 106foreach (var nestedTypeInfo in type.GetNestedTypes(BindingFlags.Public | BindingFlags.NonPublic)) 112void RecordIfCodeAction(Type type, StringBuilder typeDiscovered) 124bool IsCodeAction(Type type) 131var codeActionType = typeof(CodeAction);
VisualStudioDiagnosticsWindowPackage.cs (2)
104protected override string GetToolWindowTitle(Type toolWindowType, int id) 114protected override Task<object> InitializeToolWindowAsync(Type toolWindowType, int id, CancellationToken cancellationToken)
Roslyn.VisualStudio.Next.UnitTests (14)
Options\VisualStudioSettingsOptionPersisterTests.cs (6)
37public Func<string, Type, (GetValueResult, object?)>? GetValueImpl; 85private static (object? value, object? storageValue) GetSomeOptionValue(Type optionType) 176Type optionType) 216Type optionType) 236public void Roundtrip_DefaultImmutableArray(Type type) 277public void Roundtrip(object? value, object? serializedValue, object defaultValue, Type type)
Remote\SnapshotSerializationTests.cs (1)
41private static Workspace CreateWorkspace(Type[] additionalParts = null)
Services\ServiceHubServicesTests.cs (1)
43private static TestWorkspace CreateWorkspace(Type[] additionalParts = null)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (6)
49var analyzerType = typeof(CSharpUseExplicitTypeDiagnosticAnalyzer); 80var analyzerType = typeof(VisualBasicUseNullPropagationDiagnosticAnalyzer); 111var analyzerType = typeof(MyAnalyzer); 150var analyzerType = typeof(CSharpUseExplicitTypeDiagnosticAnalyzer); 188var analyzerType = typeof(DuplicateAnalyzer); 218private static async Task<DiagnosticAnalysisResult> AnalyzeAsync(TestWorkspace workspace, ProjectId projectId, Type analyzerType, bool isHostAnalyzer, CancellationToken cancellationToken = default)
RoutingSandbox (1)
Program.cs (1)
35Type startupType;
RoutingWebSite (1)
Program.cs (1)
37Type startupType;
SocialWeather (11)
FormatterResolver.cs (11)
10private readonly Dictionary<string, Dictionary<Type, Type>> _formatters 11= new Dictionary<string, Dictionary<Type, Type>>(); 21Dictionary<Type, Type> typeFormatters; 24typeFormatters = _formatters[formatType] = new Dictionary<Type, Type>(); 31Dictionary<Type, Type> typeFormatters; 32Type typeFormatterType;
Sockets.BindTests (3)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
23public List<Type> IgnoredExceptions { get; } = new List<Type>();
src\Servers\Kestrel\shared\test\TestApplicationErrorLoggerLoggedTest.cs (1)
32public List<Type> IgnoredCriticalLogExceptions => TestApplicationErrorLogger.IgnoredExceptions;
Sockets.FunctionalTests (3)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
23public List<Type> IgnoredExceptions { get; } = new List<Type>();
src\Servers\Kestrel\shared\test\TestApplicationErrorLoggerLoggedTest.cs (1)
32public List<Type> IgnoredCriticalLogExceptions => TestApplicationErrorLogger.IgnoredExceptions;
System.CodeDom (30)
Microsoft\CSharp\CSharpCodeProvider.cs (1)
41public override TypeConverter GetConverter(Type type) =>
Microsoft\CSharp\CSharpModifierAttributeConverter.cs (2)
16public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) => 37public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Microsoft\VisualBasic\VBCodeProvider.cs (1)
43public override TypeConverter GetConverter(Type type) =>
Microsoft\VisualBasic\VBModifierAttributeConverter.cs (2)
16public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) => 37public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (5)
43public CodeTypeReference(Type type) 70public CodeTypeReference(Type type, CodeTypeReferenceOptions codeTypeReferenceOption) : this(type) 85private void InitializeFromType(Type type) 90Type currentType = type; 106Type[] genericArgs = type.GetGenericArguments();
src\libraries\Common\src\System\CodeDom\CodeTypeReferenceCollection.cs (1)
40public void Add(Type value) => Add(new CodeTypeReference(value));
System\CodeDom\CodeArrayCreateExpression.cs (3)
27public CodeArrayCreateExpression(Type createType, params CodeExpression[] initializers) 45public CodeArrayCreateExpression(Type createType, int size) 63public CodeArrayCreateExpression(Type createType, CodeExpression size)
System\CodeDom\CodeCastExpression.cs (1)
24public CodeCastExpression(Type targetType, CodeExpression expression)
System\CodeDom\CodeMemberField.cs (1)
24public CodeMemberField(Type type, string name)
System\CodeDom\CodeObjectCreateExpression.cs (1)
24public CodeObjectCreateExpression(Type createType, params CodeExpression[] parameters)
System\CodeDom\CodeParameterDeclarationExpression.cs (1)
26public CodeParameterDeclarationExpression(Type type, string name)
System\CodeDom\CodeTypeOfExpression.cs (1)
22public CodeTypeOfExpression(Type type)
System\CodeDom\CodeTypeReferenceExpression.cs (1)
22public CodeTypeReferenceExpression(Type type)
System\CodeDom\CodeVariableDeclarationStatement.cs (2)
25public CodeVariableDeclarationStatement(Type type, string name) 45public CodeVariableDeclarationStatement(Type type, string name, CodeExpression initExpression)
System\CodeDom\Compiler\CodeDomProvider.cs (1)
134public virtual TypeConverter GetConverter(Type type) => TypeDescriptor.GetConverter(type);
System\CodeDom\Compiler\CompilerInfo.cs (6)
17private Type _type; 25public Type CodeDomProviderType 33_type ??= Type.GetType(_codeDomProviderTypeName); 41public bool IsCodeDomProviderTypeValid => Type.GetType(_codeDomProviderTypeName) != null; 53ConstructorInfo ci = CodeDomProviderType.GetConstructor(new Type[] { typeof(IDictionary<string, string>) }); 70ConstructorInfo constructor = CodeDomProviderType.GetConstructor(new Type[] { typeof(IDictionary<string, string>) });
System.Collections.Specialized (1)
System\Collections\Specialized\NameObjectCollectionBase.cs (1)
438protected object?[] BaseGetAllValues(Type type)
System.ComponentModel (1)
System\IServiceProvider.cs (1)
8object? GetService(Type serviceType);
System.ComponentModel.Annotations (85)
System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptionProvider.cs (5)
15private readonly Type? _associatedMetadataType; 22public AssociatedMetadataTypeTypeDescriptionProvider(Type type) 35Type type, 36[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type associatedMetadataType) 50public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object? instance)
System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptor.cs (26)
15private Type? AssociatedMetadataType { get; set; } 21[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type type, 22[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? associatedMetadataType) 96private static readonly ConcurrentDictionary<Type, Type?> s_metadataTypeCache = new ConcurrentDictionary<Type, Type?>(); 99private static readonly ConcurrentDictionary<(Type, string), Attribute[]> s_typeMemberCache = new ConcurrentDictionary<(Type, string), Attribute[]>(); 102private static readonly ConcurrentDictionary<(Type, Type), bool> s_validatedMetadataTypeCache = new ConcurrentDictionary<(Type, Type), bool>(); 105[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type type, 106[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.PublicProperties)] Type associatedType) 108(Type, Type) typeTuple = (type, associatedType); 117public static Type? GetAssociatedMetadataType(Type type) 119if (TryGetAssociatedMetadataTypeFromCache(type, out Type? associatedMetadataType)) 138static bool TryGetAssociatedMetadataTypeFromCache(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] out Type? associatedMetadataType) 145[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type mainType, 146[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.PublicProperties)] Type associatedMetadataType) 169[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 172(Type, string) memberTuple = (type, memberName);
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (6)
66private Type? _firstParameterType; 67private Tuple<string, Type>? _typeId; 87public CustomValidationAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type validatorType, string method) 103public Type ValidatorType { get; } 108public override object TypeId => _typeId ??= new Tuple<string, Type>(Method, ValidatorType); 305var expectedValueType = _firstParameterType!;
System\ComponentModel\DataAnnotations\DisplayAttribute.cs (3)
31private Type? _resourceType; 167/// Gets or sets the <see cref="System.Type" /> that contains the resources for <see cref="ShortName" />, 174public Type? ResourceType
System\ComponentModel\DataAnnotations\DisplayFormatAttribute.cs (2)
73/// Gets or sets the <see cref="Type" /> that contains the resources for <see cref="NullDisplayText" />. 78public Type? NullDisplayTextResourceType
System\ComponentModel\DataAnnotations\EnumDataTypeAttribute.cs (5)
14public EnumDataTypeAttribute(Type enumType) 20public Type EnumType { get; } 43Type valueType = value.GetType(); 101private static bool IsEnumTypeInFlagsMode(Type enumType) => 104private static string? GetUnderlyingTypeValueString(Type enumType, object enumValue) =>
System\ComponentModel\DataAnnotations\LocalizableString.cs (2)
21private Type? _resourceType; 67public Type? ResourceType
System\ComponentModel\DataAnnotations\MetadataPropertyDescriptorWrapper.cs (2)
30public override Type ComponentType { get { return _descriptor.ComponentType; } } 45public override Type PropertyType { get { return _descriptor.PropertyType; } }
System\ComponentModel\DataAnnotations\MetadataTypeAttribute.cs (3)
16private readonly Type _metadataClassType; 24public MetadataTypeAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type metadataClassType) 33public Type MetadataClassType
System\ComponentModel\DataAnnotations\RangeAttribute.cs (6)
53[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 89public Type OperandType { get; } 99/// by the <c>type</c> parameter of the <see cref="RangeAttribute(Type, string, string)"/> constructor are carried 202Type operandType = minimum.GetType(); 215Type type = OperandType; 220Type comparableType = typeof(IComparable);
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (2)
30private Type? _errorMessageResourceType; 201public Type? ErrorMessageResourceType
System\ComponentModel\DataAnnotations\ValidationAttributeStore.cs (8)
23private readonly ConcurrentDictionary<Type, TypeStoreItem> _typeStoreItems = new(); 90internal Type GetPropertyType(ValidationContext validationContext) 118private TypeStoreItem GetTypeStoreItem([DynamicallyAccessedMembers(TypeStoreItem.DynamicallyAccessedTypes)] Type type) 126static TypeStoreItem AddTypeStoreItem(Type type) 170private readonly Type _type; 173internal TypeStoreItem([DynamicallyAccessedMembers(DynamicallyAccessedTypes)] Type type, AttributeCollection attributes) 268internal PropertyStoreItem(Type propertyType, AttributeCollection attributes) 275internal Type PropertyType { get; }
System\ComponentModel\DataAnnotations\ValidationContext.cs (10)
36private Func<Type, object?>? _serviceProvider; 120public Type ObjectType => ObjectInstance.GetType(); 173internal Type? MemberType 179Type? propertyType = _propertyType; 192private Type? _propertyType; 228/// service instances by <see cref="Type" /> when <see cref="GetService" /> is called. 232/// desired <see cref="Type" /> when <see cref="GetService" /> is called. 235public void InitializeServiceProvider(Func<Type, object?> serviceProvider) 245/// See <see cref="IServiceProvider.GetService(Type)" />. 249public object? GetService(Type serviceType) => _serviceProvider?.Invoke(serviceType);
System\ComponentModel\DataAnnotations\Validator.cs (5)
53var propertyType = _store.GetPropertyType(validationContext); 219var propertyType = _store.GetPropertyType(validationContext); 348/// <param name="destinationType">The destination <see cref="Type" /> for the value.</param> 355private static bool CanBeAssigned(Type destinationType, object? value) 376private static void EnsureValidPropertyType(string propertyName, Type propertyType, object? value)
System.ComponentModel.Composition (444)
Microsoft\Internal\Collections\CollectionServices.CollectionOfObject.cs (3)
12public static ICollection<object> GetCollectionWrapper(Type itemType, object collectionObject) 17var underlyingItemType = itemType.UnderlyingSystemType; 32Type collectionType = typeof(CollectionOfObject<>).MakeGenericType(underlyingItemType);
Microsoft\Internal\Collections\CollectionServices.cs (12)
15private static readonly Type StringType = typeof(string); 16private static readonly Type IEnumerableType = typeof(IEnumerable); 17private static readonly Type IEnumerableOfTType = typeof(IEnumerable<>); 18private static readonly Type ICollectionOfTType = typeof(ICollection<>); 20public static bool IsEnumerableOfT(Type type) 24Type genericType = type.GetGenericTypeDefinition().UnderlyingSystemType; 34public static Type? GetEnumerableElementType(Type type) 41if (ReflectionServices.TryGetGenericInterfaceType(type, IEnumerableOfTType, out Type? closedType)) 49public static Type? GetCollectionElementType(Type type) 51if (ReflectionServices.TryGetGenericInterfaceType(type, ICollectionOfTType, out Type? closedType))
Microsoft\Internal\ContractServices.cs (1)
11public static bool TryCast(Type contractType, object? value, out object? result)
Microsoft\Internal\GenerationServices.cs (26)
17private static readonly MethodInfo s_typeGetTypeFromHandleMethod = typeof(Type).GetMethod("GetTypeFromHandle")!; 20private static readonly Type s_typeType = typeof(System.Type); 21private static readonly Type s_stringType = typeof(string); 22private static readonly Type s_charType = typeof(char); 23private static readonly Type s_booleanType = typeof(bool); 24private static readonly Type s_byteType = typeof(byte); 25private static readonly Type s_sByteType = typeof(sbyte); 26private static readonly Type s_int16Type = typeof(short); 27private static readonly Type s_uInt16Type = typeof(ushort); 28private static readonly Type s_int32Type = typeof(int); 29private static readonly Type s_uInt32Type = typeof(uint); 30private static readonly Type s_int64Type = typeof(long); 31private static readonly Type s_uInt64Type = typeof(ulong); 32private static readonly Type s_doubleType = typeof(double); 33private static readonly Type s_singleType = typeof(float); 34private static readonly Type s_iEnumerableTypeofT = typeof(System.Collections.Generic.IEnumerable<>); 35private static readonly Type s_iEnumerableType = typeof(System.Collections.IEnumerable); 39private static readonly ConstructorInfo ObjectCtor = typeof(object).GetConstructor(Type.EmptyTypes)!; 41public static ILGenerator CreateGeneratorForPublicConstructor(this TypeBuilder typeBuilder, Type[] ctrArgumentTypes) 85Type valueType = value.GetType(); 104ilGenerator.LoadTypeOf((Type)rawValue); 221Type elementType; 222if (ReflectionServices.TryGetGenericInterfaceType(enumerable.GetType(), GenerationServices.s_iEnumerableTypeofT, out Type? closedType)) 234Type generatedArrayType = elementType.MakeArrayType(); 320private static void LoadTypeOf(this ILGenerator ilGenerator, Type type)
Microsoft\Internal\ReflectionInvoke.cs (1)
11public static object? SafeCreateInstance(this Type type, params object?[]? arguments)
Microsoft\Internal\ReflectionServices.cs (18)
18if (member is Type type) 50foreach (Type typeArgument in method.GetGenericArguments()) 60public static string GetDisplayName(Type declaringType, string? name) 76return AttributedModelServices.GetTypeIdentity(((Type)member)); 82internal static bool TryGetGenericInterfaceType(Type instanceType, Type targetOpenInterfaceType, [NotNullWhen(true)] out Type? targetClosedInterfaceType) 107Type? targetInterface = instanceType.GetInterface(targetOpenInterfaceType.Name, false); 124internal static IEnumerable<PropertyInfo> GetAllProperties(this Type type) 126return type.GetInterfaces().Concat(new Type[] { type }).SelectMany(itf => itf.GetProperties()); 129internal static IEnumerable<MethodInfo> GetAllMethods(this Type type) 133Type? baseType = type.BaseType; 145private static IEnumerable<MethodInfo> GetDeclaredMethods(this Type type) 153public static IEnumerable<FieldInfo> GetAllFields(this Type type) 157Type? baseType = type.BaseType; 169private static IEnumerable<FieldInfo> GetDeclaredFields(this Type type) 177internal static bool HasBaseclassOf(this Type? type, Type baseClass)
System\ComponentModel\Composition\AttributedModel\AttributedExportDefinition.cs (2)
17private readonly Type? _typeIdentityType; 21public AttributedExportDefinition(AttributedPartCreationInfo partCreationInfo, MemberInfo member, ExportAttribute exportAttribute, Type? typeIdentityType, string contractName)
System\ComponentModel\Composition\AttributedModel\AttributedModelDiscovery.cs (2)
16public static ComposablePartDefinition? CreatePartDefinitionIfDiscoverable(Type type, ICompositionElement? origin) 27public static ReflectionComposablePartDefinition CreatePartDefinition(Type type, PartCreationPolicyAttribute? partCreationPolicy, bool ignoreConstructorImports, ICompositionElement? origin)
System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs (16)
18private readonly Type _type; 27public AttributedPartCreationInfo(Type type, PartCreationPolicyAttribute? partCreationPolicy, bool ignoreConstructorImports, ICompositionElement? origin) 37public Type GetPartType() 42public Lazy<Type> GetLazyPartType() 44return new Lazy<Type>(GetPartType, LazyThreadSafetyMode.PublicationOnly); 184private static ConstructorInfo? SelectPartConstructor(Type type) 292foreach (Type type in GetInheritedExports(_type)) 317member.GetContractInfoFromExport(exportAttribute, out Type? typeIdentityType, out string contractName); 322private static IEnumerable<MemberInfo> GetExportMembers(Type type) 365private static IEnumerable<Type> GetInheritedExports(Type type) 379Type? currentType = type.BaseType; 398foreach (Type iface in type.GetInterfaces()) 441private static IEnumerable<MemberInfo> GetImportMembers(Type type) 456Type? baseType = type.BaseType; 472private static IEnumerable<MemberInfo> GetDeclaredOnlyImportMembers(Type type)
System\ComponentModel\Composition\AttributedModelServices.cs (7)
55public static ComposablePartDefinition CreatePartDefinition(Type type, ICompositionElement? origin) 62public static ComposablePartDefinition CreatePartDefinition(Type type, ICompositionElement? origin, bool ensureIsDiscoverable) 75public static string GetTypeIdentity(Type type) 89public static string GetContractName(Type type) 230public static bool Exports(this ComposablePartDefinition part, Type contractType) 261public static bool Imports(this ComposablePartDefinition part, Type contractType) 293public static bool Imports(this ComposablePartDefinition part, Type contractType, ImportCardinality importCardinality)
System\ComponentModel\Composition\CatalogReflectionContextAttribute.cs (2)
16private readonly Type _reflectionContextType; 18public CatalogReflectionContextAttribute(Type reflectionContextType)
System\ComponentModel\Composition\ConstraintServices.cs (7)
20private static readonly MethodInfo _metadataEqualsMethod = typeof(object).GetMethod("Equals", new Type[] { typeof(object) })!; 21private static readonly MethodInfo _typeIsInstanceOfTypeMethod = typeof(Type).GetMethod("IsInstanceOfType")!; 23public static Expression<Func<ExportDefinition, bool>> CreateConstraint(string contractName, string? requiredTypeIdentity, IEnumerable<KeyValuePair<string, Type>> requiredMetadata, CreationPolicy requiredCreationPolicy) 66private static Expression? CreateMetadataConstraintBody(IEnumerable<KeyValuePair<string, Type>> requiredMetadata, ParameterExpression parameter) 72foreach (KeyValuePair<string, Type> requiredMetadataItem in requiredMetadata) 136private static MethodCallExpression CreateMetadataOfTypeExpression(ParameterExpression parameter, string constantKey, Type constantType) 155Expression.Constant(constantType, typeof(Type)),
System\ComponentModel\Composition\ContractNameServices.cs (30)
29private static Dictionary<Type, string>? typeIdentityCache; 31private static Dictionary<Type, string> TypeIdentityCache 35return typeIdentityCache ??= new Dictionary<Type, string>(); 39internal static string GetTypeIdentity(Type type) 44internal static string GetTypeIdentity(Type type, bool formatGenericName) 108private static void WriteTypeWithNamespace(StringBuilder typeName, Type type, bool formatGenericName) 119private static void WriteType(StringBuilder typeName, Type type, bool formatGenericName) 128Queue<Type> genericTypeArguments = new Queue<Type>(type.GetGenericArguments()); 141private static void WriteNonGenericType(StringBuilder typeName, Type type, bool formatGenericName) 169private static void WriteArrayType(StringBuilder typeName, Type type, bool formatGenericName) 177Type rootElementType = FindArrayElementType(type); 179Type? elementType = type; 187private static void WritePointerType(StringBuilder typeName, Type type, bool formatGenericName) 196private static void WriteByRefType(StringBuilder typeName, Type type, bool formatGenericName) 205private static void WriteArrayTypeDimensions(StringBuilder typeName, Type type) 219private static void WriteGenericType(StringBuilder typeName, Type type, bool isDefinition, Queue<Type> genericTypeArguments, bool formatGenericName) 241private static void WriteGenericTypeName(StringBuilder typeName, Type type, bool isDefinition, Queue<Type> genericTypeArguments, bool formatGenericName) 256private static void WriteTypeArgumentsString(StringBuilder typeName, int argumentsCount, bool isDefinition, Queue<Type> genericTypeArguments, bool formatGenericName) 272Type genericTypeArgument = genericTypeArguments.Dequeue(); 279private static void WriteTypeArgument(StringBuilder typeName, bool isDefinition, Type genericTypeArgument, bool formatGenericName) 296internal static void WriteCustomModifiers(StringBuilder typeName, string customKeyword, Type[] types, bool formatGenericName) 303Queue<Type> typeArguments = new Queue<Type>(types); 311private static Type FindArrayElementType(Type type) 316Type? elementType = type; 336private static int GetGenericArity(Type type)
System\ComponentModel\Composition\ExceptionBuilder.cs (1)
88public static ArgumentException CreateReflectionModelInvalidPartDefinition(string parameterName, Type partDefinitionType)
System\ComponentModel\Composition\ExportAttribute.cs (13)
22/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the type of the 31: this((string?)null, (Type?)null) 41/// A <see cref="Type"/> of which to derive the contract name to export the type or 48/// <see cref="AttributedModelServices.GetContractName(Type)"/> on 53/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the type of the 61public ExportAttribute(Type? contractType) 78/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the property or field 87: this(contractName, (Type?)null) 101/// A <see cref="Type"/> of which to derive the contract name to export the type or 108/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the property or field 116public ExportAttribute(string? contractName, Type? contractType) 135/// A <see cref="Type"/> of the export that is be provided. The default value is 139public Type? ContractType { get; }
System\ComponentModel\Composition\ExportServices.cs (10)
23internal static readonly Type DefaultMetadataViewType = typeof(IDictionary<string, object>); 24internal static readonly Type DefaultExportedValueType = typeof(object); 26internal static bool IsDefaultMetadataViewType(Type metadataViewType) 36internal static bool IsDictionaryConstructorViewType(Type metadataViewType) 42Type.DefaultBinder, 43new Type[] { typeof(IDictionary<string, object>) }, 47internal static Func<Export, object> CreateStronglyTypedLazyFactory(Type? exportType, Type? metadataViewType) 67internal static Func<Export, Lazy<object, object>> CreateSemiStronglyTypedLazyFactory(Type? exportType, Type? metadataViewType)
System\ComponentModel\Composition\Hosting\AssemblyCatalog.cs (9)
39/// attributed <see cref="Type"/> objects to add to the <see cref="AssemblyCatalog"/>. 87/// attributed <see cref="Type"/> objects to add to the <see cref="AssemblyCatalog"/>. 145/// attributed <see cref="Type"/> objects to add to the <see cref="AssemblyCatalog"/>. 201/// attributed <see cref="Type"/> objects to add to the <see cref="AssemblyCatalog"/>. 266/// The <see cref="Assembly"/> containing the attributed <see cref="Type"/> objects to 299/// The <see cref="Assembly"/> containing the attributed <see cref="Type"/> objects to 340/// The <see cref="Assembly"/> containing the attributed <see cref="Type"/> objects to 363/// The <see cref="Assembly"/> containing the attributed <see cref="Type"/> objects to 463/// The <see cref="Assembly"/> containing the attributed <see cref="Type"/> objects
System\ComponentModel\Composition\Hosting\CompositionServices.cs (39)
16internal static readonly Type InheritedExportAttributeType = typeof(InheritedExportAttribute); 17internal static readonly Type ExportAttributeType = typeof(ExportAttribute); 18internal static readonly Type AttributeType = typeof(Attribute); 19internal static readonly Type ObjectType = typeof(object); 26internal static Type GetDefaultTypeFromMember(this MemberInfo member) 37return ((Type)member); 49internal static Type AdjustSpecifiedTypeIdentityType(this Type specifiedContractType, MemberInfo member) 61internal static Type AdjustSpecifiedTypeIdentityType(this Type specifiedContractType, Type? memberType) 93private static string AdjustTypeIdentity(string originalTypeIdentity, Type typeIdentityType) 98internal static void GetContractInfoFromExport(this MemberInfo member, ExportAttribute export, out Type? typeIdentityType, out string contractName) 111internal static string GetTypeIdentityFromExport(this MemberInfo member, Type? typeIdentityType) 133private static Type? GetTypeIdentityTypeFromExport(this MemberInfo member, ExportAttribute export) 150internal static Type GetContractTypeFromImport(this IAttributedImport import, ImportType importType) 167Type contractType = import.GetContractTypeFromImport(importType); 174Type contractType = import.GetContractTypeFromImport(importType); 185internal static IDictionary<string, object?> GetPartMetadataForType(this Type type, CreationPolicy creationPolicy) 213Type[] genericArguments = type.GetGenericArguments(); 222Type genericArgument = genericArguments[i]; 224Type[]? constraints = genericArgument.GetGenericParameterConstraints(); 281Type attrType = attr.GetType(); 335private static bool TryContributeMetadataValue(this IDictionary<string, object?> dictionary, string name, object? value, Type? valueType, bool allowsMultiple) 366private Type? _arrayType; 368private static readonly Type ObjectType = typeof(object); 369private static readonly Type TypeType = typeof(Type); 372public void Add(object? item, Type? itemType) 389if (item is Type) 403private void InferArrayType(Type itemType) 469internal static IEnumerable<KeyValuePair<string, Type>> GetRequiredMetadata(Type? metadataViewType) 476return Enumerable.Empty<KeyValuePair<string, Type>>(); 487return properties.Select(property => new KeyValuePair<string, Type>(property.Name, property.PropertyType)); 495internal static IDictionary<string, object?> GetImportMetadata(Type type, IAttributedImport? attributedImport) 613private static bool IsValidAttributeType(Type type) 618private static bool IsValidAttributeType(Type type, bool arrayAllowed) 641if (typeof(Type).IsAssignableFrom(type))
System\ComponentModel\Composition\Hosting\ExportProvider.GetExportOverrides.cs (27)
38/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 89/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 134/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 187/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 220/// The <see cref="Type"/> of the <see cref="Export"/> objects to return. 223/// The <see cref="Type"/> of the metadata view of the <see cref="Export"/> objects to 245/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <paramref name="type"/>. 261public IEnumerable<Lazy<object, object>> GetExports(Type type, Type? metadataViewType, string? contractName) 297/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 338/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 373/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 415/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 448/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 498/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 553/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 605/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 647/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 688/// <see cref="AttributedModelServices.GetContractName(Type)"/> on <typeparamref name="T"/>. 713IEnumerable<Export> exports = GetExportsCore(typeof(T), (Type?)null, contractName, ImportCardinality.ZeroOrMore); 730Export? export = GetExportsCore(typeof(T), (Type?)null, contractName, cardinality).SingleOrDefault(); 737IEnumerable<Export> exports = GetExportsCore(typeof(T), (Type?)null, contractName, ImportCardinality.ZeroOrMore); 773private IEnumerable<Export> GetExportsCore(Type type, Type? metadataViewType, string? contractName, ImportCardinality cardinality) 794private static ContractBasedImportDefinition BuildImportDefinition(Type type, Type metadataViewType, string contractName, ImportCardinality cardinality) 800IEnumerable<KeyValuePair<string, Type>> requiredMetadata = CompositionServices.GetRequiredMetadata(metadataViewType);
System\ComponentModel\Composition\Hosting\ImportSourceImportDefinitionHelpers.cs (1)
100public override IEnumerable<KeyValuePair<string, Type>> RequiredMetadata
System\ComponentModel\Composition\Hosting\TypeCatalog.cs (19)
28private Type[]? _types; 39/// An <see cref="Array"/> of attributed <see cref="Type"/> objects to add to the 52public TypeCatalog(params Type[] types) : this((IEnumerable<Type>)types) 61/// An <see cref="IEnumerable{T}"/> of attributed <see cref="Type"/> objects to add 74public TypeCatalog(IEnumerable<Type> types) 89/// An <see cref="IEnumerable{T}"/> of attributed <see cref="Type"/> objects to add 101public TypeCatalog(IEnumerable<Type> types, ICompositionElement definitionOrigin) 117/// An <see cref="IEnumerable{T}"/> of attributed <see cref="Type"/> objects to add 130public TypeCatalog(IEnumerable<Type> types, ReflectionContext reflectionContext) 146/// An <see cref="IEnumerable{T}"/> of attributed <see cref="Type"/> objects to add 162public TypeCatalog(IEnumerable<Type> types, ReflectionContext reflectionContext, ICompositionElement definitionOrigin) 174private void InitializeTypeCatalog(IEnumerable<Type> types, ReflectionContext reflectionContext) 176var typesList = new List<Type>(); 177foreach (var type in types) 204private void InitializeTypeCatalog(IEnumerable<Type> types) 206Type[] arr = types.ToArray(); 207foreach (Type type in arr) 267foreach (Type type in _types)
System\ComponentModel\Composition\IAttributedImport.cs (1)
11Type? ContractType { get; }
System\ComponentModel\Composition\ImportAttribute.cs (10)
23/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the property, field, 41/// A <see cref="Type"/> of which to derive the contract name of the export to import, or 47/// <see cref="AttributedModelServices.GetContractName(Type)"/> on 52/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the property, field, 60public ImportAttribute(Type? contractType) 76/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the property, field, 85: this(contractName, (Type?)null) 89public ImportAttribute(string? contractName, Type? contractType) 108/// A <see cref="Type"/> of the export that this import is expecting. The default value is 113public Type? ContractType { get; }
System\ComponentModel\Composition\ImportManyAttribute.cs (10)
23/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the element\item type of 41/// A <see cref="Type"/> of which to derive the contract name of the exports to import, or 47/// <see cref="AttributedModelServices.GetContractName(Type)"/> on 52/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the property, field, 60public ImportManyAttribute(Type? contractType) 76/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the property, field, 85: this(contractName, (Type?)null) 89public ImportManyAttribute(string? contractName, Type? contractType) 108/// A <see cref="Type"/> of the export that this import is expecting. The default value is 113public Type? ContractType { get; }
System\ComponentModel\Composition\InheritedExportAttribute.cs (11)
21/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the type itself, 30: this((string?)null, (Type?)null) 39/// A <see cref="Type"/> of which to derive the contract name to export the type 46/// <see cref="AttributedModelServices.GetContractName(Type)"/> on 51/// <see cref="AttributedModelServices.GetContractName(Type)"/> on the type of the 59public InheritedExportAttribute(Type? contractType) 76/// <see cref="AttributedModelServices.GetContractName(Type)"/> on 85: this(contractName, (Type?)null) 99/// A <see cref="Type"/> of which to derive the contract name to export the type 106/// <see cref="AttributedModelServices.GetContractName(Type)"/> on 114public InheritedExportAttribute(string? contractName, Type? contractType)
System\ComponentModel\Composition\MetadataViewGenerator.cs (18)
69private static readonly Dictionary<Type, MetadataViewFactory> _metadataViewFactories = new Dictionary<Type, MetadataViewFactory>(); 73private static readonly Type[] CtorArgumentTypes = new Type[] { typeof(IDictionary<string, object>) }; 75private static readonly MethodInfo ObjectGetType = typeof(object).GetMethod("GetType", Type.EmptyTypes)!; 76private static readonly ConstructorInfo ObjectCtor = typeof(object).GetConstructor(Type.EmptyTypes)!; 91public static MetadataViewFactory GetMetadataViewFactory(Type viewType) 112Type? generatedProxyType = GenerateInterfaceViewProxyType(viewType); 181private static Type? GenerateInterfaceViewProxyType(Type viewType) 184Type? proxyType; 186Type[] interfaces = { viewType }; 202LocalBuilder sourceType = proxyCtorIL.DeclareLocal(typeof(Type)); 216Type[] propertyTypeArguments = new Type[] { propertyInfo.PropertyType }; 217Type[]? optionalModifiers = null; 218Type[]? requiredModifiers = null; 323Type.EmptyTypes, null, null);
System\ComponentModel\Composition\MetadataViewImplementationAttribute.cs (4)
17/// A <see cref="Type"/> for the implementation of the MetadataView. 26public MetadataViewImplementationAttribute(Type? implementationType) 35/// A <see cref="Type"/> of the export that is be provided. The default value is 39public Type? ImplementationType { get; }
System\ComponentModel\Composition\MetadataViewProvider.cs (3)
19Type metadataViewType = typeof(TMetadataView); 29Type? proxyType = null; 126public static bool IsViewTypeValid(Type metadataViewType)
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (12)
24private readonly IEnumerable<KeyValuePair<string, Type>> _requiredMetadata = Enumerable.Empty<KeyValuePair<string, Type>>(); 57/// The type identity of the export type expected. Use <see cref="AttributedModelServices.GetTypeIdentity(Type)"/> 101public ContractBasedImportDefinition(string contractName, string? requiredTypeIdentity, IEnumerable<KeyValuePair<string, Type>>? requiredMetadata, 118/// The type identity of the export type expected. Use <see cref="AttributedModelServices.GetTypeIdentity(Type)"/> 163public ContractBasedImportDefinition(string contractName, string? requiredTypeIdentity, IEnumerable<KeyValuePair<string, Type>>? requiredMetadata, 183/// A <see cref="string"/> that is generated by <see cref="AttributedModelServices.GetTypeIdentity(Type)"/> 208public virtual IEnumerable<KeyValuePair<string, Type>> RequiredMetadata 224foreach (KeyValuePair<string, Type> metadataItem in _requiredMetadata) 319foreach (KeyValuePair<string, Type> metadataItem in RequiredMetadata) 322Type metadataValueType = metadataItem.Value; 374foreach (KeyValuePair<string, Type> metadataItem in _requiredMetadata)
System\ComponentModel\Composition\Primitives\ExportedDelegate.cs (4)
26public virtual Delegate? CreateDelegate(Type delegateType) 45private Type CreateStandardDelegateType() 50Type[] parameterTypes = new Type[parameters.Length + 1];
System\ComponentModel\Composition\ReflectionModel\ExportfactoryCreator.cs (8)
14private readonly Type _exportFactoryType; 16public ExportFactoryCreator(Type exportFactoryType) 23public Func<Export, object> CreateStronglyTypedExportFactoryFactory(Type exportType, Type? metadataViewType) 46Type[] typeArgs = { typeof(T) }; 47Type constructed = _exportFactoryType.MakeGenericType(typeArgs); 59Type[] typeArgs = { typeof(T), typeof(M) }; 60Type constructed = _exportFactoryType.MakeGenericType(typeArgs);
System\ComponentModel\Composition\ReflectionModel\GenericServices.cs (29)
14internal static IList<Type> GetPureGenericParameters(this Type type) 20List<Type> pureGenericParameters = new List<Type>(); 21TraverseGenericType(type, (Type t) => 32return Type.EmptyTypes; 36internal static int GetPureGenericArity(this Type type) 43TraverseGenericType(type, (Type t) => 54private static void TraverseGenericType(Type type, Action<Type> onType) 58foreach (Type genericArgument in type.GetGenericArguments()) 66public static int[] GetGenericParametersOrder(Type type) 92public static IEnumerable<Type>? CreateTypeSpecializations(this Type[]? types, Type[] specializationTypes) 104public static Type CreateTypeSpecialization(this Type type, Type[] specializationTypes) 119Type[] typeGenericArguments = type.GetGenericArguments(); 120Type[] subSpecialization = new Type[typeGenericArguments.Length]; 124Type typeGenericArgument = typeGenericArguments[i]; 136public static bool CanSpecialize(Type? type, IEnumerable<Type>? constraints, GenericParameterAttributes attributes) 141public static bool CanSpecialize(Type? type, IEnumerable<Type>? constraintTypes) 150foreach (Type constraintType in constraintTypes) 161public static bool CanSpecialize(Type type, GenericParameterAttributes attributes) 181if (!type.IsValueType && ((type.GetConstructor(Type.EmptyTypes) == null) || type.IsAbstract))
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (12)
20private readonly Type[] _specialization; 24private readonly Lazy<Type> _lazyPartType; 32public GenericSpecializationPartCreationInfo(IReflectionPartCreationInfo originalPartCreationInfo, ReflectionComposablePartDefinition originalPart, Type[] specialization) 46_lazyPartType = new Lazy<Type>( 60public Type GetPartType() 65public Lazy<Type> GetLazyPartType() 184Type closedGenericPartType = GetPartType(); 197foreach (var iface in closedGenericPartType.GetInterfaces()) 202foreach (var type in closedGenericPartType.GetNestedTypes()) 208var baseType = closedGenericPartType.BaseType; 547public static bool CanSpecialize(IDictionary<string, object?> partMetadata, Type[] specialization) 584(genericParameterConstraints[i] as Type[]).CreateTypeSpecializations(specialization),
System\ComponentModel\Composition\ReflectionModel\ImportingItem.cs (3)
51Type elementType = ImportType.ElementType ?? typeof(object); 82private object? CastSingleExportToImportType(Type type, Export export) 92private object? Cast(Type type, Export export)
System\ComponentModel\Composition\ReflectionModel\ImportingMember.cs (3)
110Type? itemType = CollectionServices.GetCollectionElementType(ImportType.ActualType); 120private ICollection<object> GetNormalizedCollection(Type itemType, object? instance) 145ConstructorInfo? constructor = ImportType.ActualType.GetConstructor(Type.EmptyTypes);
System\ComponentModel\Composition\ReflectionModel\ImportType.cs (27)
14private static readonly Type LazyOfTType = typeof(Lazy<>); 15private static readonly Type LazyOfTMType = typeof(Lazy<,>); 16private static readonly Type ExportFactoryOfTType = typeof(ExportFactory<>); 18private readonly Type _type; 20private Type _contractType; 25internal static Dictionary<Type, Func<Export, object>?>? _castSingleValueCache; 27private static Dictionary<Type, Func<Export, object>?> CastSingleValueCache 31return _castSingleValueCache ??= new Dictionary<Type, Func<Export, object>?>(); 35public ImportType(Type type, ImportCardinality cardinality) 40Type contractType = type; 58public Type? ElementType { get; private set; } 60public Type ActualType 67public Type ContractType { get { return _contractType; } } 81public Type? MetadataViewType { get; private set; } 83private Type CheckForCollection(Type type) 93private static bool IsGenericDescendentOf(Type? type, Type baseGenericTypeDefinition) 108public static bool IsDescendentOf(Type type, Type baseType) 122private void Initialize(Type type) 131Type[] arguments = type.GetGenericArguments(); 132Type genericType = type.GetGenericTypeDefinition().UnderlyingSystemType; 158private static bool IsLazyGenericType(Type genericType) 163private static bool TryGetCastFunction(Type genericType, bool isOpenGeneric, Type[] arguments, out Func<Export, object>? castFunction) 212private static bool IsTypeAssignableCollectionType(Type type)
System\ComponentModel\Composition\ReflectionModel\IReflectionPartCreationInfo.cs (2)
12Type GetPartType(); 13Lazy<Type> GetLazyPartType();
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePartDefinition.cs (11)
31public Type GetPartType() 36public Lazy<Type> GetLazyPartType() 155if (TryGetGenericTypeParameters(genericParameters, out Type?[]? genericTypeParameters)) 161foreach (Type[] candidateParameters in GetCandidateParameters(genericTypeParameters!)) 264private IEnumerable<Type[]> GetCandidateParameters(Type[] genericParameters) 278private static bool TryGetGenericTypeParameters(IEnumerable<object> genericParameters, [NotNullWhen(true)] out Type?[]? genericTypeParameters) 280genericTypeParameters = genericParameters as Type[]; 284genericTypeParameters = new Type[genericParametersAsArray.Length]; 287genericTypeParameters[i] = genericParametersAsArray[i] as Type; 297internal bool TryMakeGenericPartDefinition(Type[] genericTypeParameters, [NotNullWhen(true)] out ComposablePartDefinition? genericPartDefinition)
System\ComponentModel\Composition\ReflectionModel\ReflectionExtensions.cs (2)
33return ((Type)accessors[0]).ToReflectionType(); 122public static ReflectionType ToReflectionType(this Type type)
System\ComponentModel\Composition\ReflectionModel\ReflectionField.cs (1)
45public override Type ReturnType
System\ComponentModel\Composition\ReflectionModel\ReflectionImportDefinition.cs (1)
16IEnumerable<KeyValuePair<string, Type>>? requiredMetadata,
System\ComponentModel\Composition\ReflectionModel\ReflectionItem.cs (1)
10public abstract Type ReturnType { get; }
System\ComponentModel\Composition\ReflectionModel\ReflectionMember.cs (1)
16public Type DeclaringType
System\ComponentModel\Composition\ReflectionModel\ReflectionMemberImportDefinition.cs (1)
18IEnumerable<KeyValuePair<string, Type>>? requiredMetadata,
System\ComponentModel\Composition\ReflectionModel\ReflectionMethod.cs (1)
40public override Type ReturnType
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (13)
17public static Lazy<Type> GetPartType(ComposablePartDefinition partDefinition) 127Lazy<Type> partType, 165IEnumerable<KeyValuePair<string, Type>>? requiredMetadata, 178IEnumerable<KeyValuePair<string, Type>>? requiredMetadata, 204IEnumerable<KeyValuePair<string, Type>>? requiredMetadata, 251IEnumerable<KeyValuePair<string, Type>>? requiredMetadata, 263IEnumerable<KeyValuePair<string, Type>>? requiredMetadata, 302public static bool TryMakeGenericPartDefinition(ComposablePartDefinition partDefinition, IEnumerable<Type> genericParameters, [NotNullWhen(true)] out ComposablePartDefinition? specialization) 319private readonly Lazy<Type> _partType; 328Lazy<Type> partType, 345public Type GetPartType() 350public Lazy<Type> GetLazyPartType() 373_constructor = GetPartType().GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, Type.EmptyTypes, null);
System\ComponentModel\Composition\ReflectionModel\ReflectionParameter.cs (1)
34public override Type ReturnType
System\ComponentModel\Composition\ReflectionModel\ReflectionParameterImportDefinition.cs (1)
20IEnumerable<KeyValuePair<string, Type>>? requiredMetadata,
System\ComponentModel\Composition\ReflectionModel\ReflectionProperty.cs (1)
92public override Type ReturnType
System\ComponentModel\Composition\ReflectionModel\ReflectionType.cs (3)
10private readonly Type _type; 12public ReflectionType(Type type) 34public override Type ReturnType
System\Composition\Diagnostics\CompositionTrace.cs (3)
62internal static void DefinitionMarkedWithPartNotDiscoverableAttribute(Type type) 74internal static void DefinitionMismatchedExportArity(Type type, MemberInfo member) 87internal static void DefinitionContainsNoExports(Type type)
System.ComponentModel.Composition.Registration (59)
src\libraries\Common\src\System\Composition\Diagnostics\CompositionTrace.cs (8)
10public static void Registration_ConstructorConventionOverridden(Type type) 23public static void Registration_TypeExportConventionOverridden(Type type) 36public static void Registration_MemberExportConventionOverridden(Type type, MemberInfo member) 55public static void Registration_MemberImportConventionOverridden(Type type, MemberInfo member) 74public static void Registration_OnSatisfiedImportNotificationOverridden(Type type, MemberInfo member) 93public static void Registration_PartCreationConventionOverridden(Type type) 108public static void Registration_MemberImportConventionMatchedTwice(Type type, MemberInfo member) 127public static void Registration_PartMetadataConventionOverridden(Type type)
System\ComponentModel\Composition\Registration\ExportBuilder.cs (7)
12private Type _contractType; 14private List<Tuple<string, Func<Type, object>>> _metadataItemFuncs; 23public ExportBuilder AsContractType(Type type) 49public ExportBuilder AddMetadata(string name, Func<Type, object> itemFunc) 51_metadataItemFuncs ??= new List<Tuple<string, Func<Type, object>>>(); 57internal void BuildAttributes(Type type, ref List<Attribute> attributes) 84foreach (Tuple<string, Func<Type, object>> item in _metadataItemFuncs)
System\ComponentModel\Composition\Registration\ImportBuilder.cs (4)
11private static readonly Type s_stringType = typeof(string); 13private Type _contractType; 28public ImportBuilder AsContractType(Type type) 71internal void BuildAttributes(Type type, ref List<Attribute> attributes)
System\ComponentModel\Composition\Registration\PartBuilder.cs (32)
14private static readonly Type s_exportAttributeType = typeof(ExportAttribute); 21private List<Tuple<string, Func<Type, object>>> _metadataItemFuncs; 28private readonly List<Tuple<Predicate<PropertyInfo>, Action<PropertyInfo, ExportBuilder>, Type>> _propertyExports; 29private readonly List<Tuple<Predicate<PropertyInfo>, Action<PropertyInfo, ImportBuilder>, Type>> _propertyImports; 30private readonly List<Tuple<Predicate<Type>, Action<Type, ExportBuilder>>> _interfaceExports; 32internal Predicate<Type> SelectType { get; } 34internal PartBuilder(Predicate<Type> selectType) 40_propertyExports = new List<Tuple<Predicate<PropertyInfo>, Action<PropertyInfo, ExportBuilder>, Type>>(); 41_propertyImports = new List<Tuple<Predicate<PropertyInfo>, Action<PropertyInfo, ImportBuilder>, Type>>(); 42_interfaceExports = new List<Tuple<Predicate<Type>, Action<Type, ExportBuilder>>>(); 89public PartBuilder ExportInterfaces(Predicate<Type> interfaceFilter) 99public PartBuilder ExportInterfaces(Predicate<Type> interfaceFilter, 100Action<Type, ExportBuilder> exportConfiguration) 131_propertyExports.Add(Tuple.Create(propertyFilter, exportConfiguration, default(Type))); 179_propertyImports.Add(Tuple.Create(propertyFilter, importConfiguration, default(Type))); 221public PartBuilder AddMetadata(string name, Func<Type, object> itemFunc) 223_metadataItemFuncs ??= new List<Tuple<string, Func<Type, object>>>(); 239Type attrType = attr.GetType(); 250internal IEnumerable<Attribute> BuildTypeAttributes(Type type) 313foreach (Tuple<string, Func<Type, object>> item in _metadataItemFuncs) 333foreach (Type iface in type.GetInterfaces()) 335Type underlyingType = iface.UnderlyingSystemType; 343foreach (Tuple<Predicate<Type>, Action<Type, ExportBuilder>> exportSpecification in _interfaceExports) 348exportBuilder.AsContractType((Type)iface); 362internal bool BuildConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers) 403internal static void BuildDefaultConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers) 444internal void BuildPropertyAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers) 457foreach (Tuple<Predicate<PropertyInfo>, Action<PropertyInfo, ImportBuilder>, Type> importSpecification in _propertyImports) 497foreach (Tuple<Predicate<PropertyInfo>, Action<PropertyInfo, ExportBuilder>, Type> exportSpecification in _propertyExports)
System\ComponentModel\Composition\Registration\PartBuilderOfT.cs (1)
150internal PartBuilder(Predicate<Type> selectType) : base(selectType)
System\ComponentModel\Composition\Registration\RegistrationBuilder.cs (7)
41public PartBuilder ForTypesDerivedFrom(Type type) 62public PartBuilder ForType(Type type) 75public PartBuilder<T> ForTypesMatching<T>(Predicate<Type> typeFilter) 88public PartBuilder ForTypesMatching(Predicate<Type> typeFilter) 101private List<Tuple<object, List<Attribute>>> EvaluateThisTypeAgainstTheConvention(Type type) 139MemberInfo underlyingMemberType = ((Type)member).UnderlyingSystemType; 153foreach (Tuple<object, List<Attribute>> element in EvaluateThisTypeAgainstTheConvention((Type)member))
System.ComponentModel.Primitives (12)
System\ComponentModel\Component.cs (1)
107protected virtual object? GetService(Type service) => _site?.GetService(service);
System\ComponentModel\Design\Serialization\DesignerSerializerAttribute.cs (3)
19public DesignerSerializerAttribute(Type serializerType, Type baseSerializerType) 31public DesignerSerializerAttribute(string? serializerTypeName, Type baseSerializerType)
System\ComponentModel\DesignerAttribute.cs (4)
32public DesignerAttribute(Type designerType) 56public DesignerAttribute(string designerTypeName, Type designerBaseType) 69public DesignerAttribute(Type designerType, Type designerBaseType)
System\ComponentModel\EditorAttribute.cs (3)
41public EditorAttribute(string typeName, Type baseType) 53public EditorAttribute(Type type, Type baseType)
System\ComponentModel\InvalidEnumArgumentException.cs (1)
47public InvalidEnumArgumentException(string? argumentName, int invalidValue, Type enumClass)
System.ComponentModel.TypeConverter (607)
MS\Internal\Xml\Linq\ComponentModel\XComponentModel.cs (3)
20public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object? instance) 72public override Type ComponentType 82public override Type PropertyType
src\libraries\Common\src\System\Drawing\ColorTable.cs (1)
24[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type typeWithColors)
System\ComponentModel\AmbientValueAttribute.cs (2)
28public AmbientValueAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string value) 45static TypeConverter TypeDescriptorGetConverter([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) => TypeDescriptor.GetConverter(type);
System\ComponentModel\ArrayConverter.cs (5)
18public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 47Type arrayType = value.GetType(); 48Type elementType = arrayType.GetElementType()!; 67public ArrayPropertyDescriptor(Type arrayType, Type elementType, int index)
System\ComponentModel\AttributeCollection.cs (8)
23private static Dictionary<Type, Attribute?>? s_defaultAttributes; 31public Type type; 127public virtual Attribute? this[[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields)] Type attributeType] 176Type aType = attribute.GetType(); 243protected Attribute? GetDefaultAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields)] Type attributeType) 249s_defaultAttributes ??= new Dictionary<Type, Attribute?>(); 260Type reflect = TypeDescriptor.GetReflectionType(attributeType); 269ConstructorInfo? ci = reflect.UnderlyingSystemType.GetConstructor(Type.EmptyTypes);
System\ComponentModel\AttributeProviderAttribute.cs (1)
38public AttributeProviderAttribute([DynamicallyAccessedMembers(RequiredMemberTypes)] Type type)
System\ComponentModel\BaseNumberConverter.cs (4)
24internal abstract Type TargetType { get; } 45public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 90public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 110public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType)
System\ComponentModel\BindingList.cs (2)
80Type itemType = typeof(T); 88return itemType.GetConstructor(BindingFlags, null, Type.EmptyTypes, null) != null;
System\ComponentModel\BooleanConverter.cs (1)
19public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
System\ComponentModel\ByteConverter.cs (1)
17internal override Type TargetType => typeof(byte);
System\ComponentModel\CharConverter.cs (2)
18public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 26public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\ComponentModel\CollectionConverter.cs (1)
19public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\ComponentModel\ComponentConverter.cs (1)
17public ComponentConverter(Type type) : base(type)
System\ComponentModel\ComponentResourceManager.cs (4)
27public ComponentResourceManager(Type t) : base(t) 85Type typeFromValue = value.GetType(); 90private void ApplyResources(object value, Type typeFromValue, string objectName, CultureInfo? culture) 191Type? t = typeFromValue;
System\ComponentModel\Container.cs (2)
130protected virtual object? GetService(Type service) => service == typeof(IContainer) ? this : null; 263public object? GetService(Type service)
System\ComponentModel\CultureInfoConverter.cs (4)
43public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 52public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 139public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 161typeof(CultureInfo).GetConstructor(new Type[] { typeof(string) }),
System\ComponentModel\CustomTypeDescriptor.cs (1)
132public virtual object? GetEditor(Type editorBaseType) => _parent?.GetEditor(editorBaseType);
System\ComponentModel\DateOnlyConverter.cs (4)
20public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 26public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 77public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 98return new InstanceDescriptor(typeof(DateOnly).GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int) }), new object[] { date.Year, date.Month, date.Day });
System\ComponentModel\DateTimeConverter.cs (5)
22public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 31public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 81public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 126typeof(DateTime).GetConstructor(new Type[] { typeof(long) }), 132typeof(DateTime).GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int) }),
System\ComponentModel\DateTimeOffsetConverter.cs (5)
21public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 30public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 81public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 138typeof(DateTimeOffset).GetConstructor(new Type[] { typeof(long) }), 144typeof(DateTimeOffset).GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(TimeSpan) }),
System\ComponentModel\DecimalConverter.cs (4)
26internal override Type TargetType => typeof(decimal); 32public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 44public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 48ConstructorInfo? ctor = typeof(decimal).GetConstructor(new Type[] { typeof(int[]) });
System\ComponentModel\DelegatingTypeDescriptionProvider.cs (12)
18private readonly Type _type; 23internal DelegatingTypeDescriptionProvider(Type type) 37[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, 38Type[]? argTypes, 100public override Type GetReflectionType( 101[DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)] Type objectType, 107public override Type GetRuntimeType(Type objectType) => Provider.GetRuntimeType(objectType); 117public override ICustomTypeDescriptor? GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object? instance) 122public override bool IsSupportedType(Type type) => Provider.IsSupportedType(type); 124public override bool IsRegisteredType(Type type) => Provider.IsRegisteredType(type); 128public override ICustomTypeDescriptor? GetTypeDescriptorFromRegisteredType(Type objectType, object? instance) => Provider.GetTypeDescriptorFromRegisteredType(objectType, instance);
System\ComponentModel\Design\DesignerOptionService.cs (5)
414public override Type ComponentType => _property.ComponentType; 418public override Type PropertyType => _property.PropertyType; 460public override object? ConvertTo(ITypeDescriptorContext? cxt, CultureInfo? culture, object? value, Type destinationType) 478public override Type ComponentType => _option.GetType(); 482public override Type PropertyType => _option.GetType();
System\ComponentModel\Design\DesigntimeLicenseContext.cs (3)
28public override string? GetSavedLicenseKey(Type type, Assembly? resourceAssembly) => null; 33public override void SetSavedLicenseKey(Type type, string key) 60public override string? GetSavedLicenseKey(Type type, Assembly? resourceAssembly)
System\ComponentModel\Design\HelpKeywordAttribute.cs (1)
72public HelpKeywordAttribute(Type t)
System\ComponentModel\Design\IComponentDiscoveryService.cs (1)
19ICollection GetComponentTypes(IDesignerHost? designerHost, Type? baseType);
System\ComponentModel\Design\IDesignerHost.cs (3)
94IComponent CreateComponent(Type componentClass); 99IComponent CreateComponent(Type componentClass, string name); 134Type? GetType(string typeName);
System\ComponentModel\Design\IReferenceService.cs (1)
35object[] GetReferences(Type baseType);
System\ComponentModel\Design\IServiceObjectContainer.cs (6)
16void AddService(Type serviceType, object serviceInstance); 21void AddService(Type serviceType, object serviceInstance, bool promote); 26void AddService(Type serviceType, ServiceCreatorCallback callback); 31void AddService(Type serviceType, ServiceCreatorCallback callback, bool promote); 36void RemoveService(Type serviceType); 41void RemoveService(Type serviceType, bool promote);
System\ComponentModel\Design\ITypeDiscoveryService.cs (1)
21ICollection GetTypes(Type? baseType, bool excludeGlobalTypes);
System\ComponentModel\Design\ITypeResolutionService.cs (3)
28Type? GetType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] string name); 34Type? GetType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] string name, bool throwOnError); 40Type? GetType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] string name, bool throwOnError, bool ignoreCase);
System\ComponentModel\Design\PropertyTabAttribute.cs (10)
17private Type[]? _tabClasses; 34public PropertyTabAttribute(Type tabClass) : this(tabClass, PropertyTabScope.Component) 53public PropertyTabAttribute(Type tabClass, PropertyTabScope tabScope) 55_tabClasses = new Type[] { tabClass }; 83public Type[] TabClasses 103_tabClasses = new Type[_tabClassNames.Length]; 120_tabClasses[i] = Type.GetType(className, false)!; 187protected void InitializeArrays(Type[]? tabClasses, PropertyTabScope[]? tabScopes) 192private void InitializeArrays(string[]? tabClassNames, Type[]? tabClasses, PropertyTabScope[]? tabScopes) 200_tabClasses = (Type[])tabClasses.Clone();
System\ComponentModel\Design\Serialization\ContextStack.cs (1)
66public object? this[Type type]
System\ComponentModel\Design\Serialization\DefaultSerializationProviderAttribute.cs (1)
19public DefaultSerializationProviderAttribute(Type providerType)
System\ComponentModel\Design\Serialization\IDesignerSerializationManager.cs (4)
74object CreateInstance(Type type, ICollection? arguments, string? name, bool addToContainer); 92object? GetSerializer(Type? objectType, Type serializerType); 97Type? GetType(string typeName);
System\ComponentModel\Design\Serialization\IDesignerSerializationProvider.cs (2)
30object? GetSerializer(IDesignerSerializationManager manager, object? currentSerializer, Type? objectType, Type serializerType);
System\ComponentModel\Design\Serialization\INameCreationService.cs (1)
21string CreateName(IContainer? container, Type dataType);
System\ComponentModel\Design\Serialization\RootDesignerSerializerAttribute.cs (3)
20public RootDesignerSerializerAttribute(Type serializerType, Type baseSerializerType, bool reloadable) 33public RootDesignerSerializerAttribute(string serializerTypeName, Type baseSerializerType, bool reloadable)
System\ComponentModel\Design\ServiceContainer.cs (16)
16private static readonly Type[] s_defaultServices = new Type[] { typeof(IServiceContainer), typeof(ServiceContainer) }; 47protected virtual Type[] DefaultServices => s_defaultServices; 58public void AddService(Type serviceType, object serviceInstance) 66public virtual void AddService(Type serviceType, object serviceInstance, bool promote) 99public void AddService(Type serviceType, ServiceCreatorCallback callback) 107public virtual void AddService(Type serviceType, ServiceCreatorCallback callback, bool promote) 168public virtual object? GetService(Type serviceType) 174Type[] defaults = DefaultServices; 215public void RemoveService(Type serviceType) 223public virtual void RemoveService(Type serviceType, bool promote) 248private sealed class ServiceCollection<T> : Dictionary<Type, T> 252private sealed class EmbeddedTypeAwareTypeComparer : IEqualityComparer<Type> 254public bool Equals(Type? x, Type? y) => x!.IsEquivalentTo(y); 256public int GetHashCode(Type obj) => obj.FullName!.GetHashCode();
System\ComponentModel\Design\ServiceCreatorCallback.cs (1)
9public delegate object? ServiceCreatorCallback(IServiceContainer container, Type serviceType);
System\ComponentModel\DoubleConverter.cs (1)
22internal override Type TargetType => typeof(double);
System\ComponentModel\EnumConverter.cs (12)
24public EnumConverter(Type type) 34protected Type EnumType { get; } 42public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 55public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 123public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 150Type underlyingType = Enum.GetUnderlyingType(EnumType); 155MethodInfo? method = typeof(Enum).GetMethod("ToObject", new Type[] { typeof(Type), underlyingType }); 242static Type GetTypeDescriptorReflectionType(Type enumType) => TypeDescriptor.GetReflectionType(enumType); 244Type _reflectType = GetTypeDescriptorReflectionType(EnumType); 250static FieldInfo[]? GetPublicStaticEnumFields(Type type) => type.GetFields(BindingFlags.Public | BindingFlags.Static);
System\ComponentModel\EventDescriptor.cs (2)
41public abstract Type ComponentType { get; } 46public abstract Type EventType { get; }
System\ComponentModel\ExtendedPropertyDescriptor.cs (3)
22public ExtendedPropertyDescriptor(ReflectPropertyDescriptor extenderInfo, Type? receiverType, IExtenderProvider provider, Attribute[]? attributes) 73public override Type ComponentType => _extenderInfo.ComponentType; 83public override Type PropertyType => _extenderInfo.ExtenderGetType();
System\ComponentModel\ExtenderProvidedPropertyAttribute.cs (2)
19internal static ExtenderProvidedPropertyAttribute Create(PropertyDescriptor? extenderProperty, Type? receiverType, IExtenderProvider? provider) 49public Type? ReceiverType { get; private set; }
System\ComponentModel\GuidConverter.cs (4)
22public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 31public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 56public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 60ConstructorInfo? ctor = typeof(Guid).GetConstructor(new Type[] { typeof(string) });
System\ComponentModel\HalfConverter.cs (1)
23internal override Type TargetType => typeof(Half);
System\ComponentModel\IComNativeDescriptorHandler.cs (1)
22object GetEditor(object component, Type baseEditorType);
System\ComponentModel\ICustomTypeDescriptor.cs (1)
51object? GetEditor(Type editorBaseType);
System\ComponentModel\InstallerTypeAttribute.cs (3)
20public InstallerTypeAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type installerType) 36public virtual Type? InstallerType => Type.GetType(_typeName!);
System\ComponentModel\InstanceCreationEditor.cs (1)
21public abstract object? CreateInstance(ITypeDescriptorContext context, Type instanceType);
System\ComponentModel\Int128Converter.cs (1)
18internal override Type TargetType => typeof(Int128);
System\ComponentModel\Int16Converter.cs (1)
17internal override Type TargetType => typeof(short);
System\ComponentModel\Int32Converter.cs (1)
17internal override Type TargetType => typeof(int);
System\ComponentModel\Int64Converter.cs (1)
17internal override Type TargetType => typeof(long);
System\ComponentModel\LicenseContext.cs (3)
22public virtual string? GetSavedLicenseKey(Type type, Assembly? resourceAssembly) => null; 27public virtual object? GetService(Type type) => null; 32public virtual void SetSavedLicenseKey(Type type, string key)
System\ComponentModel\LicenseException.cs (5)
26public LicenseException(Type? type) : this(type, null, SR.Format(SR.LicExceptionTypeOnly, type?.FullName)) 33public LicenseException(Type? type, object? instance) : this(type, null, SR.Format(SR.LicExceptionTypeAndInstance, type?.FullName, instance?.GetType().FullName)) 40public LicenseException(Type? type, object? instance, string? message) : base(message) 51public LicenseException(Type? type, object? instance, string? message, Exception? innerException) : base(message, innerException) 70public Type? LicensedType { get; }
System\ComponentModel\LicenseManager.cs (16)
85private static void CacheProvider(Type type, LicenseProvider? provider) 104Type providerType = provider.GetType(); 120[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, 133[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, 170private static bool GetCachedNoLicenseProvider(Type type) 184private static LicenseProvider? GetCachedProvider(Type type) 194private static LicenseProvider? GetCachedProviderInstance(Type providerType) 203public static bool IsLicensed(Type type) 214public static bool IsValid(Type type) 226public static bool IsValid(Type type, object? instance, out License? license) 258private static bool ValidateInternal(Type type, object? instance, bool allowExceptions, out License? license) 274private static bool ValidateInternalRecursive(LicenseContext context, Type type, object? instance, bool allowExceptions, out License? license, out string? licenseKey) 284Type providerType = attr.LicenseProvider!; 315Type? baseType = type.BaseType; 341public static void Validate(Type type) 355public static License? Validate(Type type, object? instance)
System\ComponentModel\LicenseManager.LicenseInteropHelper.cs (10)
16private readonly Type _type; 19private CLRLicenseContext(Type type, LicenseUsageMode mode) 25public static CLRLicenseContext CreateDesignContext(Type type) 30public static CLRLicenseContext CreateRuntimeContext(Type type, string? key) 43public override string? GetSavedLicenseKey(Type type, Assembly? resourceAssembly) 53public override void SetSavedLicenseKey(Type type, string? key) 71public override string? GetSavedLicenseKey(Type type, Assembly? resourceAssembly) => null; 73public override void SetSavedLicenseKey(Type type, string key) 87Type type, 105public static LicenseContext GetCurrentContextInfo(Type type, out bool isDesignTime, out string? key)
System\ComponentModel\LicenseProvider.cs (1)
15public abstract License? GetLicense(LicenseContext context, Type type, object? instance, bool allowExceptions);
System\ComponentModel\LicenseProviderAttribute.cs (5)
21private Type? _licenseProviderType; 46public LicenseProviderAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type type) 55public Type? LicenseProvider 61_licenseProviderType = Type.GetType(_licenseProviderName); 92Type? type = ((LicenseProviderAttribute)value).LicenseProvider;
System\ComponentModel\LicFileLicenseProvider.cs (3)
22protected virtual bool IsKeyValid(string? key, Type type) 35protected virtual string GetKey(Type type) 48public override License? GetLicense(LicenseContext context, Type type, object? instance, bool allowExceptions)
System\ComponentModel\MarshalByValueComponent.cs (1)
147public virtual object? GetService(Type service) => _site?.GetService(service);
System\ComponentModel\MemberDescriptor.cs (8)
385[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type componentClass, 387Type[] args, 388Type returnType) 397[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type componentClass, 399Type[] args, 400Type returnType, 433protected virtual object? GetInvocationTarget(Type type, object instance) 447protected static object GetInvokee(Type componentClass, object component)
System\ComponentModel\MultilineStringConverter.cs (1)
17public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\ComponentModel\NestedContainer.cs (2)
83protected override object? GetService(Type service) 121public object? GetService(Type service)
System\ComponentModel\NullableConverter.cs (6)
24public NullableConverter(Type type) 41public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 79public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 100public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 267public Type NullableType { get; } 272public Type UnderlyingType { get; }
System\ComponentModel\PropertyDescriptor.cs (20)
23private Type[]? _editorTypes; 61public abstract Type ComponentType { get; } 80Type? converterType = GetTypeFromName(attr.ConverterTypeName); 123Type? converterType = GetTypeFromName(attr.ConverterTypeName); 163public abstract Type PropertyType { get; } 226[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type) 228Type[] typeArgs = new Type[] { typeof(Type) }; 284public virtual object? GetEditor(Type editorBaseType) 314Type? editorType = GetTypeFromName(attr.EditorBaseTypeName); 318Type? type = GetTypeFromName(attr.EditorTypeName); 334_editorTypes = new Type[5]; 340Type[] newTypes = new Type[_editorTypes.Length * 2]; 367protected override object? GetInvocationTarget(Type type, object instance) 383protected Type? GetTypeFromName( 392Type? typeFromGetType = Type.GetType(typeName); 397Type? typeFromComponent = null;
System\ComponentModel\ProvidePropertyAttribute.cs (1)
19[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type receiverType)
System\ComponentModel\ReferenceConverter.cs (4)
19private readonly Type _type; 24public ReferenceConverter(Type type) 33public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 84public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\ComponentModel\ReflectEventDescriptor.cs (14)
62private Type? _type; // the delegate type for the event 64private readonly Type _componentClass; // the class of the component this info is for 75[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, 77Type type, 95[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, 107internal static ReflectEventDescriptor CreateWithRegisteredType(Type componentClass, EventInfo eventInfo) => new ReflectEventDescriptor(componentClass, eventInfo); 114[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, 133public override Type ComponentType => _componentClass; 138public override Type EventType 261Type currentReflectType = realEventInfo.ReflectedType!; 328Type? start = _componentClass.BaseType; 363Type[] argsType = new Type[] { _type! }; 382Type? currentReflectType = realMethodInfo.ReflectedType;
System\ComponentModel\ReflectionCachesUpdateHandler.cs (2)
14public static void ClearCache(Type[]? types) 24foreach (Type type in types)
System\ComponentModel\ReflectPropertyDescriptor.cs (32)
65private readonly Type _componentClass; // used to determine if we should all on us or on the designer 66private readonly Type _type; // the data type of the property 76private readonly Type? _receiverType; // Only set if we are an extender 82Type componentClass, 84Type type, 117Type componentClass, 119Type type, 140[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, 142Type type, 143Type receiverType, 161[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, 286public override Type ComponentType => _componentClass; 335_propInfo = _componentClass.GetProperty(Name, bindingFlags, binder: null, PropertyType, Type.EmptyTypes, Array.Empty<ParameterModifier>()); 348_getMethod = FindMethod(_componentClass, "Get" + Name, new Type[] { _receiverType }, _type); 373public override Type PropertyType => _type; 386Type[] args; 390args = Type.EmptyTypes; 394args = new Type[] { _receiverType }; 424for (Type? t = _componentClass.BaseType; t != null && t != typeof(object); t = t.BaseType) 427PropertyInfo? p = t.GetProperty(name, bindingFlags, binder: null, PropertyType, Type.EmptyTypes, null); 448_propInfo = _componentClass.GetProperty(Name, bindingFlags, binder: null, PropertyType, Type.EmptyTypes, Array.Empty<ParameterModifier>()); 458new Type[] { _receiverType, _type }, typeof(void)); 478Type[] args; 482args = Type.EmptyTypes; 486args = new Type[] { _receiverType }; 552internal Type? ExtenderGetReceiverType() => _receiverType; 554internal Type ExtenderGetType() => PropertyType; 788Type? currentReflectType = _componentClass; 814memberInfo = currentReflectType.GetMethod("Get" + Name, bindingFlags, binder: null, new Type[] { _receiverType! }, modifiers: null); 818memberInfo = currentReflectType.GetProperty(Name, bindingFlags, binder: null, PropertyType, Type.EmptyTypes, Array.Empty<ParameterModifier>()); 840Type? specificType = Type.GetType(sta.TypeName!);
System\ComponentModel\ReflectTypeDescriptionProvider.cs (77)
27private readonly ConcurrentDictionary<Type, ReflectedTypeData> _typeData = new ConcurrentDictionary<Type, ReflectedTypeData>(); 33private static readonly Type[] s_typeConstructor = { typeof(Type) }; 64private static readonly Type[] s_skipInterfaceAttributeList = InitializeSkipInterfaceAttributeList(); 74private static Type[] InitializeSkipInterfaceAttributeList() 76return new Type[] 101private readonly Func<Type, TypeConverter> _constructionFunc; 117public IntrinsicTypeConverterData(Func<Type, TypeConverter> constructionFunc, bool cacheConverterInstance = true) 123public TypeConverter GetOrCreateConverterInstance(Type innerType) 143/// appropriate logic to handle this in <see cref="GetIntrinsicTypeConverter(Type)"/> below. 194private static NullableConverter CreateNullableConverter(Type type) => new NullableConverter(type); 221internal static void AddEditorTable(Type editorBaseType, Hashtable table) 242[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, 243Type[]? argTypes, 258argTypes = new Type[args.Length]; 273argTypes = Type.EmptyTypes; 283public override bool IsRegisteredType(Type type) 300[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, 301Type callingType) 310internal AttributeCollection GetAttributes([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 343internal string? GetClassName([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 352internal string? GetClassNameFromRegisteredType(Type type) 371internal TypeConverter GetConverter([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object? instance) 377internal TypeConverter GetConverterFromRegisteredType(Type type, object? instance) 388internal EventDescriptor? GetDefaultEvent([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object? instance) 398internal PropertyDescriptor? GetDefaultProperty([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object? instance) 408internal object? GetEditor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object? instance, Type editorBaseType) 418private static Hashtable? GetEditorTable(Type editorBaseType) 464internal EventDescriptorCollection GetEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 470internal EventDescriptorCollection GetEventsFromRegisteredType(Type type) 534internal object? GetExtendedEditor(object instance, Type editorBaseType) 563Type componentType = instance.GetType(); 615Type? receiverType = eppa.ReceiverType; 829public override ICustomTypeDescriptor? GetTypeDescriptorFromRegisteredType(Type objectType, object? instance) 861internal Type[] GetPopulatedTypes(Module module) 863List<Type> typeList = new List<Type>(); 865foreach (KeyValuePair<Type, ReflectedTypeData> kvp in _typeData) 880internal PropertyDescriptorCollection GetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 889internal PropertyDescriptorCollection GetPropertiesFromRegisteredType(Type type) 898internal static object GetPropertyOwner(Type type, object instance) 908public override Type GetReflectionType( 909[DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)] Type objectType, 921private ReflectedTypeData? GetTypeData([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, bool createIfNeeded) 959private ReflectedTypeData GetTypeDataFromRegisteredType(Type type) 983Type componentType = typeof(T); 1002private ReflectedTypeData GetOrRegisterType(Type type) 1034public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object? instance) 1046private static Type? GetTypeFromName( 1050Type? t = Type.GetType(typeName); 1067t = Type.GetType(typeName.Substring(0, commaIndex)); 1080internal bool IsPopulated(Type type) 1097internal static Attribute[] ReflectGetAttributes(Type type) 1153private static EventDescriptor[] ReflectGetEvents(Type type) 1254Type providerType = provider.GetType(); 1277Type? receiverType = GetTypeFromName(provideAttr.ReceiverTypeName); 1281MethodInfo? getMethod = providerType.GetMethod("Get" + provideAttr.PropertyName, new Type[] { receiverType }); 1285MethodInfo? setMethod = providerType.GetMethod("Set" + provideAttr.PropertyName, new Type[] { receiverType, getMethod.ReturnType }); 1330[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) => 1333private static PropertyDescriptor[] ReflectGetPropertiesFromRegisteredType(Type type) 1338private static PropertyDescriptor[] ReflectGetPropertiesImpl(Type type) 1422internal void Refresh(Type type) 1438private static object? GetIntrinsicTypeEditor(Hashtable table, Type callingType) 1449Type? baseType = callingType; 1460hashEntry = Type.GetType(typeString); 1485Type? keyType = de.Key as Type; 1494hashEntry = Type.GetType(typeString); 1536Type? type = hashEntry as Type; 1556private static TypeConverter GetIntrinsicTypeConverter(Type callingType) 1594Type? key = null; 1596Type? baseType = callingType.BaseType; 1622private static bool IsIntrinsicType(Type callingType)
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (24)
20private readonly Type _type; 26private Type[]? _editorTypes; 30internal ReflectedTypeData(Type type, bool isRegisteredType) 90Type? baseType = _type.BaseType; 101Type[] interfaces = TrimSafeReflectionHelper.GetInterfaces(_type); 105Type iface = interfaces[idx]; 199Type? converterType = GetTypeFromName(instanceAttr.ConverterTypeName); 219Type? converterType = GetTypeFromName(typeAttr.ConverterTypeName); 315internal object? GetEditor(object? instance, Type editorBaseType) 330Type? editorType = GetTypeFromName(instanceAttr!.EditorTypeName); 356Type? editorType = GetTypeFromName(typeAttr.EditorTypeName); 389Type[] newTypes = new Type[newLength]; 414private static EditorAttribute? GetEditorAttribute(AttributeCollection attributes, Type editorBaseType) 420Type? attrEditorBaseType = Type.GetType(edAttr.EditorBaseTypeName!); 445Type? baseType = _type; 446Type objType = typeof(object); 480Type? baseType = _type; 481Type objType = typeof(object); 515private Type? GetTypeFromName( 526Type? t = null; 533t ??= Type.GetType(typeName); 545t = Type.GetType(typeName.Substring(0, commaIndex));
System\ComponentModel\RefreshEventArgs.cs (2)
25public RefreshEventArgs(Type? typeChanged) 38public Type? TypeChanged { get; }
System\ComponentModel\RefreshEventHandler.cs (1)
8/// raised when a <see cref='System.Type'/> or component is changed during design time.
System\ComponentModel\SByteConverter.cs (1)
17internal override Type TargetType => typeof(sbyte);
System\ComponentModel\SingleConverter.cs (1)
22internal override Type TargetType => typeof(float);
System\ComponentModel\StringConverter.cs (1)
18public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
System\ComponentModel\TimeOnlyConverter.cs (5)
20public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 26public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 77public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 95return new InstanceDescriptor(typeof(TimeOnly).GetConstructor(new Type[] { typeof(long) }), new object[] { time.Ticks }); 98return new InstanceDescriptor(typeof(TimeOnly).GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(int), typeof(int) }),
System\ComponentModel\TimeSpanConverter.cs (4)
22public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 31public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 65public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 70typeof(TimeSpan).GetMethod(nameof(TimeSpan.Parse), new Type[] { typeof(string) }),
System\ComponentModel\ToolboxItemAttribute.cs (4)
16private Type? _toolboxItemType; 67public ToolboxItemAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type toolboxItemType) 79public Type? ToolboxItemType 89_toolboxItemType = Type.GetType(_toolboxItemTypeName, true);
System\ComponentModel\TrimSafeReflectionHelper.cs (5)
13public static PropertyInfo[] GetProperties(Type type, BindingFlags bindingAttr) => type.GetProperties(bindingAttr); 14public static PropertyInfo? GetProperty(Type type, string name, BindingFlags bindingAttr) => type.GetProperty(name, bindingAttr); 15public static EventInfo[] GetEvents(Type type, BindingFlags bindingAttr) => type.GetEvents(bindingAttr); 16public static Type[] GetInterfaces(Type type) => type.GetInterfaces();
System\ComponentModel\TypeConverter.cs (13)
22public bool CanConvertFrom(Type sourceType) => CanConvertFrom(null, sourceType); 28public virtual bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 35public bool CanConvertTo([NotNullWhen(true)] Type? destinationType) => CanConvertTo(null, destinationType); 41public virtual bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 104public object? ConvertTo(object? value, Type destinationType) 113public virtual object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 202protected Exception GetConvertToException(object? value, Type destinationType) 349protected SimplePropertyDescriptor(Type componentType, string name, Type propertyType) : this(componentType, name, propertyType, Array.Empty<Attribute>()) 356protected SimplePropertyDescriptor(Type componentType, string name, Type propertyType, Attribute[]? attributes) : base(name, attributes) 365public override Type ComponentType { get; } 380public override Type PropertyType { get; }
System\ComponentModel\TypeDescriptionProvider.cs (15)
66[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, 67Type[]? argTypes, 180public Type GetReflectionType([DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)] Type objectType) => GetReflectionType(objectType, null); 192public Type GetReflectionType(object instance) 209public virtual Type GetReflectionType( 210[DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)] Type objectType, 227public virtual Type GetRuntimeType(Type reflectionType) 252public ICustomTypeDescriptor? GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType) 287public virtual ICustomTypeDescriptor? GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object? instance) 305public ICustomTypeDescriptor? GetTypeDescriptorFromRegisteredType(Type objectType) 356public virtual ICustomTypeDescriptor? GetTypeDescriptorFromRegisteredType(Type objectType, object? instance) 394public virtual bool IsRegisteredType(Type type) 410public virtual bool IsSupportedType(Type type)
System\ComponentModel\TypeDescriptionProviderService.cs (1)
9public abstract TypeDescriptionProvider GetProvider(Type type);
System\ComponentModel\TypeDescriptor.cs (102)
60private static readonly ConcurrentDictionary<Type, TypeDescriptionNode> s_providerTypeTable = new ConcurrentDictionary<Type, TypeDescriptionNode>(); 65private static readonly ConcurrentDictionary<Type, object?> s_defaultProviderInitialized = new ConcurrentDictionary<Type, object?>(); 136public static Type InterfaceType 170internal static void ValidateRegisteredType(Type type) 190public static TypeDescriptionProvider AddAttributes(Type type, params Attribute[] attributes) 231public static void AddEditorTable(Type editorBaseType, Hashtable table) 246public static void AddProvider(TypeDescriptionProvider provider, Type type) 306public static void AddProviderTransparent(TypeDescriptionProvider provider, Type type) 335private static void CheckDefaultProvider(Type type) 352private static void AddDefaultProvider(Type type) 374Type? providerType = Type.GetType(pa.TypeName); 386Type? baseType = type.BaseType; 452[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, 454Type type, 465[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, 479[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, 480Type[]? argTypes, 512[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, 514Type type, 526[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, 607public static object GetAssociation(Type type, object primary) 677public static AttributeCollection GetAttributes([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType) 809[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType) 864public static TypeConverter GetConverter([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 871internal static TypeConverter GetConverterTrimUnsafe([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) => 877public static TypeConverter GetConverterFromRegisteredType(Type type) 884private static object? ConvertFromInvariantString([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string stringValue) 894[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType) 932[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType) 970[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 984private static DefaultTypeDescriptor GetDescriptorFromRegisteredType(Type type, 1057public static object? GetEditor(object component, Type editorBaseType) 1068public static object? GetEditor(object component, Type editorBaseType, bool noCustomTypeDesc) 1080[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 1081Type editorBaseType) 1092[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType) 1106public static EventDescriptorCollection GetEventsFromRegisteredType(Type componentType) 1118[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, 1311private static Type? GetNodeForBaseType(Type searchType) 1329[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType) 1343public static PropertyDescriptorCollection GetPropertiesFromRegisteredType(Type componentType) 1355[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, 1526public static TypeDescriptionProvider GetProvider(Type type) 1594internal static TypeDescriptionProvider GetProviderRecursive(Type type) 1604public static Type GetReflectionType([DynamicallyAccessedMembers(ReflectTypesDynamicallyAccessedMembers)] Type type) 1616public static Type GetReflectionType(object instance) 1630private static TypeDescriptionNode NodeFor(Type type) => NodeFor(type, false); 1647private static TypeDescriptionNode NodeFor(Type type, bool createDelegator) 1659Type searchType = type; 1670Type? baseType = GetNodeForBaseType(searchType); 1742Type type = instance.GetType(); 1853Type keyType = key as Type ?? key.GetType(); 2291private static void RaiseRefresh(Type type) 2320Type type = component.GetType(); 2333Type? nodeType = de.Key as Type; 2391public static void Refresh(Type type) 2417Type? nodeType = de.Key as Type; 2478Type? nodeType = de.Key as Type; 2492Type[] populatedTypes = provider.GetPopulatedTypes(module); 2494foreach (Type populatedType in populatedTypes) 2508foreach (Type t in refreshedTypes.Keys) 2534public static Type ComObjectType 2542public static IDesigner? CreateDesigner(IComponent component, Type designerBaseType) 2544Type? type = null; 2551Type? type2 = Type.GetType(designerAttribute.DesignerBaseTypeName); 2564type = Type.GetType(designerAttribute.DesignerTypeName); 2662public static void RemoveProvider(TypeDescriptionProvider provider, Type type) 2697public static void RemoveProviderTransparent(TypeDescriptionProvider provider, Type type) 2778public override ICustomTypeDescriptor? GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object? instance) 2837object ICustomTypeDescriptor.GetEditor(Type editorBaseType) 2889public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object? instance) 3056Type realComNativeDescriptor = Type.GetType("System.Windows.Forms.ComponentModel.Com2Interop.ComNativeDescriptor, System.Windows.Forms", throwOnError: true)!; 3061public override ICustomTypeDescriptor? GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object? instance) 3151object? ICustomTypeDescriptor.GetEditor(Type editorBaseType) 3246[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, 3247Type[]? argTypes, 3297Type type = instance.GetType(); 3335public override Type GetReflectionType( 3336[DynamicallyAccessedMembers(ReflectTypesDynamicallyAccessedMembers)] Type objectType, 3344public override Type GetRuntimeType(Type objectType) 3355public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object? instance) 3371public override ICustomTypeDescriptor GetTypeDescriptorFromRegisteredType(Type objectType, object? instance) 3392internal DefaultTypeDescriptor GetDefaultTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType) 3397public override bool IsSupportedType(Type type) 3406public override bool IsRegisteredType(Type type) => Provider.IsRegisteredType(type); 3585object? ICustomTypeDescriptor.GetEditor(Type editorBaseType) 3775private readonly Type _objectType; 3783[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, 3979public object? GetEditor(Type editorBaseType) 4212internal static void ThrowInvalidOperationException_RegisterTypeRequired(Type type) =>
System\ComponentModel\TypeListConverter.cs (7)
15private readonly Type[] _types; 22protected TypeListConverter(Type[] types) 32public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 41public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 53foreach (Type t in _types) 68public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 80return ((Type)value).FullName;
System\ComponentModel\UInt128Converter.cs (1)
18internal override Type TargetType => typeof(UInt128);
System\ComponentModel\UInt16Converter.cs (1)
17internal override Type TargetType => typeof(ushort);
System\ComponentModel\UInt32Converter.cs (1)
17internal override Type TargetType => typeof(uint);
System\ComponentModel\UInt64Converter.cs (1)
17internal override Type TargetType => typeof(ulong);
System\ComponentModel\UriTypeConverter.cs (4)
23public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 32public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 65public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 73ConstructorInfo? ctor = typeof(Uri).GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(string), typeof(UriKind) }, null);
System\ComponentModel\VersionConverter.cs (4)
22public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 31public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 66public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 74ConstructorInfo? ctor = typeof(Version).GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(int), typeof(int), typeof(int), typeof(int) }, null);
System\Drawing\ColorConverter.cs (6)
28public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 33public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 48public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 111member = typeof(Color).GetMethod("FromArgb", new Type[] { typeof(int), typeof(int), typeof(int), typeof(int) }); 116member = typeof(Color).GetMethod("FromName", new Type[] { typeof(string) }); 121member = typeof(Color).GetMethod("FromArgb", new Type[] { typeof(int), typeof(int), typeof(int) });
System\Drawing\PointConverter.cs (4)
15public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 20public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 61public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 84ConstructorInfo? ctor = typeof(Point).GetConstructor(new Type[] { typeof(int), typeof(int) });
System\Drawing\RectangleConverter.cs (4)
15public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 20public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 59public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 84ConstructorInfo? ctor = typeof(Rectangle).GetConstructor(new Type[] {
System\Drawing\SizeConverter.cs (4)
15public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 20public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 59public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 82ConstructorInfo? ctor = typeof(Size).GetConstructor(new Type[] { typeof(int), typeof(int) });
System\Drawing\SizeFConverter.cs (4)
15public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 20public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 58public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 79ConstructorInfo? ctor = typeof(SizeF).GetConstructor(new Type[] { typeof(float), typeof(float) });
System\Security\Authentication\ExtendedProtection\ExtendedProtectionPolicyTypeConverter.cs (5)
16public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 22public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 30Type[] parameterTypes; 35parameterTypes = new Type[] { typeof(PolicyEnforcement) }; 40parameterTypes = new Type[] { typeof(PolicyEnforcement), typeof(ProtectionScenario), typeof(ICollection) };
System.Composition.AttributedModel (8)
System\Composition\Convention\AttributedModelProvider.cs (2)
20public abstract IEnumerable<Attribute> GetCustomAttributes(System.Type reflectedType, MemberInfo member); 27public abstract IEnumerable<Attribute> GetCustomAttributes(System.Type reflectedType, ParameterInfo parameter);
System\Composition\ExportAttribute.cs (6)
29/// A <see cref="Type"/> of which to derive the contract name to export the type or 33public ExportAttribute(Type contractType) : this(null, contractType) 60/// A <see cref="Type"/> of which to derive the contract name to export the type or 64public ExportAttribute(string contractName, Type contractType) 83/// A <see cref="Type"/> of the export that is be provided. The default value is 87public Type ContractType { get; }
System.Composition.Convention (69)
src\libraries\Common\src\System\Composition\Diagnostics\CompositionTrace.cs (8)
10public static void Registration_ConstructorConventionOverridden(Type type) 23public static void Registration_TypeExportConventionOverridden(Type type) 36public static void Registration_MemberExportConventionOverridden(Type type, MemberInfo member) 55public static void Registration_MemberImportConventionOverridden(Type type, MemberInfo member) 74public static void Registration_OnSatisfiedImportNotificationOverridden(Type type, MemberInfo member) 93public static void Registration_PartCreationConventionOverridden(Type type) 108public static void Registration_MemberImportConventionMatchedTwice(Type type, MemberInfo member) 127public static void Registration_PartMetadataConventionOverridden(Type type)
System\Composition\Convention\ConventionBuilder.cs (12)
48public PartConventionBuilder ForTypesDerivedFrom(Type type) 77public PartConventionBuilder ForType(Type type) 96public PartConventionBuilder<T> ForTypesMatching<T>(Predicate<Type> typeFilter) 114public PartConventionBuilder ForTypesMatching(Predicate<Type> typeFilter) 132Type type = typeInfo.AsType(); 159public override IEnumerable<Attribute> GetCustomAttributes(Type reflectedType, System.Reflection.MemberInfo member) 247private List<Attribute> ReadMemberCustomAttributes(Type reflectedType, System.Reflection.MemberInfo member) 299public override IEnumerable<Attribute> GetCustomAttributes(Type reflectedType, System.Reflection.ParameterInfo parameter) 311private List<Attribute> ReadParameterCustomAttributes(Type reflectedType, System.Reflection.ParameterInfo parameter) 365foreach (Type iface in derivedType.ImplementedInterfaces) 375private static bool IsDescendentOf(Type type, Type baseType)
System\Composition\Convention\ExportConventionBuilder.cs (9)
19private Type _contractType; 21private List<Tuple<string, Func<Type, object>>> _metadataItemFuncs; 22private Func<Type, string> _getContractNameFromPartType; 41public ExportConventionBuilder AsContractType(Type type) 77public ExportConventionBuilder AsContractName(Func<Type, string> getContractNameFromPartType) 117public ExportConventionBuilder AddMetadata(string name, Func<Type, object> getValueFromPartType) 133_metadataItemFuncs ??= new List<Tuple<string, Func<Type, object>>>(); 138internal void BuildAttributes(Type type, ref List<Attribute> attributes) 157foreach (Tuple<string, Func<Type, object>> item in _metadataItemFuncs)
System\Composition\Convention\ImportConventionBuilder.cs (8)
15private static readonly Type[] s_supportedImportManyTypes = new[] { typeof(IList<>), typeof(ICollection<>), typeof(IEnumerable<>) }; 20private Func<Type, string> _getContractNameFromPartType; 22private List<Tuple<string, Func<Type, object>>> _metadataConstraintItemFuncs; 51public ImportConventionBuilder AsContractName(Func<Type, string> getContractNameFromPartType) 122public ImportConventionBuilder AddMetadataConstraint(string name, Func<Type, object> getConstraintValueFromPartType) 138_metadataConstraintItemFuncs ??= new List<Tuple<string, Func<Type, object>>>(); 143internal void BuildAttributes(Type type, ref List<Attribute> attributes) 178foreach (Tuple<string, Func<Type, object>> item in _metadataConstraintItemFuncs)
System\Composition\Convention\PartConventionBuilder.cs (31)
16private readonly Type[] _emptyTypeArray = Type.EmptyTypes; 19private static readonly Type s_exportAttributeType = typeof(ExportAttribute); 26private List<Tuple<string, Func<Type, object>>> _metadataItemFuncs; 33private readonly List<Tuple<Predicate<PropertyInfo>, Action<PropertyInfo, ExportConventionBuilder>, Type>> _propertyExports; 35private readonly List<Tuple<Predicate<Type>, Action<Type, ExportConventionBuilder>>> _interfaceExports; 38internal Predicate<Type> SelectType { get; } 40internal PartConventionBuilder(Predicate<Type> selectType) 44_propertyExports = new List<Tuple<Predicate<PropertyInfo>, Action<PropertyInfo, ExportConventionBuilder>, Type>>(); 46_interfaceExports = new List<Tuple<Predicate<Type>, Action<Type, ExportConventionBuilder>>>(); 148public PartConventionBuilder ExportInterfaces(Predicate<Type> interfaceFilter) 173public PartConventionBuilder ExportInterfaces(Predicate<Type> interfaceFilter, 174Action<Type, ExportConventionBuilder> exportConfiguration) 188private PartConventionBuilder ExportInterfacesImpl(Predicate<Type> interfaceFilter, 189Action<Type, ExportConventionBuilder> exportConfiguration) 234_propertyExports.Add(Tuple.Create(propertyFilter, exportConfiguration, default(Type))); 447public PartConventionBuilder AddPartMetadata(string name, Func<Type, object> getValueFromPartType) 463_metadataItemFuncs ??= new List<Tuple<string, Func<Type, object>>>(); 478Type attrType = attr.GetType(); 489internal IEnumerable<Attribute> BuildTypeAttributes(Type type) 553foreach (Tuple<string, Func<Type, object>> item in _metadataItemFuncs) 573foreach (Type iface in type.GetTypeInfo().ImplementedInterfaces) 581foreach (Tuple<Predicate<Type>, Action<Type, ExportConventionBuilder>> exportSpecification in _interfaceExports) 598internal bool BuildConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers) 636internal static void BuildDefaultConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers) 677internal void BuildOnImportsSatisfiedNotification(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers) 731internal void BuildPropertyAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers) 782foreach (Tuple<Predicate<PropertyInfo>, Action<PropertyInfo, ExportConventionBuilder>, Type> exportSpecification in _propertyExports)
System\Composition\Convention\PartConventionBuilderOfT.cs (1)
209internal PartConventionBuilder(Predicate<Type> selectType) : base(selectType)
System.Composition.Hosting (4)
System\Composition\Hosting\Providers\ImportMany\ImportManyExportDescriptorProvider.cs (2)
15private static readonly Type[] s_supportedContractTypes = new[] { typeof(IList<>), typeof(ICollection<>), typeof(IEnumerable<>) }; 28var elementType = contract.ContractType.IsArray ?
System\Composition\Hosting\Util\Formatters.cs (2)
22public static string Format(Type type) 36private static string FormatClosedGeneric(Type closedGenericType)
System.Composition.Runtime (14)
System\Composition\CompositionContext.cs (6)
60public bool TryGetExport(Type exportType, out object export) 74public bool TryGetExport(Type exportType, string contractName, out object export) 124public object GetExport(Type exportType) 137public object GetExport(Type exportType, string contractName) 163public IEnumerable<object> GetExports(Type exportType) 176public IEnumerable<object> GetExports(Type exportType, string contractName)
System\Composition\Hosting\Core\CompositionContract.cs (6)
16private readonly Type _contractType; 24public CompositionContract(Type contractType) 34public CompositionContract(Type contractType, string contractName) 45public CompositionContract(Type contractType, string contractName, IDictionary<string, object> metadataConstraints) 58public Type ContractType => _contractType; 125public CompositionContract ChangeType(Type newContractType)
System\Composition\Runtime\Util\Formatters.cs (2)
17public static string Format(Type type) => 22private static string FormatClosedGeneric(Type closedGenericType)
System.Composition.TypedParts (55)
System\Composition\CompositionContextExtensions.cs (1)
60var objType = objectWithLooseImports.GetType();
System\Composition\Convention\AttributedModelProviderExtensions.cs (6)
14public static TAttribute GetDeclaredAttribute<TAttribute>(this AttributedModelProvider convention, Type reflectedType, MemberInfo member) where TAttribute : Attribute 19public static Attribute[] GetDeclaredAttributes(this AttributedModelProvider convention, Type reflectedType, MemberInfo member) 24public static TAttribute[] GetDeclaredAttributes<TAttribute>(this AttributedModelProvider convention, Type reflectedType, MemberInfo member) where TAttribute : Attribute 29public static TAttribute GetDeclaredAttribute<TAttribute>(this AttributedModelProvider convention, Type reflectedType, ParameterInfo parameter) where TAttribute : Attribute 34public static Attribute[] GetDeclaredAttributes(this AttributedModelProvider convention, Type reflectedType, ParameterInfo parameter) 39public static TAttribute[] GetDeclaredAttributes<TAttribute>(this AttributedModelProvider convention, Type reflectedType, ParameterInfo parameter) where TAttribute : Attribute
System\Composition\Debugging\ContainerConfigurationDebuggerProxy.cs (4)
19private Type[] _ignoredTypes; 43public Type[] IgnoredTypes 60var ignored = new List<Type>(); 68foreach (var type in typeSet.Item1)
System\Composition\Debugging\DiscoveredPartDebuggerProxy.cs (1)
20public Type PartType
System\Composition\Hosting\ContainerConfiguration.cs (11)
24private readonly List<Tuple<IEnumerable<Type>, AttributedModelProvider>> _types = new List<Tuple<IEnumerable<Type>, AttributedModelProvider>>(); 88public ContainerConfiguration WithPart(Type partType) 100public ContainerConfiguration WithPart(Type partType, AttributedModelProvider conventions) 135public ContainerConfiguration WithParts(params Type[] partTypes) 137return WithParts((IEnumerable<Type>)partTypes); 146public ContainerConfiguration WithParts(IEnumerable<Type> partTypes) 158public ContainerConfiguration WithParts(IEnumerable<Type> partTypes, AttributedModelProvider conventions) 260public ContainerConfiguration WithExport(Type contractType, object exportedInstance) 282public ContainerConfiguration WithExport(Type contractType, object exportedInstance, string contractName = null, IDictionary<string, object> metadata = null) 301internal Tuple<IEnumerable<Type>, AttributedModelProvider>[] DebugGetRegisteredTypes()
System\Composition\Hosting\InstanceExportDescriptorProvider.cs (1)
13public InstanceExportDescriptorProvider(object exportedInstance, Type contractType, string contractName, IDictionary<string, object> metadata)
System\Composition\Hosting\SinglePartExportDescriptorProvider.cs (2)
12private readonly Type _contractType; 15protected SinglePartExportDescriptorProvider(Type contractType, string contractName, IDictionary<string, object> metadata)
System\Composition\TypedParts\ActivationFeatures\OnImportsSatisfiedFeature.cs (1)
40var partTypeAsType = partType.AsType();
System\Composition\TypedParts\ActivationFeatures\PropertyInjectionFeature.cs (1)
29var partTypeAsType = partType.AsType();
System\Composition\TypedParts\ContractHelpers.cs (3)
17public static bool TryGetExplicitImportInfo(Type memberType, object[] attributes, object site, out ImportInfo importInfo) 29public static ImportInfo GetImportInfo(Type memberType, object[] attributes, object site) 66var attrType = attr.GetType();
System\Composition\TypedParts\Discovery\DiscoveredExport.cs (1)
48public abstract DiscoveredExport CloseGenericExport(TypeInfo closedPartType, Type[] genericArguments);
System\Composition\TypedParts\Discovery\DiscoveredInstanceExport.cs (2)
22public override DiscoveredExport CloseGenericExport(TypeInfo closedPartType, Type[] genericArguments) 24var closedContractType = Contract.ContractType.MakeGenericType(genericArguments);
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (6)
30private readonly List<Type[]> _appliedArguments = new List<Type[]>(); 83var partTypeAsType = _partType.AsType(); 138Type genericPartType = type.GetGenericTypeDefinition(); 222public bool TryCloseGenericPart(Type[] typeArguments, out DiscoveredPart closed) 226foreach (var genericParameterConstraints in _partType.GenericTypeParameters[index].GetTypeInfo().GetGenericParameterConstraints())
System\Composition\TypedParts\Discovery\DiscoveredPropertyExport.cs (2)
36public override DiscoveredExport CloseGenericExport(TypeInfo closedPartType, Type[] genericArguments) 38var closedContractType = Contract.ContractType.MakeGenericType(genericArguments);
System\Composition\TypedParts\Discovery\TypeInspector.cs (8)
54var partTypeAsType = partType.AsType(); 63var contractType = export.ContractType ?? partTypeAsType; 77var partTypeAsType = partType.AsType(); 89var contractType = export.ContractType ?? property.PropertyType; 112var valueType = ema.Value?.GetType() ?? typeof(object); 122private static void AddMetadata(IDictionary<string, object> metadata, string name, Type valueType, object value) 150var attrType = attribute.GetType(); 213foreach (var ifce in exportingMemberType.ImplementedInterfaces)
System\Composition\TypedParts\TypedPartExportDescriptorProvider.cs (3)
18public TypedPartExportDescriptorProvider(IEnumerable<Type> types, AttributedModelProvider attributeContext) 23foreach (var type in types) 109var gtd = contract.ContractType.GetGenericTypeDefinition();
System\Composition\TypedParts\Util\DirectAttributeContext.cs (2)
12public override IEnumerable<Attribute> GetCustomAttributes(Type reflectedType, Reflection.MemberInfo member) 23public override IEnumerable<Attribute> GetCustomAttributes(Type reflectedType, Reflection.ParameterInfo parameter)
System.Configuration.ConfigurationManager (132)
System\Configuration\ApplicationSettingsBase.cs (5)
470Type providerType = Type.GetType(providerTypeName); 547Type type = GetType(); 616Type providerType = Type.GetType(providerTypeName);
System\Configuration\AppSettingsReader.cs (2)
16private static readonly Type s_stringType = typeof(string); 31public object GetValue(string key, Type type)
System\Configuration\CallbackValidator.cs (3)
9private readonly Type _type; 11public CallbackValidator(Type type, ValidatorCallback callback) : this(callback) 29public override bool CanValidate(Type type)
System\Configuration\CallbackValidatorAttribute.cs (2)
13private Type _type; 45public Type Type
System\Configuration\ClientConfigPaths.cs (1)
292Type mainType = null;
System\Configuration\CommaDelimitedStringAttributeCollectionConverter.cs (1)
11public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type)
System\Configuration\Configuration.cs (2)
20private readonly Type _typeConfigHost; 28internal Configuration(string locationSubPath, Type typeConfigHost, params object[] hostInitConfigurationParams)
System\Configuration\ConfigurationCollectionAttribute.cs (2)
17public ConfigurationCollectionAttribute(Type itemType) 24public Type ItemType { get; }
System\Configuration\ConfigurationConverterBase.cs (3)
10public override bool CanConvertTo(ITypeDescriptorContext ctx, Type type) 15public override bool CanConvertFrom(ITypeDescriptorContext ctx, Type type) 20internal static void ValidateType(object value, Type expected)
System\Configuration\ConfigurationElement.cs (6)
43private static volatile Dictionary<Type, ConfigurationValidatorBase> s_perTypeValidators; 229internal static ConfigurationElement CreateElement(Type type) 709private static bool PropertiesFromType(Type type, out ConfigurationPropertyCollection result) 730private static ConfigurationPropertyCollection CreatePropertyBagFromType(Type type) 783private static void CachePerTypeValidator(Type type, ConfigurationValidatorBase validator) 793s_perTypeValidators ??= new Dictionary<Type, ConfigurationValidatorBase>();
System\Configuration\ConfigurationErrorsException.cs (2)
130Type currentExceptionType = Type.GetType(currentType, true);
System\Configuration\ConfigurationProperty.cs (8)
20public ConfigurationProperty(string name, Type type) 38public ConfigurationProperty(string name, Type type, object defaultValue) 42public ConfigurationProperty(string name, Type type, object defaultValue, ConfigurationPropertyOptions options) 47Type type, 56Type type, 120Type propertyType = info.PropertyType; 182public Type Type { get; private set; } 219Type type,
System\Configuration\ConfigurationValidatorAttribute.cs (4)
11internal Type _declaringType; 15public ConfigurationValidatorAttribute(Type validator) 31public Type ValidatorType { get; } 39internal void SetDeclaringType(Type declaringType)
System\Configuration\ConfigurationValidatorBase.cs (1)
8public virtual bool CanValidate(Type type)
System\Configuration\DefaultValidator.cs (1)
10public override bool CanValidate(Type type)
System\Configuration\ElementInformation.cs (1)
51public Type Type => _thisElement.GetType();
System\Configuration\FactoryRecord.cs (1)
209Type t1, t2;
System\Configuration\GenericEnumConverter.cs (3)
12private readonly Type _enumType; 14public GenericEnumConverter(Type typeEnum) 22public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type)
System\Configuration\IdnElement.cs (1)
41public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
System\Configuration\InfiniteIntConverter.cs (1)
12public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type)
System\Configuration\InfiniteTimeSpanConverter.cs (1)
13public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type)
System\Configuration\IntegerValidator.cs (1)
35public override bool CanValidate(Type type)
System\Configuration\Internal\ConfigSystem.cs (1)
12void IConfigSystem.Init(Type typeConfigHost, params object[] hostInitParams)
System\Configuration\Internal\DelegatingConfigHost.cs (2)
202public virtual Type GetConfigType(string typeName, bool throwOnError) 207public virtual string GetConfigTypeName(Type t)
System\Configuration\Internal\IConfigSystem.cs (1)
10void Init(Type typeConfigHost, params object[] hostInitParams);
System\Configuration\Internal\IInternalConfigConfigurationFactory.cs (1)
10Configuration Create(Type typeConfigHost, params object[] hostInitConfigurationParams);
System\Configuration\Internal\IInternalConfigHost.cs (2)
96Type GetConfigType(string typeName, bool throwOnError); 98string GetConfigTypeName(Type t);
System\Configuration\Internal\InternalConfigConfigurationFactory.cs (1)
11Type typeConfigHost,
System\Configuration\Internal\InternalConfigHost.cs (3)
175Type IInternalConfigHost.GetConfigType(string typeName, bool throwOnError) 177return Type.GetType(typeName, throwOnError); 180string IInternalConfigHost.GetConfigTypeName(Type t)
System\Configuration\LongValidator.cs (1)
35public override bool CanValidate(Type type)
System\Configuration\MgmtConfigurationRecord.cs (2)
127Type type = TypeUtil.GetType(Host, factoryRecord.FactoryTypeName, throwOnError: true); 167Type type = string.IsNullOrEmpty(factoryRecord.FactoryTypeName)
System\Configuration\PositiveTimeSpanValidator.cs (1)
8public override bool CanValidate(Type type)
System\Configuration\PropertyInformation.cs (1)
86public Type Type => Prop.Type;
System\Configuration\ProtectedConfigurationSection.cs (2)
64private static ProtectedConfigurationProvider CreateAndInitializeProviderWithAssert(Type t, ProviderSettings pn) 79Type t = TypeUtil.GetType(pn.Type, true);
System\Configuration\RegexStringValidator.cs (1)
21public override bool CanValidate(Type type)
System\Configuration\RuntimeConfigurationRecord.cs (1)
95Type type = TypeUtil.GetType(configRecord.Host, factoryRecord.FactoryTypeName,
System\Configuration\SettingsProperty.cs (2)
13public virtual Type PropertyType { get; set; } 28Type propertyType,
System\Configuration\SettingsPropertyValue.cs (2)
173private static object GetObjectFromString(Type type, SettingsSerializeAs serializeAs, string serializedValue) 246private static string ConvertObjectToString(object propertyValue, Type type, SettingsSerializeAs serializeAs, bool throwOnError)
System\Configuration\SettingsProviderAttribute.cs (1)
25public SettingsProviderAttribute(Type providerType)
System\Configuration\StringValidator.cs (1)
27public override bool CanValidate(Type type)
System\Configuration\SubclassTypeValidator.cs (8)
9private readonly Type _base; 11public SubclassTypeValidator(Type baseClass) 19public override bool CanValidate(Type type) 21return type == typeof(Type); 29if (!(value is Type)) ValidatorUtils.HelperParamValidation(value, typeof(Type)); 31if (!_base.IsAssignableFrom((Type)value)) 33throw new ArgumentException(SR.Format(SR.Subclass_validator_error, ((Type)value).FullName,
System\Configuration\SubclassTypeValidatorAttribute.cs (2)
9public SubclassTypeValidatorAttribute(Type baseClass) 16public Type BaseClass { get; }
System\Configuration\TimeSpanMinutesConverter.cs (1)
11public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type)
System\Configuration\TimeSpanMinutesOrInfiniteConverter.cs (1)
11public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type)
System\Configuration\TimeSpanSecondsConverter.cs (1)
11public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type)
System\Configuration\TimeSpanSecondsOrInfiniteConverter.cs (1)
11public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type)
System\Configuration\TimeSpanValidator.cs (1)
35public override bool CanValidate(Type type)
System\Configuration\TypeNameConverter.cs (5)
11public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type) 14if (!(value is Type)) ValidateType(value, typeof(Type)); 18if (value != null) result = ((Type)value).AssemblyQualifiedName; 25Type result = TypeUtil.GetType((string)data, false);
System\Configuration\TypeUtil.cs (17)
40private static Type GetImplicitType(string typeString) 63Type type = configurationAssembly.GetType(typeString, false); 73Type type = Type.GetType($"{typeString}, {assembly}"); 86internal static Type GetType(string typeString, bool throwOnError) 88Type type; 92type = Type.GetType(typeString, throwOnError); 109internal static Type GetType(IInternalConfigHost host, string typeString, bool throwOnError) 111Type type; 130Type type = GetType(typeString, true); 135internal static object CreateInstance(Type type) 140internal static ConstructorInfo GetConstructor(Type type, Type baseType, bool throwOnError) 148ConstructorInfo ctor = type.GetConstructor(BindingFlags, null, CallingConventions.HasThis, Type.EmptyTypes, 156internal static Type VerifyAssignableType(Type baseType, Type type, bool throwOnError)
System\Configuration\ValidatorUtils.cs (1)
11public static void HelperParamValidation(object value, Type allowedType)
System\Configuration\WhiteSpaceTrimStringConverter.cs (1)
11public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type)
System\Diagnostics\FilterElement.cs (1)
23if (Type.GetType(TypeName) != filter.GetType() || InitDataChanged(filter))
System\Diagnostics\ListenerElementsCollection.cs (1)
335if (Type.GetType(className) != listener.GetType() || InitDataChanged(listener))
System\Diagnostics\TraceConfiguration.cs (1)
116Type currentType = traceSource.Switch.GetType();
System\Diagnostics\TraceUtils.cs (10)
18internal static object GetRuntimeObject(string className, Type baseType, string initializeData) 21Type objectType = null; 37objectType = Type.GetType(className); 57ConstructorInfo ctorInfo = objectType.GetConstructor(Array.Empty<Type>()); 66ConstructorInfo ctorInfo = objectType.GetConstructor(new Type[] { typeof(string) }); 103Type paramtype = ctorparams[0].ParameterType; 144private static Type MapToBuiltInTypes(string className) 183internal static bool IsOwnedTL(Type type) 189internal static bool IsOwnedTextWriterTL(Type type) 196private static object ConvertToBaseTypeOrEnum(string value, Type type)
System\Diagnostics\TypedElement.cs (2)
14private readonly Type _baseType; 16public TypedElement(Type baseType) : base()
System.Data.Common (324)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (22)
188internal static ArgumentOutOfRangeException NotSupportedEnumerationValue(Type type, string value, string method) 233private static readonly Type s_stackOverflowType = typeof(StackOverflowException); 234private static readonly Type s_outOfMemoryType = typeof(OutOfMemoryException); 235private static readonly Type s_threadAbortType = typeof(ThreadAbortException); 236private static readonly Type s_nullReferenceType = typeof(NullReferenceException); 237private static readonly Type s_accessViolationType = typeof(AccessViolationException); 238private static readonly Type s_securityType = typeof(SecurityException); 244Type type = e.GetType(); 264Type type = e.GetType(); 274internal static ArgumentOutOfRangeException InvalidEnumerationValue(Type type, int value) 290internal static ArgumentException ConvertFailed(Type fromType, Type toType, Exception? innerException) 310internal static ArgumentException CollectionRemoveInvalidObject(Type itemType, ICollection collection) 314internal static ArgumentNullException CollectionNullValue(string parameter, Type collection, Type itemType) 318internal static IndexOutOfRangeException CollectionIndexInt32(int index, Type collection, int count) 322internal static IndexOutOfRangeException CollectionIndexString(Type itemType, string propertyName, string propertyValue, Type collection) 326internal static InvalidCastException CollectionInvalidType(Type collection, Type itemType, object invalidValue) 396internal static ArgumentException ParametersIsNotParent(Type parameterType, ICollection collection) 400internal static ArgumentException ParametersIsParent(Type parameterType, ICollection collection)
System\Data\ColumnTypeConverter.cs (9)
18private static readonly Type[] s_types = new Type[] { 62public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) => 71public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 94if (value is Type || value is string) 96MethodInfo method = typeof(Type).GetMethod("GetType", new Type[] { typeof(string) })!; 99return new InstanceDescriptor(method, new object[] { ((Type)newValue).AssemblyQualifiedName! }); 107public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) =>
System\Data\Common\AdapterUtil.Common.cs (4)
278internal static Exception WrongType(Type got, Type expected) 286internal static Exception CollectionUniqueValue(Type itemType, string propertyName, string? propertyValue) 312internal static InvalidOperationException ColumnSchemaMismatch(string? srcColumn, Type srcType, DataColumn column)
System\Data\Common\BigIntegerStorage.cs (1)
77internal static object ConvertFromBigInteger(BigInteger value, Type type, IFormatProvider formatProvider)
System\Data\Common\DataColumnMapping.cs (7)
74public DataColumn? GetDataColumnBySchemaAction(DataTable dataTable, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type? dataType, MissingSchemaAction schemaAction) 80public static DataColumn? GetDataColumnBySchemaAction(string? sourceColumn, string? dataSetColumn, DataTable dataTable, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type? dataType, MissingSchemaAction schemaAction) 115internal static DataColumn? CreateDataColumnBySchemaAction(string? sourceColumn, string? dataSetColumn, DataTable dataTable, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type? dataType, MissingSchemaAction schemaAction) 150public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 159public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 171Type[] types = new Type[] { typeof(string), typeof(string) };
System\Data\Common\DataColumnMappingCollection.cs (2)
84private static Type ItemType 445public static DataColumn? GetDataColumn(DataColumnMappingCollection? columnMappings, string sourceColumn, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type? dataType, DataTable dataTable, MissingMappingAction mappingAction, MissingSchemaAction schemaAction)
System\Data\Common\DataRecordInternal.cs (3)
69public override Type GetFieldType(int i) 339object? ICustomTypeDescriptor.GetEditor(Type editorBaseType) 377public Type type;
System\Data\Common\DataStorage.cs (24)
66private static readonly Type?[] s_storageClassType = new Type?[] { 90typeof(Type), 115internal readonly Type _dataType; 127private static readonly Func<Type, Tuple<bool, bool, bool, bool>> s_inspectTypeForInterfaces = InspectTypeForInterfaces; 128private static readonly ConcurrentDictionary<Type, Tuple<bool, bool, bool, bool>> s_typeImplementsInterface = new ConcurrentDictionary<Type, Tuple<bool, bool, bool, bool>>(); 130protected DataStorage(DataColumn column, Type type, object? defaultValue, StorageType storageType) 135protected DataStorage(DataColumn column, Type type, object? defaultValue, object nullValue, StorageType storageType) 140protected DataStorage(DataColumn column, Type type, object? defaultValue, object nullValue, bool isICloneable, StorageType storageType) 295public static DataStorage CreateStorage(DataColumn column, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type dataType, StorageType typeCode) 362internal static StorageType GetStorageType(Type? dataType) 371TypeCode tcode = Type.GetTypeCode(dataType); 379internal static Type GetTypeStorage(StorageType storageType) 385internal static bool IsTypeCustomType(Type type) 400public static bool IsSqlType(Type dataType) 412private static bool DetermineIfValueType(StorageType typeCode, Type dataType) 471Type dataType, 511private static Tuple<bool, bool, bool, bool> InspectTypeForInterfaces(Type dataType) 522internal static bool ImplementsINullableValue(StorageType typeCode, Type dataType) 572internal static Type GetType(string value) 574Type? dataType = Type.GetType(value); // throwOnError=false, ignoreCase=fase 593internal static string GetQualifiedName(Type type)
System\Data\Common\DataTableMapping.cs (5)
115public DataColumn? GetDataColumn(string sourceColumn, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type? dataType, DataTable dataTable, MissingMappingAction mappingAction, MissingSchemaAction schemaAction) 172public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 181public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 195Type[] types = new Type[] { typeof(string), typeof(string), typeof(DataColumnMapping[]) };
System\Data\Common\DataTableMappingCollection.cs (1)
57private static Type ItemType => typeof(DataTableMapping);
System\Data\Common\DbColumn.cs (1)
29public Type? DataType { get; protected set; }
System\Data\Common\DbConnectionStringBuilder.cs (2)
478Type vtype; 612object? ICustomTypeDescriptor.GetEditor(Type editorBaseType)
System\Data\Common\DbConnectionStringBuilderDescriptor.cs (4)
10internal DbConnectionStringBuilderDescriptor(string propertyName, Type componentType, Type propertyType, bool isReadOnly, Attribute[] attributes) : base(propertyName, attributes) 18public override Type ComponentType { get; } 20public override Type PropertyType { get; }
System\Data\Common\DbDataReader.cs (2)
72public abstract Type GetFieldType(int ordinal); 188public virtual Type GetProviderSpecificFieldType(int ordinal)
System\Data\Common\DbDataReaderExtensions.cs (1)
48DataType = GetDbColumnValue<Type?>(SchemaTableColumn.DataType);
System\Data\Common\DbDataRecord.cs (2)
45public abstract Type GetFieldType(int i); 89object? ICustomTypeDescriptor.GetEditor(Type editorBaseType) => null;
System\Data\Common\DbEnumerator.cs (4)
114private readonly Type _type; 116internal DbColumnDescriptor(int ordinal, string name, Type type) 123public override Type ComponentType => typeof(IDataRecord); 127public override Type PropertyType => _type;
System\Data\Common\DbProviderFactories.cs (5)
119public static void RegisterFactory(string providerInvariantName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] Type providerFactoryClass) 168private static DbProviderFactory GetFactoryInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] Type providerFactoryClass) 194private static Type GetProviderTypeFromTypeName([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] string assemblyQualifiedName) 196Type? providerType = Type.GetType(assemblyQualifiedName);
System\Data\Common\DBSchemaRow.cs (2)
303internal Type? DataType 313return (Type)value;
System\Data\Common\ObjectStorage.cs (31)
30internal ObjectStorage(DataColumn column, Type type) 193private static Families GetFamily(Type dataType) 195switch (Type.GetTypeCode(dataType)) 246Type valType = value.GetType(); 321Type type = _dataType; // real type of objects in this column 327if (type == typeof(Type)) 329return Type.GetType(s)!; 369Type? type = null; 401retValue = Type.GetType(xmlReader.ReadString()); 467Type type = _dataType; 472if ((type == typeof(Type)) || ((type == typeof(object)) && (value is Type))) 474return ((Type)value).AssemblyQualifiedName!; 482if (Type.GetTypeCode(value.GetType()) != TypeCode.Object) 552private static Dictionary<KeyValuePair<Type, XmlRootAttribute>, XmlSerializer>? s_tempAssemblyCache; 562internal static void VerifyIDynamicMetaObjectProvider(Type type) 573internal static XmlSerializer GetXmlSerializer(Type type) 586internal static XmlSerializer GetXmlSerializer(Type type, XmlRootAttribute attribute) 589KeyValuePair<Type, XmlRootAttribute> key = new KeyValuePair<Type, XmlRootAttribute>(type, attribute); 592Dictionary<KeyValuePair<Type, XmlRootAttribute>, XmlSerializer>? cache = s_tempAssemblyCache; 609Dictionary<KeyValuePair<Type, XmlRootAttribute>, XmlSerializer> tmp = 610new Dictionary<KeyValuePair<Type, XmlRootAttribute>, XmlSerializer>( 612foreach (KeyValuePair<KeyValuePair<Type, XmlRootAttribute>, XmlSerializer> entry in cache) 620cache = new Dictionary<KeyValuePair<Type, XmlRootAttribute>, XmlSerializer>( 626key = new KeyValuePair<Type, XmlRootAttribute>(type, new XmlRootAttribute()); 641private sealed class TempAssemblyComparer : IEqualityComparer<KeyValuePair<Type, XmlRootAttribute>> 643internal static readonly IEqualityComparer<KeyValuePair<Type, XmlRootAttribute>> s_default = new TempAssemblyComparer(); 647public bool Equals(KeyValuePair<Type, XmlRootAttribute> x, KeyValuePair<Type, XmlRootAttribute> y) 658public int GetHashCode(KeyValuePair<Type, XmlRootAttribute> obj)
System\Data\Common\SQLConvert.cs (20)
19Type valueType = value.GetType(); 37Type valueType = value.GetType(); 56Type valueType = value.GetType(); 79Type valueType = value.GetType(); 104Type valueType = value.GetType(); 137Type valueType = value.GetType(); 167Type valueType = value.GetType(); 198Type valueType = value.GetType(); 228Type valueType = value.GetType(); 246Type valueType = value.GetType(); 264Type valueType = value.GetType(); 282Type valueType = value.GetType(); 300Type valueType = value.GetType(); 318Type valueType = value.GetType(); 334Type valueType = value.GetType(); 348public static object ChangeTypeForDefaultValue(object value, Type type, IFormatProvider formatProvider) 364public static object ChangeType2(object value, StorageType stype, Type type, IFormatProvider formatProvider) 409Type valueType = value.GetType(); 559public static object ChangeTypeForXML(object value, Type type) 563Type valueType = value.GetType();
System\Data\Common\SqlUDTStorage.cs (8)
23private static readonly ConcurrentDictionary<Type, object> s_typeToNull = new ConcurrentDictionary<Type, object>(); 25public SqlUdtStorage(DataColumn column, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type type) 30private SqlUdtStorage(DataColumn column, Type type, object nullValue) 38internal static object GetStaticNullForUdtType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type type) => s_typeToNull.GetOrAdd(type, GetStaticNullForUdtTypeCore); 42private static object GetStaticNullForUdtTypeCore(Type type) 186Type type = (typeName == null) ? _dataType : Type.GetType(typeName)!;
System\Data\Common\TimeSpanStorage.cs (1)
186Type typeofValue = value.GetType();
System\Data\ConstraintConverter.cs (4)
20public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) => 31public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 40Reflection.ConstructorInfo ctor = typeof(UniqueConstraint).GetConstructor(new Type[] { typeof(string), typeof(string[]), typeof(bool) })!; 50typeof(ForeignKeyConstraint).GetConstructor(new Type[] { typeof(string), typeof(string), typeof(string[]),
System\Data\DataColumn.cs (13)
36private Type _dataType = null!; // Always set in UpdateColumnType 103public DataColumn(string? columnName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type dataType) : this(columnName, dataType, null, MappingType.Element) 113public DataColumn(string? columnName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type dataType, string? expr) : this(columnName, dataType, expr, MappingType.Element) 124public DataColumn(string? columnName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type dataType, string? expr, MappingType type) 156private void UpdateColumnType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type type, StorageType typeCode) 478public Type DataType 1484Type leftType = value.GetType(); 1485Type rightType = _storage!.Get(record1).GetType(); 1611internal static bool IsAutoIncrementType(Type dataType) => 1631(DataStorage.IsTypeCustomType(value.GetType()) && !(value is Type)); 1877internal abstract Type DataType { get; } 1914internal override Type DataType => typeof(long); 1995internal override Type DataType => typeof(BigInteger);
System\Data\DataColumnCollection.cs (2)
215public DataColumn Add(string? columnName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type type, string expression) 227public DataColumn Add(string? columnName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type type)
System\Data\DataColumnPropertyDescriptor.cs (2)
40public override Type ComponentType => typeof(DataRowView); 44public override Type PropertyType => Column.DataType;
System\Data\DataException.cs (13)
374public static Exception TypeNotAllowed(Type type) => _InvalidOperation(SR.Format(SR.Data_TypeNotAllowed, type.AssemblyQualifiedName)); 486public static Exception DefaultValueDataType(string column, Type defaultType, Type columnType, Exception inner) => 491public static Exception DefaultValueColumnDataType(string column, Type defaultType, Type columnType, Exception inner) => _Argument(SR.Format(SR.DataColumn_DefaultValueColumnDataType, column, defaultType.FullName, columnType.FullName), inner); 503public static Exception SetFailed(object? value, DataColumn column, Type type, Exception innerException) => _Argument(innerException.Message + SR.Format(SR.DataColumn_SetFailed, value?.ToString(), column.ColumnName, type.Name), innerException); 508public static Exception CannotSetSimpleContentType(string columnName, Type type) => _Argument(SR.Format(SR.DataColumn_CannotSimpleContentType, columnName, type)); 509public static Exception CannotSetSimpleContent(string columnName, Type type) => _Argument(SR.Format(SR.DataColumn_CannotSimpleContent, columnName, type)); 517public static Exception InvalidDataColumnMapping(Type type) => _Argument(SR.Format(SR.DataColumn_InvalidDataColumnMapping, type.AssemblyQualifiedName)); 648public static Exception InvalidSchemaSerializationMode(Type enumType, string mode) => _InvalidEnumArgumentException(SR.Format(SR.ADP_InvalidEnumerationValue, enumType.Name, mode)); 680public static Exception AggregateException(AggregateType aggregateType, Type type) => _Data(SR.Format(SR.DataStorage_AggregateException, aggregateType, type.Name)); 741public static Exception ConvertFailed(Type type1, Type type2) => _Data(SR.Format(SR.SqlConvert_ConvertFailed, type1.FullName, type2.FullName));
System\Data\DataReaderExtensions.cs (2)
85public static Type GetFieldType(this DbDataReader reader, string name) 142public static Type GetProviderSpecificFieldType(this DbDataReader reader, string name)
System\Data\DataRelationPropertyDescriptor.cs (2)
18public override Type ComponentType => typeof(DataRowView); 22public override Type PropertyType => typeof(IBindingList);
System\Data\DataRowComparer.cs (2)
67switch (Type.GetTypeCode(a.GetType().GetElementType())) 192Type valueType = value.GetType();
System\Data\DataRowExtensions.cs (4)
192Type valueType = value.GetType(); 193Type nullableType = Nullable.GetUnderlyingType(typeof(T))!; 196Type fromType = valueType.IsEnum ? Enum.GetUnderlyingType(valueType) : valueType; 197Type toType = nullableType.IsEnum ? Enum.GetUnderlyingType(nullableType) : nullableType;
System\Data\DataRowView.cs (1)
246object? ICustomTypeDescriptor.GetEditor(Type editorBaseType) => null;
System\Data\DataSet.cs (12)
1924/// <param name="multipleTargetConverter">A delegate used to convert <see cref='Type'/> into string.</param> 1927public void WriteXmlSchema(Stream? stream, Converter<Type, string> multipleTargetConverter) 1941/// <param name="multipleTargetConverter">A delegate used to convert <see cref='Type'/> into string.</param> 1944public void WriteXmlSchema(string fileName, Converter<Type, string> multipleTargetConverter) 1958/// <param name="multipleTargetConverter">A delegate used to convert <see cref='Type'/> into string.</param> 1961public void WriteXmlSchema(TextWriter? writer, Converter<Type, string> multipleTargetConverter) 1975/// <param name="multipleTargetConverter">A delegate used to convert <see cref='Type'/> into string.</param> 1978public void WriteXmlSchema(XmlWriter? writer, Converter<Type, string> multipleTargetConverter) 1986private void WriteXmlSchema(string fileName, SchemaFormat schemaFormat, Converter<Type, string>? multipleTargetConverter) 2004private void WriteXmlSchema(Stream? stream, SchemaFormat schemaFormat, Converter<Type, string>? multipleTargetConverter) 2019private void WriteXmlSchema(TextWriter? writer, SchemaFormat schemaFormat, Converter<Type, string>? multipleTargetConverter) 2034private void WriteXmlSchema(XmlWriter? writer, SchemaFormat schemaFormat, Converter<Type, string>? multipleTargetConverter)
System\Data\DataSetUtil.cs (1)
48internal static ArgumentOutOfRangeException InvalidEnumerationValue(Type type, int value)
System\Data\DataTable.cs (2)
468dc.DataType = Type.GetType(typeName, throwOnError: true); 3524protected virtual Type GetRowType() => typeof(DataRow);
System\Data\DataTablePropertyDescriptor.cs (2)
18public override Type ComponentType => typeof(DataRowView); 22public override Type PropertyType => typeof(IBindingList);
System\Data\DataTableReader.cs (3)
293public override Type GetProviderSpecificFieldType(int ordinal) 511public override Type GetFieldType(int ordinal) 726new DataColumn(SchemaTableColumn.DataType, typeof(Type));
System\Data\DataViewManagerListItemTypeDescriptor.cs (1)
70object? ICustomTypeDescriptor.GetEditor(Type editorBaseType) => null;
System\Data\DefaultValueTypeConverter.cs (1)
22public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Data\EnumerableRowCollection.cs (2)
18internal abstract Type ElementType { get; } 45internal override Type ElementType
System\Data\Filter\BinaryNode.cs (4)
135internal static void SetTypeMismatchError(int op, Type left, Type right) 301Type typeofLeft = vLeft.GetType(); 302Type typeofRight = vRight.GetType();
System\Data\Filter\DataExpression.cs (2)
21private readonly Type? _dataType; // This set if the expression is part of ExpressionCoulmn 30internal DataExpression(DataTable? table, string? expression, Type? type)
System\Data\Filter\FilterException.cs (10)
166public static Exception DatatypeConversion(Type type1, Type type2) 171public static Exception DatavalueConversion(object value, Type type) 211public static Exception Overflow(Type type) 216public static Exception ArgumentType(string function, int arg, Type type) 226public static Exception TypeMismatchInBinop(int op, Type type1, Type type2) 231public static Exception AmbiguousBinop(int op, Type type1, Type type2) 326public static Exception UnsupportedDataType(Type type)
System\Data\Filter\FunctionNode.cs (14)
280private Type GetDataType(ExpressionNode node) 282Type nodeType = node.GetType(); 296throw ExprException.ArgumentType(s_funcs[_info]._name, 2, typeof(Type)); 299Type? dataType = Type.GetType(typeName); 486Type type = (Type)argumentValues[1]; 666internal readonly Type _result; 670internal readonly Type?[] _parameters = new Type?[] { null, null, null }; 682internal Function(string name, FunctionId id, Type result, bool IsValidateArguments, 683bool IsVariantArgumentList, int argumentCount, Type? a1, Type? a2, Type? a3)
System\Data\IDataRecord.cs (1)
16Type GetFieldType(int i);
System\Data\PrimaryKeyTypeConverter.cs (2)
19public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) => 23public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Data\ProviderBase\DataReaderContainer.cs (4)
46internal abstract Type GetFieldType(int ordinal); 104internal override Type GetFieldType(int ordinal) 106Type fieldType = _providerSpecificDataReader.GetProviderSpecificFieldType(ordinal); 145internal override Type GetFieldType(int ordinal)
System\Data\ProviderBase\SchemaMapping.cs (4)
588Type fieldType = _dataReader.GetFieldType(i); 702Type fieldType = chapterValue.GetType(); 810Type? fieldType = schemaRow.DataType; 1049Type fieldType = chapterValue.GetType();
System\Data\RelationshipConverter.cs (4)
22public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 38public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 53ctor = typeof(DataRelation).GetConstructor(new Type[] { typeof(string) /*relationName*/, typeof(string) /*parentTableName*/, typeof(string) /*childTableName */, 60ctor = typeof(DataRelation).GetConstructor(new Type[] { typeof(string)/*relationName*/, typeof(string)/*parentTableName*/, typeof(string)/*parentTableNamespace*/,
System\Data\SimpleType.cs (1)
312internal static SimpleType? CreateSimpleType(StorageType typeCode, Type type)
System\Data\TypeLimiter.cs (15)
55public static void EnsureTypeIsAllowed(Type? type, TypeLimiter? capturedLimiter = null) 107private static IEnumerable<Type> GetPreviouslyDeclaredDataTypes(DataTable dataTable) 111: Enumerable.Empty<Type>(); 118private static IEnumerable<Type> GetPreviouslyDeclaredDataTypes(DataSet dataSet) 122: Enumerable.Empty<Type>(); 130private static readonly HashSet<Type> s_allowedTypes = new HashSet<Type>() 169typeof(Type), 186private readonly HashSet<Type> m_allowedTypes; 198internal Scope(Scope? previousScope, IEnumerable<Type> allowedTypes) 203m_allowedTypes = new HashSet<Type>(allowedTypes.Where(type => type != null)); 221public bool IsAllowedType(Type type) 245Type[]? appDomainAllowedTypes = (Type[]?)AppDomain.CurrentDomain.GetData(AppDomainDataSetDefaultAllowedTypesKey); 262private static bool IsTypeUnconditionallyAllowed(Type type)
System\Data\XDRSchema.cs (4)
221public Type type; 222public NameType(string n, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type t) 297private static Type ParseDataType(string dt, string dtValues) 350Type type;
System\Data\xmlsaver.cs (15)
54private Converter<Type, string>? _targetConverter; 66internal static void AddExtendedProperties(PropertyCollection? props, XmlElement node, Type? type) 134Type type = pd.PropertyType; 151type != typeof(Type) && 229internal static string XmlDataTypeName(Type type) 409internal static void ValidateColumnMapping(Type columnType) 1138internal void Save(DataSet? ds, DataTable? dt, XmlWriter xw, bool writeHierarchy, Converter<Type, string>? multipleTargetConverter) 1326if (col.DataType == typeof(Guid) || col.DataType == typeof(Type)) 2231private void SetMSDataAttribute(XmlElement root, Type type) 2588Type valuesType = columnValue.GetType(); 2632if (valuesType == typeof(Type) || valuesType == typeof(Guid) || valuesType == typeof(char) || 2637else if (columnValue is Type) 3024Type valuesType = value.GetType(); 3064if (valuesType == typeof(Type) || valuesType == typeof(Guid) || valuesType == typeof(char) || 3069else if (value is Type)
System\Data\XMLSchema.cs (14)
19internal static TypeConverter GetConverter(Type type) 46Type type = pd.PropertyType; 54else if (type == typeof(Type)) 293Type type = pd.PropertyType; 301else if (type == typeof(Type)) 303propValue = Type.GetType(value); 1775public readonly Type type; 1776public NameType(string n, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type t) 1784public static Type XsdtoClr(string xsdTypeName) 1868private Type ParseDataType(string dt) 1964Type? type; 2102Type? type; 2198Type? type; 2362Type? type;
System.Data.Odbc (43)
Common\System\Data\Common\AdapterUtil.Odbc.cs (8)
304internal static Exception UninitializedParameterSize(int index, Type dataType) 368internal static ArgumentException UnknownDataType(Type dataType) 372internal static ArgumentException DbTypeNotSupported(System.Data.DbType type, Type enumtype) 376internal static ArgumentException UnknownDataTypeCode(Type dataType, TypeCode typeCode) 389internal static Exception ParameterConversionFailed(object value, Type destType, Exception inner) 427internal static Exception ParametersSourceIndex(string parameterName, IDataParameterCollection collection, Type parameterType) 431internal static Exception ParameterNull(string parameter, IDataParameterCollection collection, Type parameterType) 435internal static Exception InvalidParameterType(IDataParameterCollection collection, Type parameterType, object invalidValue)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (22)
188internal static ArgumentOutOfRangeException NotSupportedEnumerationValue(Type type, string value, string method) 233private static readonly Type s_stackOverflowType = typeof(StackOverflowException); 234private static readonly Type s_outOfMemoryType = typeof(OutOfMemoryException); 235private static readonly Type s_threadAbortType = typeof(ThreadAbortException); 236private static readonly Type s_nullReferenceType = typeof(NullReferenceException); 237private static readonly Type s_accessViolationType = typeof(AccessViolationException); 238private static readonly Type s_securityType = typeof(SecurityException); 244Type type = e.GetType(); 264Type type = e.GetType(); 274internal static ArgumentOutOfRangeException InvalidEnumerationValue(Type type, int value) 290internal static ArgumentException ConvertFailed(Type fromType, Type toType, Exception? innerException) 310internal static ArgumentException CollectionRemoveInvalidObject(Type itemType, ICollection collection) 314internal static ArgumentNullException CollectionNullValue(string parameter, Type collection, Type itemType) 318internal static IndexOutOfRangeException CollectionIndexInt32(int index, Type collection, int count) 322internal static IndexOutOfRangeException CollectionIndexString(Type itemType, string propertyName, string propertyValue, Type collection) 326internal static InvalidCastException CollectionInvalidType(Type collection, Type itemType, object invalidValue) 396internal static ArgumentException ParametersIsNotParent(Type parameterType, ICollection collection) 400internal static ArgumentException ParametersIsParent(Type parameterType, ICollection collection)
src\libraries\Common\src\System\Data\ProviderBase\DbMetaDataFactory.cs (1)
174resultTable.Columns.Add(row["ColumnName"] as string, (Type)row["DataType"]);
System\Data\Odbc\DbDataRecord.cs (1)
14internal Type? _type;
System\Data\Odbc\Odbc32.cs (6)
33internal static ArgumentOutOfRangeException NotSupportedEnumerationValue(Type type, int value) 797internal readonly Type _type; 808private TypeMap(OdbcType odbcType, DbType dbType, Type type, ODBC32.SQL_TYPE sql_type, ODBC32.SQL_C sql_c, ODBC32.SQL_C param_sql_c, int bsize, int csize, bool signType) 886internal static TypeMap FromSystemType(Type dataType) 888switch (Type.GetTypeCode(dataType)) 931default: throw ADP.UnknownDataTypeCode(dataType, Type.GetTypeCode(dataType));
System\Data\Odbc\OdbcDataReader.cs (1)
415public override Type GetFieldType(int i)
System\Data\Odbc\OdbcMetaDataFactory.cs (1)
1071resultTable.Columns.Add(row["ColumnName"] as string, (Type)row["DataType"]);
System\Data\Odbc\OdbcParameter.cs (2)
992Type valueType = value.GetType(); 1027Type type = value.GetType();
System\Data\Odbc\OdbcParameterCollection.cs (1)
15private static readonly Type s_itemType = typeof(OdbcParameter);
System.Data.OleDb (2)
artifacts\obj\System.Data.OleDb\Debug\net10.0\System.Data.OleDb.notsupported.cs (2)
212public override System.Type GetFieldType(int index) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_OleDb); } 233public static System.Data.OleDb.OleDbDataReader GetEnumerator(System.Type type) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_OleDb); }
System.Diagnostics.DiagnosticSource (28)
System\Diagnostics\DsesFilterAndTransform.cs (21)
417Type argType = args.GetType(); 444new ConcurrentDictionary<Type, TransformSpec?>(1, 8), null); 570public Type? Type; 681Type? objType = obj?.GetType(); 700public PropertyFetch(Type? type) 709internal Type? Type { get; } 715public static PropertyFetch FetcherForProperty(DiagnosticSourceEventSource eventSource, Type? type, string propertyName) 729foreach (Type iFaceType in typeInfo.GetInterfaces()) 778private static PropertyFetch CreateEnumeratePropertyFetch(Type type, TypeInfo enumerableOfTType) 780Type elemType = enumerableOfTType.GetGenericArguments()[0]; 787Type instantiatedTypedPropertyFetcher = typeof(EnumeratePropertyFetch<>) 794private static PropertyFetch CreatePropertyFetch(Type type, PropertyInfo propertyInfo) 802Type typedPropertyFetcher = type.IsValueType ? 804Type instantiatedTypedPropertyFetcher = typedPropertyFetcher.GetTypeInfo().MakeGenericType( 818public RefTypedFetchProperty(Type type, PropertyInfo property) : base(type) 837public ValueTypedFetchProperty(Type type, PropertyInfo property) : base(type) 860public ReflectionPropertyFetch(Type type, PropertyInfo property) : base(type) 873public EnumeratePropertyFetch(Type type) : base(type) { } 938public EnumeratePropertyFetch(Type type) : base(type) { } 995private static TransformSpec? MakeImplicitTransforms(DiagnosticSourceEventSource eventSource, Type type) 1028private ConcurrentDictionary<Type, TransformSpec?>? _implicitTransformsTable; // If there is more than one object type for an implicit transform, they go here.
System\Diagnostics\Metrics\AggregationManager.cs (4)
301Type aggregatorType = createAggregatorFunc.GetType().GenericTypeArguments[0]; 302Type instrumentStateType = typeof(InstrumentState<>).MakeGenericType(aggregatorType); 308Type type = instrument.GetType(); 309Type? genericDefType = null;
System\Diagnostics\Metrics\Instrument.cs (1)
162Type type = typeof(T);
System\Diagnostics\Metrics\Meter.cs (2)
524private static Instrument? GetCachedInstrument(List<Instrument> instrumentList, Type instrumentType, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) 540private Instrument GetOrCreateInstrument<T>(Type instrumentType, string name, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags, Func<Instrument> instrumentCreator)
System.Diagnostics.TraceSource (9)
System\Diagnostics\SwitchAttribute.cs (6)
14private Type _type; 17public SwitchAttribute(string switchName, Type switchType) 35public Type SwitchType 57foreach (Type type in assembly.GetTypes()) 67private static void GetAllRecursive([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, List<object> switchAttribs) 77if (!(member is Type))
System\Diagnostics\SwitchLevelAttribute.cs (3)
11private Type _type; 13public SwitchLevelAttribute(Type switchLevelType) 18public Type SwitchLevelType
System.DirectoryServices (5)
artifacts\obj\System.DirectoryServices\Debug\net10.0\System.DirectoryServices.notsupported.cs (5)
57public override System.Type AccessRightType { get { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } } 58public override System.Type AccessRuleType { get { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } } 59public override System.Type AuditRuleType { get { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } } 560public ActiveDirectoryObjectNotFoundException(string? message, System.Type? type, string? name) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 562public System.Type? Type { get { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } }
System.DirectoryServices.AccountManagement (5)
artifacts\obj\System.DirectoryServices.AccountManagement\Debug\net10.0\System.DirectoryServices.AccountManagement.notsupported.cs (5)
14protected void AdvancedFilterSet(string attribute, object value, System.Type objectType, System.DirectoryServices.AccountManagement.MatchType mt) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 212protected static System.DirectoryServices.AccountManagement.Principal FindByIdentityWithType(System.DirectoryServices.AccountManagement.PrincipalContext context, System.Type principalType, System.DirectoryServices.AccountManagement.IdentityType identityType, string identityValue) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 214protected static System.DirectoryServices.AccountManagement.Principal FindByIdentityWithType(System.DirectoryServices.AccountManagement.PrincipalContext context, System.Type principalType, string identityValue) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 219public System.Type GetUnderlyingObjectType() { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 325public System.Type GetUnderlyingSearcherType() { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); }
System.DirectoryServices.Protocols (1)
artifacts\obj\System.DirectoryServices.Protocols\Debug\net10.0\System.DirectoryServices.Protocols.notsupported.cs (1)
116public object[] GetValues(System.Type valuesType) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesProtocols_PlatformNotSupported); }
System.Drawing.Common (25)
Special\NotSupported.cs (25)
26public Bitmap(System.Type type, string resource) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 369public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type sourceType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 370public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] System.Type? destinationType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 372public override object? ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type destinationType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 381public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type sourceType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 391public FontUnitConverter() : base (default(System.Type)) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 707public Icon(System.Type type, string resource) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 729public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type sourceType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 730public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] System.Type? destinationType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 732public override object? ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type destinationType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 822public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type sourceType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 823public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] System.Type? destinationType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 825public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type destinationType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 834public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type? sourceType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 835public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] System.Type? destinationType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 837public override object? ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type destinationType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1360public ToolboxBitmapAttribute(System.Type t) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1361public ToolboxBitmapAttribute(System.Type t, string name) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1366public System.Drawing.Image? GetImage(System.Type type) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1367public System.Drawing.Image? GetImage(System.Type type, bool large) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1368public System.Drawing.Image? GetImage(System.Type type, string? imgName, bool large) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1369public static System.Drawing.Image? GetImageFromResource(System.Type t, string? imageName, bool large) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 2735public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type sourceType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 2736public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] System.Type? destinationType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 2738public override object? ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type destinationType) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
System.Drawing.Common.Tests (13)
System\Drawing\BitmapTests.cs (1)
105public void Ctor_InvalidResource_ThrowsArgumentException(Type type, string resource)
System\Drawing\ColorTranslatorTests.cs (1)
227public void FromHtml_Invalid_Throw(string htmlColor, Type exception)
System\Drawing\IconTests.cs (2)
209public void Ctor_InvalidBytesInStream_ThrowsException(byte[] bytes, Type exceptionType) 267public void Ctor_InvalidResource_ThrowsArgumentException(Type type, string resource)
System\Drawing\Imaging\ColorMatrixTests.cs (1)
107public void Ctor_BadValues_ThrowsExpectedException(float[][] newColorMatrix, Type expectedException)
System\Drawing\Imaging\EncoderParameterTests.cs (4)
220public void Ctor_Encoder_Numerator1Array_Denominator1Array_Numerator2Array_Denominator2Array_InvalidParameters_ThrowsExpected(int[]? numerator1, int[]? denominator1, int[]? numerator2, int[]? denominator2, Type expected) 237public void Ctor_Numerator_Denominator_IvalidValues_ThrowsExpected(int[]? numerator, int[]? denominator, Type expected) 247public void Ctor_RangeBegin_RangeEnd_InvalidValues_ThrowsExpected(long[]? rangeBegin, long[]? rangeEnd, Type expected) 308public void Ctor_Encoder_TooBigNumberOfValues_Type_Value_AccessViolationException(EncoderParameterValueType type, int numberOfValues, Type expected)
System\Drawing\Printing\MarginsConverterTests.cs (1)
155public object GetService(Type serviceType) { return null; }
System\Drawing\ToolboxBitmapAttributeTests.cs (3)
53public void Ctor_Type(Type? type, int width, int height) 79public void Ctor_Type_String(Type? type, string? fileName, int width, int height) 149public void GetImage_NoExtension(Type type, int width, int height)
System.Drawing.Primitives (1)
src\libraries\Common\src\System\Drawing\ColorTable.cs (1)
24[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type typeWithColors)
System.Formats.Asn1 (13)
System\Formats\Asn1\AsnDecoder.cs (1)
549private static int GetPrimitiveIntegerSize(Type primitiveType)
System\Formats\Asn1\AsnDecoder.Enumerated.cs (4)
123Type tEnum = typeof(TEnum); 192Type enumType, 204Type backingType = enumType.GetEnumUnderlyingType(); 404public Enum ReadEnumeratedValue(Type enumType, Asn1Tag? expectedTag = null)
System\Formats\Asn1\AsnDecoder.NamedBitList.cs (4)
112Type tFlagsEnum = typeof(TFlagsEnum); 180Type flagsEnumType, 189Type backingType = flagsEnumType.GetEnumUnderlyingType(); 538public Enum ReadNamedBitListValue(Type flagsEnumType, Asn1Tag? expectedTag = null)
System\Formats\Asn1\AsnWriter.Enumerated.cs (2)
73private void WriteEnumeratedValue(Asn1Tag tag, Type tEnum, object value) 77Type backingType = tEnum.GetEnumUnderlyingType();
System\Formats\Asn1\AsnWriter.NamedBitList.cs (2)
109private void WriteNamedBitList(Asn1Tag? tag, Type tEnum, Enum value) 111Type backingType = tEnum.GetEnumUnderlyingType();
System.Formats.Nrbf (11)
System\Formats\Nrbf\ArrayRecord.cs (2)
68public Array GetArray(Type expectedArrayType, bool allowNulls = true) 89private protected abstract Array Deserialize(Type arrayType, bool allowNulls);
System\Formats\Nrbf\ArrayRectangularPrimitiveRecord.cs (1)
43private protected override Array Deserialize(Type arrayType, bool allowNulls)
System\Formats\Nrbf\JaggedArrayRecord.cs (1)
46private protected override Array Deserialize(Type arrayType, bool allowNulls)
System\Formats\Nrbf\RectangularArrayRecord.cs (3)
18private readonly Type _elementType; 25internal RectangularArrayRecord(Type elementType, ArrayInfo arrayInfo, MemberTypeInfo memberTypeInfo, int[] lengths) : base(arrayInfo) 45private protected override Array Deserialize(Type arrayType, bool allowNulls)
System\Formats\Nrbf\SerializationRecord.cs (3)
54public bool TypeNameMatches(Type type) 68private static bool Matches(Type type, TypeName typeName) 129Type[] genericTypes = type.GetGenericArguments();
System\Formats\Nrbf\SZArrayRecord.cs (1)
40private protected override Array Deserialize(Type arrayType, bool allowNulls) => GetArray(allowNulls);
System.IO.FileSystem.AccessControl (5)
artifacts\obj\System.IO.FileSystem.AccessControl\Debug\net10.0\System.IO.FileSystem.AccessControl.notsupported.cs (5)
34public System.Security.AccessControl.AuthorizationRuleCollection GetAccessRules(bool includeExplicit, bool includeInherited, System.Type targetType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } 35public System.Security.AccessControl.AuthorizationRuleCollection GetAuditRules(bool includeExplicit, bool includeInherited, System.Type targetType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } 104public override System.Type AccessRightType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 105public override System.Type AccessRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 106public override System.Type AuditRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } }
System.IO.IsolatedStorage (6)
System\IO\IsolatedStorage\IsolatedStorage.cs (3)
135protected void InitStore(IsolatedStorageScope scope, Type appEvidenceType) 140protected void InitStore(IsolatedStorageScope scope, Type? domainEvidenceType, Type? assemblyEvidenceType)
System\IO\IsolatedStorage\IsolatedStorageFile.cs (3)
515public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Type? applicationEvidenceType) 527public static IsolatedStorageFile GetStore(IsolatedStorageScope scope, Type? domainEvidenceType, Type? assemblyEvidenceType)
System.IO.Packaging (2)
System\IO\Packaging\InternalRelationshipCollection.cs (1)
34private static readonly UriKind DotNetRelativeOrAbsolute = Type.GetType("Mono.Runtime") == null ? UriKind.RelativeOrAbsolute : (UriKind)300;
System\IO\Packaging\XmlWrappingReader.cs (1)
39public override System.Type ValueType { get { return _reader.ValueType; } }
System.IO.Pipes.AccessControl (3)
artifacts\obj\System.IO.Pipes.AccessControl\Debug\net10.0\System.IO.Pipes.AccessControl.notsupported.cs (3)
32public override System.Type AccessRightType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 33public override System.Type AccessRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 34public override System.Type AuditRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } }
System.Linq (1)
System\Linq\OrderBy.cs (1)
145Type t = typeof(T);
System.Linq.Expressions (916)
System\Dynamic\BinaryOperationBinder.cs (1)
29public sealed override Type ReturnType => typeof(object);
System\Dynamic\BindingRestrictions.cs (3)
63public static BindingRestrictions GetTypeRestriction(Expression expression, Type type) 258private readonly Type _type; 260internal TypeRestriction(Expression parameter, Type type)
System\Dynamic\ConvertBinder.cs (3)
21protected ConvertBinder(Type type, bool @explicit) 32public Type Type { get; } 79public sealed override Type ReturnType => Type;
System\Dynamic\CreateInstanceBinder.cs (1)
29public sealed override Type ReturnType => typeof(object);
System\Dynamic\DeleteIndexBinder.cs (1)
29public sealed override Type ReturnType => typeof(void);
System\Dynamic\DeleteMemberBinder.cs (1)
42public sealed override Type ReturnType => typeof(void);
System\Dynamic\DynamicMetaObject.cs (4)
72/// Gets the <see cref="Type"/> of the runtime value or null if the <see cref="DynamicMetaObject"/> has no value associated with it. 74public Type? RuntimeType 80Type ct = Expression.Type; 100public Type LimitType => RuntimeType ?? Expression.Type;
System\Dynamic\DynamicMetaObjectBinder.cs (4)
36public virtual Type ReturnType => typeof(object); 62Type expectedResult; 171public Expression GetUpdateExpression(Type type) 213Type delegateType = DelegateHelpers.MakeDeferredSiteDelegate(args, ReturnType);
System\Dynamic\GetIndexBinder.cs (1)
29public sealed override Type ReturnType => typeof(object);
System\Dynamic\GetMemberBinder.cs (1)
32public sealed override Type ReturnType => typeof(object);
System\Dynamic\InvokeBinder.cs (1)
29public sealed override Type ReturnType => typeof(object);
System\Dynamic\InvokeMemberBinder.cs (1)
35public sealed override Type ReturnType => typeof(object);
System\Dynamic\SetIndexBinder.cs (1)
29public sealed override Type ReturnType => typeof(object);
System\Dynamic\SetMemberBinder.cs (1)
32public sealed override Type ReturnType => typeof(object);
System\Dynamic\UnaryOperationBinder.cs (1)
29public sealed override Type ReturnType
System\Dynamic\Utils\CachedReflectionInfo.cs (2)
14s_String_Format_String_ObjectArray ??= typeof(string).GetMethod(nameof(string.Format), new Type[] { typeof(string), typeof(object[]) })!; 18s_InvalidCastException_Ctor_String ??= typeof(InvalidCastException).GetConstructor(new Type[] { typeof(string) })!;
System\Dynamic\Utils\DelegateHelpers.cs (24)
23public static Func<Type, Func<object?[], object?>, Delegate> CreateObjectArrayDelegate { get; } 26private static Func<Type, Func<object?[], object?>, Delegate> CreateObjectArrayDelegateInternal() 33return Type.GetType("Internal.Runtime.Augments.DynamicDelegateAugments, System.Private.CoreLib", throwOnError: true)! 35.CreateDelegate<Func<Type, Func<object?[], object?>, Delegate>>(); 39return new Func<Type, Func<object?[], object?>, Delegate>((_x, _y) => throw new NotImplementedException()); 55internal static Delegate CreateObjectArrayDelegate(Type delegateType, Func<object?[], object?> handler) 70private static readonly CacheDict<Type, MethodInfo> s_thunks = new CacheDict<Type, MethodInfo>(256); 111Type delHelpers = typeof(DelegateHelpers); 119Type delHelpers = typeof(DelegateHelpers); 128private static MethodInfo? GetCSharpThunk(Type returnType, bool hasReturnValue, ParameterInfo[] parameters) 144Type parameterType = parameter.ParameterType; 155Type[] thunkTypeArgs = thunkTypeArgCount == 0 ? Type.EmptyTypes : new Type[thunkTypeArgCount]; 201private static Delegate CreateObjectArrayDelegateRefEmit(Type delegateType, Func<object?[], object?> handler) 207Type returnType = delegateInvokeMethod.ReturnType; 234Type[] paramTypes = new Type[parameters.Length + 1]; 277Type paramType = parameters[i].ParameterType; 291Type boxType = ConvertToBoxableType(paramType); 319Type byrefToType = parameters[i].ParameterType.GetElementType()!; 348private static Type ConvertToBoxableType(Type t)
System\Dynamic\Utils\ExpressionUtils.cs (3)
157Type pType = pi.ParameterType; 219public static bool TryQuote(Type parameterType, ref Expression argument) 224Type quoteable = typeof(LambdaExpression);
System\Dynamic\Utils\TypeExtensions.cs (6)
20[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] this Type type, 22Type[] types) 38private static bool MatchesArgumentTypes(this MethodInfo? mi, Type[] argTypes) 65public static Type GetReturnType(this MethodBase mi) => mi.IsConstructor ? mi.DeclaringType! : ((MethodInfo)mi).ReturnType; 67public static TypeCode GetTypeCode(this Type type) => Type.GetTypeCode(type);
System\Dynamic\Utils\TypeUtils.cs (97)
15private static readonly Type[] s_arrayAssignableInterfaces = typeof(int[]).GetInterfaces() 22public static Type GetNonNullableType(this Type type) => IsNullableType(type) ? type.GetGenericArguments()[0] : type; 25public static Type GetNullableType(this Type type) 40public static Type LiftPrimitiveOrThrow(this Type type) 93public static ConstructorInfo GetNullableConstructor(Type nullableType) 100public static bool IsNullableType(this Type type) => type.IsConstructedGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); 102public static bool IsNullableOrReferenceType(this Type type) => !type.IsValueType || IsNullableType(type); 104public static bool IsBool(this Type type) => GetNonNullableType(type) == typeof(bool); 106public static bool IsNumeric(this Type type) 131public static bool IsInteger(this Type type) 153public static bool IsInteger64(this Type type) 169public static bool IsArithmetic(this Type type) 191public static bool IsUnsignedInt(this Type type) 208public static bool IsIntegerOrBool(this Type type) 231public static bool IsNumericOrBool(this Type type) => IsNumeric(type) || IsBool(type); 234public static bool IsValidInstanceType(MemberInfo member, Type instanceType) 236Type? targetType = member.DeclaringType; 274static Type[] GetTypeInterfaces(Type instanceType) => instanceType.GetInterfaces(); 275foreach (Type interfaceType in GetTypeInterfaces(instanceType)) 288public static bool HasIdentityPrimitiveOrNullableConversionTo(this Type source, Type dest) 319public static bool HasReferenceConversionTo(this Type source, Type dest) 331Type nnSourceType = GetNonNullableType(source); 332Type nnDestType = GetNonNullableType(dest); 364private static bool StrictHasReferenceConversionTo(this Type source, Type dest, bool skipNonArray) 439private static bool HasArrayToInterfaceConversion(Type source, Type dest) 447Type[] destParams = dest.GetGenericArguments(); 453Type destGen = dest.GetGenericTypeDefinition(); 455foreach (Type iface in s_arrayAssignableInterfaces) 466private static bool HasInterfaceToArrayConversion(Type source, Type dest) 474Type[] sourceParams = source.GetGenericArguments(); 480Type sourceGen = source.GetGenericTypeDefinition(); 482foreach (Type iface in s_arrayAssignableInterfaces) 493private static bool IsCovariant(Type t) 499private static bool IsContravariant(Type t) 505private static bool IsInvariant(Type t) 511private static bool IsDelegate(Type t) 517public static bool IsLegalExplicitVariantDelegateConversion(Type source, Type dest) 536Type genericDelegate = source.GetGenericTypeDefinition(); 543Type[] genericParameters = genericDelegate.GetGenericArguments(); 544Type[] sourceArguments = source.GetGenericArguments(); 545Type[] destArguments = dest.GetGenericArguments(); 555Type sourceArgument = sourceArguments[iParam]; 556Type destArgument = destArguments[iParam]; 566Type genericParameter = genericParameters[iParam]; 591public static bool IsConvertible(this Type type) 620public static bool HasReferenceEquality(Type left, Type right) 637public static bool HasBuiltInEqualityOperator(Type left, Type right) 674Type nnType = GetNonNullableType(left); 678public static bool IsImplicitlyConvertibleTo(this Type source, Type destination) => 687public static MethodInfo? GetUserDefinedCoercionMethod(Type convertFrom, Type convertToType) 689Type nnExprType = GetNonNullableType(convertFrom); 690Type nnConvType = GetNonNullableType(convertToType); 721private static MethodInfo? FindConversionOperator(MethodInfo[] methods, Type? typeFrom, Type? typeTo) 738private static bool IsImplicitNumericConversion(Type source, Type destination) 856private static bool IsImplicitReferenceConversion(Type source, Type destination) => 859private static bool IsImplicitBoxingConversion(Type source, Type destination) => 862private static bool IsImplicitNullableConversion(Type source, Type destination) => 865public static Type? FindGenericType(Type definition, Type? type) 894public static MethodInfo? GetBooleanOperator(Type type, string name) 912public static Type GetNonRefType(this Type type) => type.IsByRef ? type.GetElementType()! : type; 914public static bool AreEquivalent(Type? t1, Type? t2) => t1 != null && t1.IsEquivalentTo(t2); 916public static bool AreReferenceAssignable(Type dest, Type src) 927public static bool IsSameOrSubclass(Type type, Type subType) => 930public static void ValidateType(Type type, string? paramName) => ValidateType(type, paramName, false, false); 932public static void ValidateType(Type type, string? paramName, bool allowByRef, bool allowPointer) 948public static bool ValidateType(Type type, string? paramName, int index) 967public static MethodInfo GetInvokeMethod(this Type delegateType) 973internal static bool IsUnsigned(this Type type) => IsUnsigned(GetNonNullableType(type).GetTypeCode()); 991internal static bool IsFloatingPoint(this Type type) => IsFloatingPoint(GetNonNullableType(type).GetTypeCode()); 1008public static MethodInfo GetArrayGetMethod(Type arrayType) 1016public static MethodInfo GetArraySetMethod(Type arrayType) 1024public static MethodInfo GetArrayAddressMethod(Type arrayType)
System\Linq\Expressions\BinaryExpression.cs (51)
313internal static BinaryExpression Create(ExpressionType nodeType, Expression left, Expression right, Type type, MethodInfo? method, LambdaExpression? conversion) 336Type left = Left.Type; 337Type right = Right.Type; 354Type left = Left.Type; 355Type right = Right.Type; 466public sealed override Type Type => typeof(bool); 493public sealed override Type Type => Left.Type; 525public sealed override Type Type => Right.Type; 535internal OpAssignMethodConversionBinaryExpression(ExpressionType nodeType, Expression left, Expression right, Type type, MethodInfo method, LambdaExpression conversion) 548internal SimpleBinaryExpression(ExpressionType nodeType, Expression left, Expression right, Type type) 557public sealed override Type Type { get; } 566internal MethodBinaryExpression(ExpressionType nodeType, Expression left, Expression right, Type type, MethodInfo method) 613Type nnLeftType = left.Type.GetNonNullableType(); 614Type nnRightType = right.Type.GetNonNullableType(); 717private static MethodInfo? GetUserDefinedBinaryOperator(ExpressionType binaryType, Type leftType, Type rightType, string name) 721Type[] types = new Type[] { leftType, rightType }; 722Type nnLeftType = leftType.GetNonNullableType(); 723Type nnRightType = rightType.GetNonNullableType(); 737private static bool IsLiftingConditionalLogicalOperator(Type left, Type right, MethodInfo? method, ExpressionType binaryType) 745internal static bool ParameterIsAssignable(ParameterInfo pi, Type argType) 747Type pType = pi.ParameterType; 753private static void ValidateParamsWithOperandsOrThrow(Type paramType, Type operandType, ExpressionType exprType, string name) 799private static void ValidateUserDefinedConditionalLogicOperator(ExpressionType nodeType, Type left, Type right, MethodInfo method) 827Type? declaringType = method.DeclaringType; 843private static void VerifyOpTrueFalse(ExpressionType nodeType, Type left, MethodInfo opTrue, string paramName) 856private static bool IsValidLiftedConditionalLogicalOperator(Type left, Type right, ParameterInfo[] pms) 1270Type returnType; 1323Type returnType; 1383Type resultType = ValidateCoalesceArgTypes(left.Type, right.Type); 1392Type delegateType = conversion.Type; 1423private static Type ValidateCoalesceArgTypes(Type left, Type right) 1425Type leftStripped = left.GetNonNullableType(); 1548Type delegateType = conversion.Type; 2230private static bool IsSimpleShift(Type left, Type right) 2236private static Type GetResultTypeOfShift(Type left, Type right) 2275Type resultType = GetResultTypeOfShift(left.Type, right.Type); 2334Type resultType = GetResultTypeOfShift(left.Type, right.Type); 2371Type resultType = GetResultTypeOfShift(left.Type, right.Type); 2430Type resultType = GetResultTypeOfShift(left.Type, right.Type); 2851Type arrayType = array.Type;
System\Linq\Expressions\BlockExpression.cs (9)
56/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 57public override Type Type => GetExpression(ExpressionCount - 1).Type; 642internal ScopeWithType(IReadOnlyList<ParameterExpression> variables, IReadOnlyList<Expression> expressions, Type type) 648public sealed override Type Type { get; } 925public static BlockExpression Block(Type type, params Expression[] expressions) 937public static BlockExpression Block(Type type, IEnumerable<Expression> expressions) 960public static BlockExpression Block(Type type, IEnumerable<ParameterExpression>? variables, params Expression[] expressions) 999public static BlockExpression Block(Type type, IEnumerable<ParameterExpression>? variables, IEnumerable<Expression> expressions) 1027private static BlockExpression BlockCore(Type? type, ReadOnlyCollection<ParameterExpression> variables, ReadOnlyCollection<Expression> expressions)
System\Linq\Expressions\CatchBlock.cs (5)
16internal CatchBlock(Type test, ParameterExpression? variable, Expression body, Expression? filter) 32public Type Test { get; } 82public static CatchBlock Catch(Type type, Expression body) 107public static CatchBlock Catch(Type type, Expression body, Expression? filter) 135public static CatchBlock MakeCatchBlock(Type type, ParameterExpression? variable, Expression body, Expression? filter)
System\Linq\Expressions\Common\CachedReflectionInfo.cs (4)
71s_MethodInfo_CreateDelegate_Type_Object ??= typeof(MethodInfo).GetMethod(nameof(MethodInfo.CreateDelegate), new[] { typeof(Type), typeof(object) })!; 91s_Type_GetTypeFromHandle ??= typeof(Type).GetMethod(nameof(Type.GetTypeFromHandle))!; 156s_RuntimeOps_CreateRuntimeVariables ??= typeof(RuntimeOps).GetMethod(nameof(RuntimeOps.CreateRuntimeVariables), Type.EmptyTypes)!;
System\Linq\Expressions\Common\ConstantCheck.cs (4)
50private static AnalyzeTypeIsResult AnalyzeTypeIs(Expression operand, Type testType) 52Type operandType = operand.Type; 70Type nnOperandType = operandType.GetNonNullableType(); 71Type nnTestType = testType.GetNonNullableType();
System\Linq\Expressions\Compiler\AssemblyGen.cs (1)
42private TypeBuilder DefineType(string name, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type parent, TypeAttributes attr)
System\Linq\Expressions\Compiler\BoundConstants.cs (5)
30internal readonly Type Type; 32internal TypedConstant(object value, Type type) 83internal void AddReference(object value, Type type) 95internal void EmitConstant(LambdaCompiler lc, object value, Type type) 181private void EmitConstantFromArray(LambdaCompiler lc, object value, Type type)
System\Linq\Expressions\Compiler\CompilerScope.cs (4)
324Type boxType = typeof(StrongBox<>).MakeGenericType(v.Type); 331lc.IL.Emit(OpCodes.Newobj, boxType.GetConstructor(new Type[] { v.Type })!); 337lc.IL.Emit(OpCodes.Newobj, boxType.GetConstructor(new Type[] { v.Type })!); 342lc.IL.Emit(OpCodes.Newobj, boxType.GetConstructor(Type.EmptyTypes)!);
System\Linq\Expressions\Compiler\CompilerScope.Storage.cs (3)
107private readonly Type _boxType; 115Type boxType = typeof(StrongBox<>).MakeGenericType(variable.Type); 167Type boxType = typeof(StrongBox<>).MakeGenericType(variable.Type);
System\Linq\Expressions\Compiler\DelegateHelpers.cs (12)
23internal static Type MakeCallSiteDelegate(ReadOnlyCollection<Expression> types, Type returnType) 58internal static Type MakeDeferredSiteDelegate(DynamicMetaObject[] args, Type returnType) 71Type paramType = mo.Expression.Type; 87Type[] paramTypes = new Type[args.Length + 2]; 93Type paramType = mo.Expression.Type; 113private static System.Reflection.TypeInfo MakeNewCustomDelegate(Type[] types) 117Type returnType = types[types.Length - 1]; 118Type[] parameters = types.RemoveLast(); 119Type[] delegateCtorSignature = { typeof(object), typeof(IntPtr) };
System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs (21)
19internal static Type MakeDelegateType(Type[] types) 35curTypeInfo.DelegateType = MakeNewDelegate((Type[])types.Clone()); 42internal static TypeInfo NextTypeInfo(Type initialArg) 50internal static TypeInfo GetNextTypeInfo(Type initialArg, TypeInfo curTypeInfo) 64public Type DelegateType; 65public Dictionary<Type, TypeInfo> TypeChain; 68private static TypeInfo NextTypeInfo(Type initialArg, TypeInfo curTypeInfo) 70Type lookingUp = initialArg; 72curTypeInfo.TypeChain ??= new Dictionary<Type, TypeInfo>(); 96private static Type TryMakeVBStyledCallSite(Type[] types) 108Type t = types[i]; 134internal static Type MakeNewDelegate(Type[] types) 152Type type = types[i]; 173Type result; 188internal static Type GetFuncType(Type[] types) 233internal static Type GetActionType(Type[] types)
System\Linq\Expressions\Compiler\ILGen.cs (48)
17private static readonly MethodInfo s_nullableGetValueOrDefault = typeof(Nullable<>).GetMethod("GetValueOrDefault", Type.EmptyTypes)!; 63internal static void EmitLoadValueIndirect(this ILGenerator il, Type type) 116internal static void EmitStoreValueIndirect(this ILGenerator il, Type type) 161internal static void EmitLoadElement(this ILGenerator il, Type type) 213internal static void EmitStoreElement(this ILGenerator il, Type type) 256internal static void EmitType(this ILGenerator il, Type type) 361internal static bool CanEmitConstant(object? value, Type type) 368if (value is Type t) 377private static bool CanEmitILConstant(Type type) 404internal static bool TryEmitConstant(this ILGenerator il, object? value, Type type, ILocalCache locals) 422if (value is Type t) 427if (type != typeof(Type)) 441Type? dt = mb.DeclaringType; 463private static bool ShouldLdtoken(Type t) 478Type? dt = mb.DeclaringType; 482private static bool TryEmitILConstant(this ILGenerator il, object value, Type type) 488Type nonNullType = type.GetNonNullableType(); 552internal static void EmitConvertToType(this ILGenerator il, Type typeFrom, Type typeTo, bool isChecked, ILocalCache locals) 564Type nnExprType = typeFrom.GetNonNullableType(); 565Type nnType = typeTo.GetNonNullableType(); 599private static void EmitCastToType(this ILGenerator il, Type typeFrom, Type typeTo) 617private static void EmitNumericConversion(this ILGenerator il, Type typeFrom, Type typeTo, bool isChecked) 787private static void EmitNullableToNullableConversion(this ILGenerator il, Type typeFrom, Type typeTo, bool isChecked, ILocalCache locals) 803Type nnTypeFrom = typeFrom.GetNonNullableType(); 804Type nnTypeTo = typeTo.GetNonNullableType(); 821private static void EmitNonNullableToNullableConversion(this ILGenerator il, Type typeFrom, Type typeTo, bool isChecked, ILocalCache locals) 825Type nnTypeTo = typeTo.GetNonNullableType(); 831private static void EmitNullableToNonNullableConversion(this ILGenerator il, Type typeFrom, Type typeTo, bool isChecked, ILocalCache locals) 842private static void EmitNullableToNonNullableStructConversion(this ILGenerator il, Type typeFrom, Type typeTo, bool isChecked, ILocalCache locals) 852Type nnTypeFrom = typeFrom.GetNonNullableType(); 857private static void EmitNullableToReferenceConversion(this ILGenerator il, Type typeFrom) 866private static void EmitNullableConversion(this ILGenerator il, Type typeFrom, Type typeTo, bool isChecked, ILocalCache locals) 879internal static void EmitHasValue(this ILGenerator il, Type nullableType) 888internal static void EmitGetValue(this ILGenerator il, Type nullableType) 897internal static void EmitGetValueOrDefault(this ILGenerator il, Type nullableType) 934internal static void EmitArray(this ILGenerator il, Type elementType, int count) 950internal static void EmitArray(this ILGenerator il, Type arrayType) 961Type[] types = new Type[arrayType.GetArrayRank()]; 1056internal static void EmitDefault(this ILGenerator il, Type type, ILocalCache? locals)
System\Linq\Expressions\Compiler\LambdaCompiler.Address.cs (16)
13private void EmitAddress(Expression node, Type type) 22private void EmitAddress(Expression node, Type type, CompilationFlags flags) 66private void AddressOf(BinaryExpression node, Type type) 83private void AddressOf(ParameterExpression node, Type type) 112private void AddressOf(MemberExpression node, Type type) 117Type? objectType = null; 131private void EmitMemberAddress(MemberInfo member, Type? objectType) 165private void AddressOf(MethodCallExpression node, Type type) 186private void AddressOf(IndexExpression node, Type type) 207private void AddressOf(UnaryExpression node, Type type) 217private void EmitExpressionAddress(Expression node, Type type) 232private WriteBack? EmitAddressWriteBack(Expression node, Type type) 274Type? instanceType = null; 323Type? instanceType = null; 377private LocalBuilder GetInstanceLocal(Type type) 379Type instanceLocalType = type.IsValueType ? type.MakeByRefType() : type;
System\Linq\Expressions\Compiler\LambdaCompiler.Binary.cs (21)
100Type resultType; 129private void EmitBinaryOperator(ExpressionType op, Type leftType, Type rightType, Type resultType, bool liftedToNull) 148private void EmitUnliftedBinaryOp(ExpressionType op, Type leftType, Type rightType) 255private void EmitShiftMask(Type leftType) 266private void EmitConvertArithmeticResult(ExpressionType op, Type resultType) 287private void EmitLiftedBinaryOp(ExpressionType op, Type leftType, Type rightType, Type resultType, bool liftedToNull) 346private void EmitLiftedRelational(ExpressionType op, Type type) 367Type unnullable = type.GetNonNullableType(); 384private void EmitLiftedToNullRelational(ExpressionType op, Type type) 410Type unnullable = type.GetNonNullableType(); 417private void EmitLiftedBinaryArithmetic(ExpressionType op, Type leftType, Type rightType, Type resultType) 479Type resultNonNullableType = resultType.GetNonNullableType(); 505Type type = typeof(bool?); 536Type type = typeof(bool?);
System\Linq\Expressions\Compiler\LambdaCompiler.cs (5)
17LocalBuilder GetLocal(Type type); 64private readonly KeyedStack<Type, LocalBuilder> _freeLocals = new KeyedStack<Type, LocalBuilder>(); 71Type[] parameterTypes = GetParameterTypes(lambda, typeof(Closure)); 227public LocalBuilder GetLocal(Type type) => _freeLocals.TryPop(type) ?? _ilg.DeclareLocal(type);
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (31)
123private void EmitExpressionAsType(Expression node, Type type, CompilationFlags flags) 232Type? objectType = null; 258Type? objectType = null; 293private void EmitGetIndexCall(IndexExpression node, Type? objectType) 307private void EmitGetArrayElement(Type arrayType) 321private void EmitSetIndexCall(IndexExpression node, Type? objectType) 335private void EmitSetArrayElement(Type arrayType) 373Type? objectType = null; 392private void EmitMethodCall(MethodInfo mi, IArgumentProvider args, Type? objectType) 398private void EmitMethodCall(MethodInfo mi, IArgumentProvider args, Type? objectType, CompilationFlags flags) 422Type[] types = new Type[count]; 451private void EmitCall(Type? objectType, MethodInfo method) 523Type type = parameter.ParameterType; 571private void EmitConstant(object? value, Type type) 594Type siteType = site.GetType(); 614private static FieldInfo GetCallSiteTargetField(Type siteType) 655Type type = node.Expression.Type; 793Type? objectType = null; 836Type? instanceType = null; 846private void EmitMemberGet(MemberInfo member, Type? objectType) 869private void EmitInstance(Expression instance, out Type type) 905Type elementType = node.Type.GetElementType()!; 941private void EmitBinding(MemberBinding binding, Type objectType) 957private void EmitMemberAssignment(MemberAssignment binding, Type objectType) 973Type type = GetMemberType(binding.Member); 991Type type = GetMemberType(binding.Member); 1027private void EmitMemberInit(ReadOnlyCollection<MemberBinding> bindings, bool keepOnStack, Type objectType) 1071private void EmitListInit(ReadOnlyCollection<ElementInit> initializers, bool keepOnStack, Type objectType) 1102private static Type GetMemberType(MemberInfo member) 1112private void EmitLift(ExpressionType nodeType, Type resultType, MethodCallExpression mc, ParameterExpression[] paramList, Expression[] argList)
System\Linq\Expressions\Compiler\LambdaCompiler.Lambda.cs (6)
94Type delegateType = inner._lambda.Type; 156private static Type[] GetParameterTypes(LambdaExpression lambda, Type firstType) 160Type[] result; 165result = new Type[count + 1]; 171result = new Type[count];
System\Linq\Expressions\Compiler\LambdaCompiler.Logical.cs (3)
123Type nnLeftType = b.Left.Type.GetNonNullableType(); 238Type type = typeof(bool?); 341Type type = typeof(bool?);
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (6)
238private static Type GetTestValueType(SwitchExpression node) 248Type result = node.Comparison.GetParametersCached()[1].ParameterType.GetNonRefType(); 277internal readonly Type Type; 342private static bool CanOptimizeSwitchType(Type valueType) 373Type type = node.SwitchValue.Type; 828Type tryType = node.Type;
System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs (8)
74Type type = node.Type; 90Type nnType = type.GetNonNullableType(); 120private void EmitUnaryOperator(ExpressionType op, Type operandType, Type resultType) 163Type nnOperandType = resultType.GetNonNullableType(); 250private void EmitConstantOne(Type type) 310Type paramType = pis[0].ParameterType; 357Type resultType = mc.Type.GetNullableType();
System\Linq\Expressions\Compiler\StackSpiller.Temps.cs (3)
26private ParameterExpression MakeTemp(Type type) => _tm.Temp(type); 68Type tempType = byRef ? expression.Type.MakeByRefType() : expression.Type; 109internal ParameterExpression Temp(Type type)
System\Linq\Expressions\Compiler\TypeInfoExtensions.cs (6)
13public static Type MakeDelegateType(this DelegateHelpers.TypeInfo info, Type retType, params Expression[] args) 19public static Type MakeDelegateType(this DelegateHelpers.TypeInfo info, Type retType, IList<Expression> args) 23Type[] paramTypes = new Type[args.Count + 2];
System\Linq\Expressions\ConditionalExpression.cs (6)
22internal static ConditionalExpression Make(Expression test, Expression ifTrue, Expression ifFalse, Type type) 48/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 49public override Type Type => IfTrue.Type; 114internal FullConditionalExpressionWithType(Expression test, Expression ifTrue, Expression ifFalse, Type type) 120public sealed override Type Type { get; } 165public static ConditionalExpression Condition(Expression test, Expression ifTrue, Expression ifFalse, Type type)
System\Linq\Expressions\ConstantExpression.cs (6)
23/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 24public override Type Type 60internal TypedConstantExpression(object? value, Type type) 66public sealed override Type Type { get; } 95public static ConstantExpression Constant(object? value, Type type) 113Type valueType = value.GetType();
System\Linq\Expressions\DebugInfoExpression.cs (2)
27/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 28public sealed override Type Type => typeof(void);
System\Linq\Expressions\DebugViewWriter.cs (1)
488private static string? GetConstantValueSuffix(Type type)
System\Linq\Expressions\DefaultExpression.cs (4)
15internal DefaultExpression(Type type) 23/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 24public sealed override Type Type { get; } 64public static DefaultExpression Default(Type type)
System\Linq\Expressions\DynamicExpression.cs (65)
22internal DynamicExpression(Type delegateType, CallSiteBinder binder) 51internal static DynamicExpression Make(Type returnType, Type delegateType, CallSiteBinder binder, ReadOnlyCollection<Expression> arguments) 63internal static DynamicExpression Make(Type returnType, Type delegateType, CallSiteBinder binder, Expression arg0) 75internal static DynamicExpression Make(Type returnType, Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1) 87internal static DynamicExpression Make(Type returnType, Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2) 99internal static DynamicExpression Make(Type returnType, Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2, Expression arg3) 115public override Type Type => typeof(object); 133public Type DelegateType { get; } 244public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, params Expression[] arguments) 266public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, IEnumerable<Expression> arguments) 288public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0) 311public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1) 335public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2) 360public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2, Expression arg3) 379public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, IEnumerable<Expression>? arguments) 397public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, params Expression[]? arguments) 415public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0) 434public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1) 454public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2) 475public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2, Expression arg3) 496internal DynamicExpressionN(Type delegateType, CallSiteBinder binder, IReadOnlyList<Expression> arguments) 524internal TypedDynamicExpressionN(Type returnType, Type delegateType, CallSiteBinder binder, IReadOnlyList<Expression> arguments) 531public sealed override Type Type { get; } 538internal DynamicExpression1(Type delegateType, CallSiteBinder binder, Expression arg0) 582internal TypedDynamicExpression1(Type retType, Type delegateType, CallSiteBinder binder, Expression arg0) 588public sealed override Type Type { get; } 596internal DynamicExpression2(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1) 651internal TypedDynamicExpression2(Type retType, Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1) 657public sealed override Type Type { get; } 665internal DynamicExpression3(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2) 726internal TypedDynamicExpression3(Type retType, Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2) 732public sealed override Type Type { get; } 740internal DynamicExpression4(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2, Expression arg3) 807internal TypedDynamicExpression4(Type retType, Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2, Expression arg3) 813public sealed override Type Type { get; } 833public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, params Expression[]? arguments) 851public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, IEnumerable<Expression>? arguments) 891public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0) 921public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1) 954public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2) 990public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2, Expression arg3) 1012private static MethodInfo GetValidMethodForDynamic(Type delegateType) 1037public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, params Expression[] arguments) 1059public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0) 1072Type delegateType = info.DelegateType ?? info.MakeDelegateType(returnType, arg0); 1095public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1) 1112Type delegateType = info.DelegateType ?? info.MakeDelegateType(returnType, arg0, arg1); 1136public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2) 1157Type delegateType = info.DelegateType ?? info.MakeDelegateType(returnType, arg0, arg1, arg2); 1182public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2, Expression arg3) 1207Type delegateType = info.DelegateType ?? info.MakeDelegateType(returnType, arg0, arg1, arg2, arg3); 1229public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, IEnumerable<Expression> arguments) 1240private static DynamicExpression MakeDynamic(CallSiteBinder binder, Type returnType, ReadOnlyCollection<Expression> arguments) 1253Type delegateType = DelegateHelpers.MakeCallSiteDelegate(arguments, returnType); 1276var type = arg.Type;
System\Linq\Expressions\Error.cs (2)
1371internal static ArgumentException InvalidNullValue(Type? type, string? paramName) 1376internal static ArgumentException InvalidTypeException(object? value, Type? type, string? paramName)
System\Linq\Expressions\Expression.cs (19)
31private static readonly CacheDict<Type, MethodInfo> s_lambdaDelegateCache = new CacheDict<Type, MethodInfo>(40); 32private static volatile CacheDict<Type, Func<Expression, string?, bool, ReadOnlyCollection<ParameterExpression>, LambdaExpression>>? s_lambdaFactories; 43public ExtensionInfo(ExpressionType nodeType, Type type) 50internal readonly Type Type; 61protected Expression(ExpressionType nodeType, Type type) 104public virtual Type Type 304public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, IEnumerable<Expression> arguments) => 324public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0) => 345public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1) => 367public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2) => 390public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2, Expression arg3) => 410public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, params Expression[] arguments) => 427public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, IEnumerable<Expression>? arguments) => 444public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0) => 462public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1) => 481public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2) => 501public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2, Expression arg3) => 518public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, params Expression[]? arguments) =>
System\Linq\Expressions\Expression.DebuggerProxy.cs (27)
31public Type Type => _node.Type; 49public Type Type => _node.Type; 65public Type Test => _node.Test; 85public Type Type => _node.Type; 101public Type Type => _node.Type; 124public Type Type => _node.Type; 140public Type Type => _node.Type; 158public Type? Type => _node.Type; 178public Type Type => _node.Type; 196public Type Type => _node.Type; 214public Type Type => _node.Type; 233public Type ReturnType => _node.ReturnType; 235public Type Type => _node.Type; 253public Type Type => _node.Type; 272public Type Type => _node.Type; 290public Type Type => _node.Type; 308public Type Type => _node.Type; 327public Type Type => _node.Type; 344public Type Type => _node.Type; 363public Type Type => _node.Type; 381public Type Type => _node.Type; 397public Type Type => _node.Type; 432public Type Type => _node.Type; 452public Type Type => _node.Type; 469public Type Type => _node.Type; 470public Type TypeOperand => _node.TypeOperand; 490public Type Type => _node.Type;
System\Linq\Expressions\ExpressionStringBuilder.cs (1)
783MethodInfo toString = node.GetType().GetMethod("ToString", Type.EmptyTypes)!;
System\Linq\Expressions\ExpressionVisitor.cs (2)
686private static void ValidateChildType(Type before, Type after, string methodName)
System\Linq\Expressions\GotoExpression.cs (21)
38internal GotoExpression(GotoExpressionKind kind, LabelTarget target, Expression? value, Type type) 49/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 50public sealed override Type Type { get; } 134/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 140public static GotoExpression Break(LabelTarget target, Type type) 151/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 158public static GotoExpression Break(LabelTarget target, Expression? value, Type type) 181/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 188public static GotoExpression Continue(LabelTarget target, Type type) 211/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 218public static GotoExpression Return(LabelTarget target, Type type) 244/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 251public static GotoExpression Return(LabelTarget target, Expression? value, Type type) 274/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 281public static GotoExpression Goto(LabelTarget target, Type type) 307/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 314public static GotoExpression Goto(LabelTarget target, Expression? value, Type type) 326/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 333public static GotoExpression MakeGoto(GotoExpressionKind kind, LabelTarget target, Expression? value, Type type) 339private static void ValidateGoto(LabelTarget target, ref Expression? value, string targetParameter, string valueParameter, Type? type) 358private static void ValidateGotoType(Type expectedType, ref Expression value, string paramName)
System\Linq\Expressions\IDynamicExpression.cs (1)
14Type DelegateType { get; }
System\Linq\Expressions\IndexExpression.cs (11)
48/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 49public sealed override Type Type 158/// or through <see cref="NewArrayBounds(Type, Expression[])"/> or <see cref="NewArrayInit(Type, Expression[])"/>.</remarks> 171/// or through <see cref="NewArrayBounds(Type, IEnumerable{Expression})"/> or <see cref="NewArrayInit(Type, IEnumerable{Expression})"/>.</remarks> 177Type arrayType = array.Type; 228[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type, 271[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type, 414Type valueType = setParameters[setParameters.Length - 1].ParameterType; 504Type pType = pi.ParameterType;
System\Linq\Expressions\Interpreter\AddInstruction.cs (2)
163public static Instruction Create(Type type) 299public static Instruction Create(Type type)
System\Linq\Expressions\Interpreter\AndInstruction.cs (1)
174public static Instruction Create(Type type) =>
System\Linq\Expressions\Interpreter\ArrayOperations.cs (6)
11private readonly Type _elementType; 14internal NewArrayInitInstruction(Type elementType, int elementCount) 39private readonly Type _elementType; 41internal NewArrayInstruction(Type elementType) 64private readonly Type _elementType; 67internal NewArrayBoundsInstruction(Type elementType, int rank)
System\Linq\Expressions\Interpreter\CallInstruction.cs (5)
121Type arrayType = info.DeclaringType!; 173private static Type? TryGetParameterOrReturnType(MethodInfo target, ParameterInfo[] pi, int index) 212List<Type> types = new List<Type>(); 222Type[] arrTypes = types.ToArray();
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (6)
38Type t = TryGetParameterOrReturnType(target, pi, 0); 78Type t = TryGetParameterOrReturnType(target, pi, 1); 122Type t = TryGetParameterOrReturnType(target, pi, 2); 164private static Type GetHelperType(MethodInfo info, Type[] arrTypes) 166Type t;
System\Linq\Expressions\Interpreter\DecrementInstruction.cs (1)
155public static Instruction Create(Type type)
System\Linq\Expressions\Interpreter\DefaultValueInstruction.cs (2)
13private readonly Type _type; 15internal DefaultValueInstruction(Type type)
System\Linq\Expressions\Interpreter\DivInstruction.cs (1)
163public static Instruction Create(Type type)
System\Linq\Expressions\Interpreter\EqualInstruction.cs (1)
510public static Instruction Create(Type type, bool liftedToNull)
System\Linq\Expressions\Interpreter\ExclusiveOrInstruction.cs (1)
162public static Instruction Create(Type type) =>
System\Linq\Expressions\Interpreter\GreaterThanInstruction.cs (1)
277public static Instruction Create(Type type, bool liftedToNull = false)
System\Linq\Expressions\Interpreter\GreaterThanOrEqualInstruction.cs (1)
277public static Instruction Create(Type type, bool liftedToNull = false)
System\Linq\Expressions\Interpreter\IncrementInstruction.cs (1)
155public static Instruction Create(Type type)
System\Linq\Expressions\Interpreter\InstructionList.cs (32)
344public void EmitLoad(object? value, Type? type) 575public void EmitInitializeLocal(int index, Type type) 637public void EmitNewArray(Type elementType) => Emit(new NewArrayInstruction(elementType)); 640public void EmitNewArrayBounds(Type elementType, int rank) 646public void EmitNewArrayInit(Type elementType, int elementCount) 655public void EmitAdd(Type type, bool @checked) 660public void EmitSub(Type type, bool @checked) 665public void EmitMul(Type type, bool @checked) 670public void EmitDiv(Type type) 675public void EmitModulo(Type type) 684public void EmitExclusiveOr(Type type) 689public void EmitAnd(Type type) 694public void EmitOr(Type type) 699public void EmitLeftShift(Type type) 704public void EmitRightShift(Type type) 709public void EmitEqual(Type type, bool liftedToNull = false) 714public void EmitNotEqual(Type type, bool liftedToNull = false) 719public void EmitLessThan(Type type, bool liftedToNull) 724public void EmitLessThanOrEqual(Type type, bool liftedToNull) 729public void EmitGreaterThan(Type type, bool liftedToNull) 734public void EmitGreaterThanOrEqual(Type type, bool liftedToNull) 758public void EmitCast(Type toType) 763public void EmitCastToEnum(Type toType) 768public void EmitCastReferenceToEnum(Type toType) 778public void EmitNot(Type type) 787public void EmitDefaultValue(Type type) 817public void EmitNegate(Type type) 822public void EmitNegateChecked(Type type) 827public void EmitIncrement(Type type) 832public void EmitDecrement(Type type) 837public void EmitTypeIs(Type type) 842public void EmitTypeAs(Type type)
System\Linq\Expressions\Interpreter\LeftShiftInstruction.cs (1)
162public static Instruction Create(Type type) =>
System\Linq\Expressions\Interpreter\LessThanInstruction.cs (1)
276public static Instruction Create(Type type, bool liftedToNull = false)
System\Linq\Expressions\Interpreter\LessThanOrEqualInstruction.cs (1)
277public static Instruction Create(Type type, bool liftedToNull = false)
System\Linq\Expressions\Interpreter\LightCompiler.cs (20)
35private readonly Type _exceptionType; 41internal ExceptionHandler(int labelIndex, int handlerStartIndex, int handlerEndIndex, Type exceptionType, ExceptionFilter? filter) 51public bool Matches(Type exceptionType) => _exceptionType.IsAssignableFrom(exceptionType); 121Type exceptionType = unwrappedException.GetType(); 355private void CompileDefaultExpression(Type type) 417private void EmitCopyValueType(Type valueType) 446private static bool MaybeMutableValueType(Type type) 1046Type operandType = operand.Type; 1049Type parameterType = parameter.ParameterType; 1113private void CompileConvertToType(Type typeFrom, Type typeTo, bool isChecked, bool isLiftedToNull) 1139Type nonNullableFrom = typeFrom.GetNonNullableType(); 1140Type nonNullableTo = typeTo.GetNonNullableType(); 1146Type? enumTypeTo = null; 2425Type type = node.Type; 2525Type elementType = node.Type.GetElementType()!; 2604Type typeToCompare = node.Left.Type; 2654Type nnLeftType = node.Left.Type.GetNonNullableType(); 2745Type type = GetMemberType(memberMember.Member); 2759private static Type GetMemberType(MemberInfo member)
System\Linq\Expressions\Interpreter\LightLambda.cs (1)
355internal Delegate MakeDelegate(Type delegateType)
System\Linq\Expressions\Interpreter\LocalAccess.cs (4)
372private readonly Type _type; 374internal MutableValue(int index, Type type) 411private readonly Type _type; 413internal MutableBox(int index, Type type)
System\Linq\Expressions\Interpreter\ModuloInstruction.cs (1)
163public static Instruction Create(Type type)
System\Linq\Expressions\Interpreter\MulInstruction.cs (2)
163public static Instruction Create(Type type) 300public static Instruction Create(Type type)
System\Linq\Expressions\Interpreter\NegateInstruction.cs (2)
104public static Instruction Create(Type type) 180public static Instruction Create(Type type)
System\Linq\Expressions\Interpreter\NotEqualInstruction.cs (1)
492public static Instruction Create(Type type, bool liftedToNull)
System\Linq\Expressions\Interpreter\NotInstruction.cs (1)
171public static Instruction Create(Type type) =>
System\Linq\Expressions\Interpreter\OrInstruction.cs (1)
176public static Instruction Create(Type type)
System\Linq\Expressions\Interpreter\RightShiftInstruction.cs (1)
162public static Instruction Create(Type type)
System\Linq\Expressions\Interpreter\SubInstruction.cs (2)
163public static Instruction Create(Type type) 299public static Instruction Create(Type type)
System\Linq\Expressions\Interpreter\TypeOperations.cs (16)
51private readonly Type _type; 53internal TypeIsInstruction(Type type) 73private readonly Type _type; 75internal TypeAsInstruction(Type type) 149private readonly Type _defaultValueType; 279private readonly Type _t; 281protected CastInstructionNoT(Type t) 286public static new CastInstruction Create(Type t) 303Type valueType = value.GetType(); 329public Ref(Type t) 342public Value(Type t) 354public static Instruction Create(Type t) 382private readonly Type _t; 384public CastToEnumInstruction(Type t) 406private readonly Type _t; 408public CastReferenceToEnumInstruction(Type t)
System\Linq\Expressions\Interpreter\Utilities.cs (1)
97internal static object? GetPrimitiveDefaultValue(Type type)
System\Linq\Expressions\InvocationExpression.cs (12)
19internal InvocationExpression(Expression expression, Type returnType) 28/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 29public sealed override Type Type { get; } 129public InvocationExpressionN(Expression lambda, IReadOnlyList<Expression> arguments, Type returnType) 155public InvocationExpression0(Expression lambda, Type returnType) 185public InvocationExpression1(Expression lambda, Type returnType, Expression arg0) 223public InvocationExpression2(Expression lambda, Type returnType, Expression arg0, Expression arg1) 264public InvocationExpression3(Expression lambda, Type returnType, Expression arg0, Expression arg1, Expression arg2) 308public InvocationExpression4(Expression lambda, Type returnType, Expression arg0, Expression arg1, Expression arg2, Expression arg3) 355public InvocationExpression5(Expression lambda, Type returnType, Expression arg0, Expression arg1, Expression arg2, Expression arg3, Expression arg4) 745Type delegateType = expression.Type; 748Type? exprType = TypeUtils.FindGenericType(typeof(Expression<>), expression.Type);
System\Linq\Expressions\LabelExpression.cs (2)
26/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 27public sealed override Type Type => Target.Type;
System\Linq\Expressions\LabelTarget.cs (4)
13internal LabelTarget(Type type, string? name) 29public Type Type { get; } 67public static LabelTarget Label(Type type) 78public static LabelTarget Label(Type type, string? name)
System\Linq\Expressions\LambdaExpression.cs (48)
24private static readonly MethodInfo s_expressionCompileMethodInfo = typeof(Expression<>).GetMethod("Compile", Type.EmptyTypes)!; 43public sealed override Type Type => TypeCore; 45internal abstract Type TypeCore { get; } 47internal abstract Type PublicType { get; } 76public Type ReturnType => Type.GetInvokeMethod().ReturnType; 120internal static MethodInfo GetCompileMethod(Type lambdaExpressionType) 127return typeof(LambdaExpression).GetMethod("Compile", Type.EmptyTypes)!; 209internal sealed override Type TypeCore => typeof(TDelegate); 211internal override Type PublicType => typeof(Expression<TDelegate>); 612internal static LambdaExpression CreateLambda(Type delegateType, Expression body, string? name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters) 618CacheDict<Type, Func<Expression, string?, bool, ReadOnlyCollection<ParameterExpression>, LambdaExpression>>? factories = 619s_lambdaFactories ??= new CacheDict<Type, Func<Expression, string?, bool, ReadOnlyCollection<ParameterExpression>, LambdaExpression>>(50); 787public static LambdaExpression Lambda(Type delegateType, Expression body, params ParameterExpression[]? parameters) 800public static LambdaExpression Lambda(Type delegateType, Expression body, bool tailCall, params ParameterExpression[]? parameters) 812public static LambdaExpression Lambda(Type delegateType, Expression body, IEnumerable<ParameterExpression>? parameters) 825public static LambdaExpression Lambda(Type delegateType, Expression body, bool tailCall, IEnumerable<ParameterExpression>? parameters) 859Type[] typeArgs = new Type[paramCount + 1]; 876Type delegateType = Compiler.DelegateHelpers.MakeDelegateType(typeArgs); 889public static LambdaExpression Lambda(Type delegateType, Expression body, string? name, IEnumerable<ParameterExpression>? parameters) 906public static LambdaExpression Lambda(Type delegateType, Expression body, string? name, bool tailCall, IEnumerable<ParameterExpression>? parameters) 914private static void ValidateLambdaArgs(Type delegateType, ref Expression body, ReadOnlyCollection<ParameterExpression> parameters, string paramName) 926CacheDict<Type, MethodInfo> ldc = s_lambdaDelegateCache; 950Type pType = pi.ParameterType; 991private static TryGetFuncActionArgsResult ValidateTryGetFuncActionArgs(Type[]? typeArgs) 1000Type a = typeArgs[i]; 1021/// Creates a <see cref="System.Type"/> object that represents a generic System.Func delegate type that has specific type arguments. 1024/// <param name="typeArgs">An array of <see cref="System.Type"/> objects that specify the type arguments for the System.Func delegate type.</param> 1027public static Type GetFuncType(params Type[]? typeArgs) 1039Type result = Compiler.DelegateHelpers.GetFuncType(typeArgs); 1050/// Creates a <see cref="System.Type"/> object that represents a generic System.Func delegate type that has specific type arguments. 1053/// <param name="typeArgs">An array of <see cref="System.Type"/> objects that specify the type arguments for the System.Func delegate type.</param> 1057public static bool TryGetFuncType(Type[] typeArgs, [NotNullWhen(true)] out Type? funcType) 1069/// Creates a <see cref="System.Type"/> object that represents a generic System.Action delegate type that has specific type arguments. 1071/// <param name="typeArgs">An array of <see cref="System.Type"/> objects that specify the type arguments for the System.Action delegate type.</param> 1074public static Type GetActionType(params Type[]? typeArgs) 1086Type result = Compiler.DelegateHelpers.GetActionType(typeArgs); 1097/// Creates a <see cref="System.Type"/> object that represents a generic System.Action delegate type that has specific type arguments. 1099/// <param name="typeArgs">An array of <see cref="System.Type"/> objects that specify the type arguments for the System.Action delegate type.</param> 1103public static bool TryGetActionType(Type[] typeArgs, [NotNullWhen(true)] out Type? actionType) 1115/// Gets a <see cref="System.Type"/> object that represents a generic System.Func or System.Action delegate type that has specific type arguments. 1119/// <param name="typeArgs">An array of <see cref="System.Type"/> objects that specify the type arguments of the delegate type.</param> 1125public static Type GetDelegateType(params Type[] typeArgs)
System\Linq\Expressions\ListInitExpression.cs (2)
39/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 40public sealed override Type Type => NewExpression.Type;
System\Linq\Expressions\LoopExpression.cs (2)
25/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 26public sealed override Type Type => BreakLabel == null ? typeof(void) : BreakLabel.Type;
System\Linq\Expressions\MemberAssignment.cs (3)
63Type memberType; 87private static void ValidateSettableFieldOrPropertyMember(MemberInfo member, out Type memberType) 89Type? decType = member.DeclaringType;
System\Linq\Expressions\MemberExpression.cs (6)
100public sealed override Type Type => _field.FieldType; 114public sealed override Type Type => _property.PropertyType; 178[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] Type type, 229[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type, 310Type? type = mi.DeclaringType; 343Type type = method.DeclaringType!;
System\Linq\Expressions\MemberInitExpression.cs (2)
26/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 27public sealed override Type Type => NewExpression.Type;
System\Linq\Expressions\MemberListBinding.cs (2)
84Type memberType; 121private static void ValidateListInitArgs(Type listType, ReadOnlyCollection<ElementInit> initializers, string listTypeParamName)
System\Linq\Expressions\MemberMemberBinding.cs (4)
84Type memberType; 123private static void ValidateGettableFieldOrPropertyMember(MemberInfo member, out Type memberType) 125Type? decType = member.DeclaringType; 153private static void ValidateMemberInitArgs(Type type, ReadOnlyCollection<MemberBinding> bindings)
System\Linq\Expressions\MethodCallExpression.cs (13)
35/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 36public sealed override Type Type => Method.ReturnType; 1142public static MethodCallExpression Call(Expression instance, string methodName, Type[]? typeArguments, params Expression[]? arguments) 1167[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type type, 1169Type[]? typeArguments, 1261private static void ValidateCallInstanceType(Type instanceType, MethodInfo method) 1290private static bool TryQuote(Type parameterType, ref Expression argument) 1298[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type type, 1300Type[]? typeArgs, 1356Type argType = arg.Type; 1357Type pType = parms[i].ParameterType; 1373private static MethodInfo? ApplyTypeArgs(MethodInfo m, Type[]? typeArgs) 1414Type arrayType = array.Type;
System\Linq\Expressions\NewArrayExpression.cs (13)
20internal NewArrayExpression(Type type, ReadOnlyCollection<Expression> expressions) 26internal static NewArrayExpression Make(ExpressionType nodeType, Type type, ReadOnlyCollection<Expression> expressions) 42/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 43public sealed override Type Type { get; } 84internal NewArrayInitExpression(Type type, ReadOnlyCollection<Expression> expressions) 100internal NewArrayBoundsExpression(Type type, ReadOnlyCollection<Expression> expressions) 123public static NewArrayExpression NewArrayInit(Type type, params Expression[] initializers) 135public static NewArrayExpression NewArrayInit(Type type, IEnumerable<Expression> initializers) 195/// <param name="type">A <see cref="System.Type"/> that represents the element type of the array.</param> 199public static NewArrayExpression NewArrayBounds(Type type, params Expression[] bounds) 207/// <param name="type">A <see cref="System.Type"/> that represents the element type of the array.</param> 211public static NewArrayExpression NewArrayBounds(Type type, IEnumerable<Expression> bounds) 238Type arrayType;
System\Linq\Expressions\NewExpression.cs (8)
32/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 33public override Type Type => Constructor!.DeclaringType!; 98internal NewValueTypeExpression(Type type, ReadOnlyCollection<Expression> arguments, ReadOnlyCollection<MemberInfo>? members) 104public sealed override Type Type { get; } 198[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type) 245Type memberType; 255Type pType = pi.ParameterType; 313private static void ValidateAnonymousTypeMember(ref MemberInfo member, out Type memberType, string paramName, int index)
System\Linq\Expressions\ParameterExpression.cs (12)
20internal static ParameterExpression Make(Type type, string? name, bool isByRef) 74/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 75public override Type Type => typeof(object); 111internal ByRefParameterExpression(Type type, string? name) 125internal TypedParameterExpression(Type type, string? name) 131public sealed override Type Type { get; } 145public sealed override Type Type => typeof(T); 155public static ParameterExpression Parameter(Type type) 165public static ParameterExpression Variable(Type type) 176public static ParameterExpression Parameter(Type type, string? name) 194public static ParameterExpression Variable(Type type, string? name) 200private static void Validate(Type type, bool allowByRef)
System\Linq\Expressions\RuntimeVariablesExpression.cs (2)
28/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 29public sealed override Type Type => typeof(IRuntimeVariables);
System\Linq\Expressions\Strings.cs (1)
16internal static string LiftingInExpressionRequiresDynamicCode(Type type)
System\Linq\Expressions\SwitchExpression.cs (8)
18internal SwitchExpression(Type type, Expression switchValue, Expression? defaultBody, MethodInfo? comparison, ReadOnlyCollection<SwitchCase> cases) 30/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 31public sealed override Type Type { get; } 150public static SwitchExpression Switch(Type? type, Expression switchValue, Expression? defaultBody, MethodInfo? comparison, params SwitchCase[]? cases) 177public static SwitchExpression Switch(Type? type, Expression switchValue, Expression? defaultBody, MethodInfo? comparison, IEnumerable<SwitchCase>? cases) 186Type resultType; 227Type rightOperandType = c.TestValues[i].Type; 294private static void ValidateSwitchCaseType(Expression @case, bool customType, Type resultType, string parameterName)
System\Linq\Expressions\TryExpression.cs (5)
24internal TryExpression(Type type, Expression body, Expression? @finally, Expression? fault, ReadOnlyCollection<CatchBlock> handlers) 36/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 37public sealed override Type Type { get; } 153public static TryExpression MakeTry(Type? type, Expression body, Expression? @finally, Expression? fault, IEnumerable<CatchBlock>? handlers) 182private static void ValidateTryAndCatchHaveSameType(Type? type, Expression tryBody, ReadOnlyCollection<CatchBlock> handlers)
System\Linq\Expressions\TypeBinaryExpression.cs (9)
17internal TypeBinaryExpression(Expression expression, Type typeOperand, ExpressionType nodeType) 27/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 28public sealed override Type Type => typeof(bool); 45public Type TypeOperand { get; } 51Type cType = Expression.Type; 116ParameterExpression temp = Expression.Parameter(typeof(Type)); 133Expression.Constant(TypeOperand.GetNonNullableType(), typeof(Type)) 191public static TypeBinaryExpression TypeIs(Expression expression, Type type) 206public static TypeBinaryExpression TypeEqual(Expression expression, Type type)
System\Linq\Expressions\UnaryExpression.cs (26)
18internal UnaryExpression(ExpressionType nodeType, Expression expression, Type type, MethodInfo? method) 29/// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> 30public sealed override Type Type { get; } 303public static UnaryExpression MakeUnary(ExpressionType unaryType, Expression operand, Type type) 318public static UnaryExpression MakeUnary(ExpressionType unaryType, Expression operand, Type type, MethodInfo? method) => 359Type operandType = operand.Type; 360Type[] types = new Type[] { operandType }; 361Type nnOperandType = operandType.GetNonNullableType(); 403private static UnaryExpression GetUserDefinedCoercionOrThrow(ExpressionType coercionType, Expression expression, Type convertToType) 413private static UnaryExpression? GetUserDefinedCoercion(ExpressionType coercionType, Expression expression, Type convertToType) 426private static UnaryExpression GetMethodBasedCoercionOperator(ExpressionType unaryType, Expression operand, Type convertToType, MethodInfo method) 687/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 690public static UnaryExpression TypeAs(Expression expression, Type type) 707/// <param name="type">The new <see cref="System.Type"/> of the expression.</param> 709public static UnaryExpression Unbox(Expression expression, Type type) 725/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 729public static UnaryExpression Convert(Expression expression, Type type) 737/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 745public static UnaryExpression Convert(Expression expression, Type type, MethodInfo? method) 765/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 769public static UnaryExpression ConvertChecked(Expression expression, Type type) 777/// <param name="type">A <see cref="System.Type"/> to set the <see cref="Type"/> property equal to.</param> 785public static UnaryExpression ConvertChecked(Expression expression, Type type, MethodInfo? method) 859public static UnaryExpression Rethrow(Type type) 880public static UnaryExpression Throw(Expression? value, Type type)
System\Linq\IQueryable.cs (1)
23Type ElementType { get; }
System\Runtime\CompilerServices\CallSite.cs (12)
54private static volatile CacheDict<Type, Func<CallSiteBinder, CallSite>>? s_siteCtors; 87public static CallSite Create(Type delegateType, CallSiteBinder binder) 93CacheDict<Type, Func<CallSiteBinder, CallSite>>? ctors = s_siteCtors; 97s_siteCtors = ctors = new CacheDict<Type, Func<CallSiteBinder, CallSite>>(100); 286Type target = typeof(T); 290&& target.IsGenericType && IsSimpleSignature(invoke, out Type[] args)) 334private static bool IsSimpleSignature(MethodInfo invoke, out Type[] sig) 339Type[] args = new Type[invoke.ReturnType != typeof(void) ? pis.Length : pis.Length - 1]; 362Type returnType = invoke.GetReturnType(); 370Type[] typeArgs = new[] { typeof(T) }; 684private static Expression Convert(Expression arg, Type type)
System\Runtime\CompilerServices\CallSiteBinder.cs (4)
24internal Dictionary<Type, object>? Cache; 52Type target = typeof(T); 155Type siteType = typeof(CallSite<T>); 207Interlocked.CompareExchange(ref Cache, new Dictionary<Type, object>(), null);
System\Runtime\CompilerServices\CallSiteHelpers.cs (1)
14private static readonly Type s_knownNonDynamicMethodType = typeof(object).GetMethod(nameof(ToString))!.GetType();
System.Linq.Queryable (50)
System\Linq\EnumerableExecutor.cs (1)
21Type execType = typeof(EnumerableExecutor<>).MakeGenericType(expression.Type);
System\Linq\EnumerableQuery.cs (6)
20internal static IQueryable Create(Type elementType, IEnumerable sequence) 22Type seqType = typeof(EnumerableQuery<>).MakeGenericType(elementType); 28internal static IQueryable Create(Type elementType, Expression expression) 30Type seqType = typeof(EnumerableQuery<>).MakeGenericType(elementType); 61Type IQueryable.ElementType => typeof(T); 67Type? iqType = TypeHelper.FindGenericType(typeof(IQueryable<>), expression.Type);
System\Linq\EnumerableRewriter.cs (37)
22private Dictionary<Type, Type>? _equivalentTypeCache; 37Type[]? typeArgs = (mInfo.IsGenericMethod) ? mInfo.GetGenericArguments() : null; 91private static Expression FixupQuotedExpression(Type type, Expression expression) 104Type strippedType = StripExpression(expr.Type); 107Type elementType = type.GetElementType()!; 122private static Type GetPublicType(Type t) 133foreach (Type iType in t.GetInterfaces()) 146private Type GetEquivalentType(Type type) 148Type? equiv; 152_equivalentTypeCache ??= new Dictionary<Type, Type> 159Type pubType = GetPublicType(type); 162Type genericType = pubType.GetGenericTypeDefinition(); 179Type? typeArg = singleTypeGenInterfacesWithGetType 207Type t = GetPublicType(sq.Enumerable.GetType()); 218private static MethodInfo FindEnumerableMethodForQueryable(string name, ReadOnlyCollection<Expression> args, params Type[]? typeArgs) 236static MethodInfo[] GetEnumerableStaticMethods(Type type) => 284Type leftParam = left[i].ParameterType; 285Type rightParam = right[i].ParameterType; 297private static MethodInfo FindMethod(Type type, string name, ReadOnlyCollection<Expression> args, Type[]? typeArgs) 313private static bool ArgsMatch(MethodInfo m, ReadOnlyCollection<Expression> args, Type[]? typeArgs) 335static ParameterInfo[] GetConstrutedGenericParameters(MethodInfo method, Type[] genericTypes) => 340Type parameterType = mParams[i].ParameterType; 363private static Type StripExpression(Type type) 366Type tmp = isArray ? type.GetElementType()! : type; 367Type? eType = TypeHelper.FindGenericType(typeof(Expression<>), tmp); 380Type type = c.Type; 386Type trueType = ifTrue.Type; 387Type falseType = ifFalse.Type; 397Type type = node.Type; 409Type type = node.Value!.Type; 429Type type = node!.Type;
System\Linq\Queryable.cs (1)
36Type? enumType = TypeHelper.FindGenericType(typeof(IEnumerable<>), source.GetType());
System\Linq\TypeHelper.cs (5)
16internal static Type? FindGenericType(Type definition, Type type) 27foreach (Type itype in type.GetInterfaces()) 29Type? found = FindGenericType(definition, itype);
System.Memory.Data (3)
System\BinaryData.cs (2)
90public BinaryData(object? jsonSerializable, JsonSerializerOptions? options = default, Type? type = default) : this( 107public BinaryData(object? jsonSerializable, JsonSerializerContext context, Type? type = default) : this(
System\BinaryDataConverter.cs (1)
18public override BinaryData? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System.Net.Http.Json (23)
System\Net\Http\Json\HttpClientJsonExtensions.cs (2)
19private static Task<object?> FromJsonAsyncCore(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 27private static Task<object?> FromJsonAsyncCore(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) =>
System\Net\Http\Json\HttpClientJsonExtensions.Delete.cs (6)
33public static Task<object?> DeleteFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 48public static Task<object?> DeleteFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 91public static Task<object?> DeleteFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) => 104public static Task<object?> DeleteFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) => 144public static Task<object?> DeleteFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, CancellationToken cancellationToken = default) => 158public static Task<object?> DeleteFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, CancellationToken cancellationToken = default) =>
System\Net\Http\Json\HttpClientJsonExtensions.Get.cs (6)
23public static Task<object?> GetFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 28public static Task<object?> GetFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 41public static Task<object?> GetFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) => 44public static Task<object?> GetFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) => 55public static Task<object?> GetFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, CancellationToken cancellationToken = default) => 60public static Task<object?> GetFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, CancellationToken cancellationToken = default) =>
System\Net\Http\Json\HttpContentJsonExtensions.cs (5)
30public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) 49public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, CancellationToken cancellationToken = default) 90private static async Task<object?> ReadFromJsonAsyncCore(HttpContent content, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken) 108public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) 128private static async Task<object?> ReadFromJsonAsyncCore(HttpContent content, Type type, JsonSerializerContext context, CancellationToken cancellationToken)
System\Net\Http\Json\JsonContent.cs (3)
19public Type ObjectType => _typeInfo.Type; 66public static JsonContent Create(object? inputValue, Type inputType, MediaTypeHeaderValue? mediaType = null, JsonSerializerOptions? options = null) 165private static void EnsureTypeCompatibility(object? inputValue, Type inputType)
System\Net\Http\Json\JsonHelpers.cs (1)
17internal static JsonTypeInfo GetJsonTypeInfo(Type type, JsonSerializerOptions? options)
System.Net.Quic (3)
System\Net\Quic\QuicConnection.cs (1)
773[UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvCdecl) })]
System\Net\Quic\QuicListener.cs (1)
367[UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvCdecl) })]
System\Net\Quic\QuicStream.cs (1)
671[UnmanagedCallersOnly(CallConvs = new Type[] { typeof(CallConvCdecl) })]
System.Net.Requests (1)
System\Net\HttpWebRequest.cs (1)
1682FieldInfo? fi = Type.GetType("System.Net.Http.HttpConnectionSettings, System.Net.Http")?.GetField("_impersonationLevel", BindingFlags.NonPublic | BindingFlags.Instance);
System.Net.Security (22)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (22)
92Type? socketsHttpHandlerType = Type.GetType("System.Net.Http.SocketsHttpHandler, System.Net.Http", throwOnError: false); 93Type? httpMessageHandlerType = Type.GetType("System.Net.Http.HttpMessageHandler, System.Net.Http", throwOnError: false); 94Type? httpClientType = Type.GetType("System.Net.Http.HttpClient, System.Net.Http", throwOnError: false); 95Type? httpRequestMessageType = Type.GetType("System.Net.Http.HttpRequestMessage, System.Net.Http", throwOnError: false); 96Type? httpResponseMessageType = Type.GetType("System.Net.Http.HttpResponseMessage, System.Net.Http", throwOnError: false); 97Type? httpResponseHeadersType = Type.GetType("System.Net.Http.Headers.HttpResponseHeaders, System.Net.Http", throwOnError: false); 98Type? httpContentType = Type.GetType("System.Net.Http.HttpContent, System.Net.Http", throwOnError: false); 99Type? taskOfHttpResponseMessageType = Type.GetType("System.Threading.Tasks.Task`1[[System.Net.Http.HttpResponseMessage, System.Net.Http]], System.Runtime", throwOnError: false); 109ConstructorInfo? socketsHttpHandlerCtor = socketsHttpHandlerType.GetConstructor(Type.EmptyTypes); 112ConstructorInfo? httpClientCtor = httpClientType.GetConstructor(new Type[] { httpMessageHandlerType }); 114ConstructorInfo? httpRequestMessageCtor = httpRequestMessageType.GetConstructor(Type.EmptyTypes); 115MethodInfo? sendMethod = httpClientType.GetMethod("Send", new Type[] { httpRequestMessageType, typeof(CancellationToken) }); 116MethodInfo? sendAsyncMethod = httpClientType.GetMethod("SendAsync", new Type[] { httpRequestMessageType, typeof(CancellationToken) }); 122MethodInfo? readAsStreamMethod = httpContentType.GetMethod("ReadAsStream", Type.EmptyTypes);
System.Net.WebProxy (1)
System\Net\IWebProxyScript.cs (1)
9bool Load(Uri scriptLocation, string script, Type helperType);
System.Numerics.Tensors (1)
System\ThrowHelper.cs (1)
44internal static void ThrowInvalidTypeWithPointersNotSupported(Type targetType)
System.ObjectModel (8)
System\ComponentModel\TypeConverterAttribute.cs (2)
35public TypeConverterAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type) 55/// Gets the fully qualified type name of the <see cref='System.Type'/> to use as a
System\ComponentModel\TypeDescriptionProviderAttribute.cs (1)
24public TypeDescriptionProviderAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type type)
System\Reflection\ICustomTypeProvider.cs (1)
8Type GetCustomType();
System\Windows\Markup\ValueSerializerAttribute.cs (4)
20private Type? _valueSerializerType; 28public ValueSerializerAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type valueSerializerType) 46public Type ValueSerializerType 52_valueSerializerType = Type.GetType(_valueSerializerTypeName);
System.Private.CoreLib (2002)
src\libraries\System.Private.CoreLib\src\Internal\Runtime\InteropServices\ComponentActivator.cs (4)
317Type? delegateType; 329delegateType = Type.GetType(delegateTypeName, resolver, null, throwOnError: true)!; 333Type type = Type.GetType(typeName, resolver, null, throwOnError: true)!;
src\libraries\System.Private.CoreLib\src\System\Activator.cs (5)
25public static object? CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture) => 30public static object? CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, params object?[]? args) => 35public static object? CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, object?[]? args, object?[]? activationAttributes) => 40public static object? CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type type) => 55Type t = assembly.GetType(typeName, throwOnError: true, ignoreCase)!;
src\libraries\System.Private.CoreLib\src\System\Activator.RuntimeType.cs (4)
21public static object? CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture, object?[]? activationAttributes) 90public static object? CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type, bool nonPublic) => 93internal static object? CreateInstance(Type type, bool nonPublic, bool wrapExceptions) 129Type? type = assembly.GetType(typeName, throwOnError: true, ignoreCase);
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (4)
409Type type = Type.GetType("System.Security.Principal.GenericPrincipal, System.Security.Claims", throwOnError: true)!; 423Type type = Type.GetType("System.Security.Principal.WindowsPrincipal, System.Security.Principal.Windows", throwOnError: true)!;
src\libraries\System.Private.CoreLib\src\System\Array.cs (16)
73public static unsafe Array CreateInstance(Type elementType, int length) 87public static unsafe Array CreateInstance(Type elementType, int length1, int length2) 103public static unsafe Array CreateInstance(Type elementType, int length1, int length2, int length3) 119public static unsafe Array CreateInstance(Type elementType, params int[] lengths) 144public static unsafe Array CreateInstance(Type elementType, int[] lengths, int[] lowerBounds) 173public static Array CreateInstance(Type elementType, params long[] lengths) 196/// <returns>A new one-dimensional <see cref="Array"/> of the specified <see cref="Type"/> with the specified length.</returns> 203/// <remarks>When the array type is readily available, this method should be preferred over <see cref="CreateInstance(Type, int)"/>, as it has 205public static unsafe Array CreateInstanceFromArrayType(Type arrayType, int length) 224/// Creates a multidimensional <see cref="Array"/> of the specified <see cref="Type"/> and dimension lengths, with zero-based indexing. 240/// <remarks>When the array type is readily available, this method should be preferred over <see cref="CreateInstance(Type, int[])"/>, as it has 242public static unsafe Array CreateInstanceFromArrayType(Type arrayType, params int[] lengths) 270/// Creates a multidimensional <see cref="Array"/> of the specified <see cref="Type"/> and dimension lengths, with the specified lower bounds. 275/// <returns>A new multidimensional <see cref="Array"/> of the specified <see cref="Type"/> with the specified length and lower bound for each dimension.</returns> 292/// <remarks>When the array type is readily available, this method should be preferred over <see cref="CreateInstance(Type, int[], int[])"/>, as it has 294public static unsafe Array CreateInstanceFromArrayType(Type arrayType, int[] lengths, int[] lowerBounds)
src\libraries\System.Private.CoreLib\src\System\Attribute.cs (3)
29Type thisType = this.GetType(); 57Type type = GetType(); 97Type thisValueType = thisValue.GetType();
src\libraries\System.Private.CoreLib\src\System\Boolean.cs (1)
396object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
252object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
587object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Collections\ArrayList.cs (6)
681public virtual Array ToArray(Type type) 1060public override Array ToArray(Type type) 1453public override Array ToArray(Type type) 1836public override Array ToArray(Type type) 2088public override Array ToArray(Type type) 2533public override Array ToArray(Type type)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\EqualityComparer.cs (1)
246if (Type.GetTypeCode(typeof(T)) != TypeCode.Int32)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\Collection.cs (2)
209Type targetType = array.GetType().GetElementType()!; 210Type sourceType = typeof(T);
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyCollection.cs (2)
139Type targetType = array.GetType().GetElementType()!; 140Type sourceType = typeof(T);
src\libraries\System.Private.CoreLib\src\System\ComponentModel\DefaultValueAttribute.cs (6)
39[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 79[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type typeToConvert, 88Type? typeDescriptorType = Type.GetType("System.ComponentModel.TypeDescriptor, System.ComponentModel.TypeConverter", throwOnError: false); 90s_convertFromInvariantString = mi == null ? new object() : mi.CreateDelegate<Func<Type, string, object>>(); 93if (s_convertFromInvariantString is not Func<Type, string?, object> convertFromInvariantString)
src\libraries\System.Private.CoreLib\src\System\Convert.cs (3)
168internal static object DefaultToType(IConvertible value, Type targetType, IFormatProvider? provider) 223public static object? ChangeType(object? value, Type conversionType) 229public static object? ChangeType(object? value, Type conversionType, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (1)
1994object IConvertible.ToType(Type type, IFormatProvider? provider) => Convert.DefaultToType(this, type, provider);
src\libraries\System.Private.CoreLib\src\System\DBNull.cs (1)
112object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
1104object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (41)
76Type[] paramArrayTypes = new Type[candidates.Length]; 78Type[] argTypes = new Type[args.Length]; 96Type? paramArrayType; 186Type pCls; 207if (defaultValueBinding && args[index] == Type.Missing) 460Type valueType; 471Type pCls = candidates[i].FieldType; 540public sealed override MethodBase? SelectMethod(BindingFlags bindingAttr, MethodBase[] match, Type[] types, ParameterModifier[]? modifiers) 545Type[] realTypes = new Type[types.Length]; 570Type pCls = par[j].ParameterType; 576Type? type = types[j]; 633public sealed override PropertyInfo? SelectProperty(BindingFlags bindingAttr, PropertyInfo[] match, Type? returnType, 634Type[]? indexes, ParameterModifier[]? modifiers) 639foreach (Type index in indexes) 665Type pCls = par[j].ParameterType; 750public override object ChangeType(object value, Type type, CultureInfo? cultureInfo) 791public static MethodBase? ExactBinding(MethodBase[] match, Type[] types) 808Type pCls = par[j].ParameterType; 833public static PropertyInfo? ExactPropertyBinding(PropertyInfo[] match, Type? returnType, Type[]? types) 845Type pCls = par[j].ParameterType; 864private static int FindMostSpecific(ReadOnlySpan<ParameterInfo> p1, int[] paramOrder1, Type? paramArrayType1, 865ReadOnlySpan<ParameterInfo> p2, int[] paramOrder2, Type? paramArrayType2, 866Type[] types, object?[]? args) 879if (args != null && args[i] == Type.Missing) 882Type c1, c2; 941private static int FindMostSpecificType(Type c1, Type c2, Type? t) 1014private static int FindMostSpecificMethod(MethodBase m1, int[] paramOrder1, Type? paramArrayType1, 1015MethodBase m2, int[] paramOrder2, Type? paramArrayType2, 1016Type[] types, object?[]? args) 1115private static int GetHierarchyDepth(Type t) 1119Type? currentType = t; 1232internal static bool CanChangePrimitive(Type? source, Type? target) 1238Primitives widerCodes = PrimitiveConversions[(int)(Type.GetTypeCode(source))]; 1239Primitives targetCode = (Primitives)(1 << (int)(Type.GetTypeCode(target)));
src\libraries\System.Private.CoreLib\src\System\Delegate.cs (8)
55public static Delegate CreateDelegate(Type type, object? firstArgument, MethodInfo method) => CreateDelegate(type, firstArgument, method, throwOnBindFailure: true)!; 58public static Delegate CreateDelegate(Type type, MethodInfo method) => CreateDelegate(type, method, throwOnBindFailure: true)!; 62public static Delegate CreateDelegate(Type type, object target, string method) => CreateDelegate(type, target, method, ignoreCase: false, throwOnBindFailure: true)!; 64public static Delegate CreateDelegate(Type type, object target, string method, bool ignoreCase) => CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure: true)!; 67public static Delegate CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] Type target, string method) => CreateDelegate(type, target, method, ignoreCase: false, throwOnBindFailure: true)!; 68public static Delegate CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] Type target, string method, bool ignoreCase) => CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure: true)!;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\CodeAnalysis\DynamicallyAccessedMembersAttribute.cs (3)
7/// Indicates that certain members on a specified <see cref="Type"/> are accessed dynamically, 14/// This attribute is valid on members whose type is <see cref="Type"/> or <see cref="string"/>. 20/// can be accessed dynamically on <see cref="Type"/> instances returned from calling
src\libraries\System.Private.CoreLib\src\System\Diagnostics\CodeAnalysis\DynamicDependencyAttribute.cs (8)
35/// with the specified signature of a member on a <see cref="System.Type"/>. 38/// <param name="type">The <see cref="System.Type"/> containing <paramref name="memberSignature"/>.</param> 39public DynamicDependencyAttribute(string memberSignature, Type type) 61/// with the specified types of members on a <see cref="System.Type"/>. 64/// <param name="type">The <see cref="System.Type"/> containing the specified members.</param> 65public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type) 105/// Gets the <see cref="System.Type"/> containing the specified member. 111public Type? Type { get; }
src\libraries\System.Private.CoreLib\src\System\Diagnostics\CodeAnalysis\FeatureGuardAttribute.cs (2)
30public FeatureGuardAttribute(Type featureType) 38public Type FeatureType { get; }
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Contracts\Contracts.cs (6)
45private readonly Type _typeWithContracts; 47public ContractClassAttribute(Type typeContainingContracts) 52public Type TypeContainingContracts => _typeWithContracts; 62private readonly Type _typeIAmAContractFor; 64public ContractClassForAttribute(Type typeContractsAreFor) 69public Type TypeContractsAreFor => _typeIAmAContractFor;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\DebuggerDisplayAttribute.cs (2)
18private Type? _target; 33public Type? Target
src\libraries\System.Private.CoreLib\src\System\Diagnostics\DebuggerTypeProxyAttribute.cs (3)
11private Type? _target; 14[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 32public Type? Target
src\libraries\System.Private.CoreLib\src\System\Diagnostics\DebuggerVisualizerAttribute.cs (7)
15private Type? _target; 33[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type visualizerObjectSource) 42[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type visualizer) 50[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type visualizer, 51[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type visualizerObjectSource) 61[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type visualizer, 78public Type? Target
src\libraries\System.Private.CoreLib\src\System\Diagnostics\DiagnosticMethodInfo.cs (1)
33Type? declaringType = _method.DeclaringType;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackFrame.cs (1)
213Type[] typars = methodInfo.GetGenericArguments();
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackTrace.cs (8)
241Type? declaringType = mb.DeclaringType; 271Type[] typars = mi.GetGenericArguments(); 394Type? declaringType = mb.DeclaringType; 406private static bool IsDefinedSafe(MemberInfo memberInfo, Type attributeType, bool inherit) 421private static Attribute[] GetCustomAttributesSafe(MemberInfo memberInfo, Type attributeType, bool inherit) 435private static bool TryResolveStateMachineMethod(ref MethodBase method, out Type declaringType) 442Type? parentType = declaringType.DeclaringType; 451static MethodInfo[]? GetDeclaredMethods(Type type) =>
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (5)
244internal Type ParameterType; 247internal void SetInfo(string name, Type type, TraceLoggingTypeInfo? typeInfo = null) 483internal static bool GetTypeInfoFromType(Type? type, out TraceLoggingTypeInfo? typeInfo) 651private static TypeCode GetTypeCodeExtended(Type parameterType) 667return Type.GetTypeCode(parameterType);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipePayloadDecoder.cs (2)
29Type parameterType = parameters[i].ParameterType; 30Type? enumType = parameterType.IsEnum ? Enum.GetUnderlyingType(parameterType) : null;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (1)
416Type underlyingType = Enum.GetUnderlyingType(data.GetType());
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (37)
368public static Guid GetGuid(Type eventSourceType) 397public static string GetName(Type eventSourceType) 423Type eventSourceType, 446Type eventSourceType, 766Type myType = this.GetType(); 1746private static string GetName(Type eventSourceType, EventManifestOptions flags) 1777private static unsafe void DecodeObjects(object?[] decodedObjects, Type[] parameterTypes, EventData* data) 1782Type dataType = parameterTypes[i]; 1796TypeCode typeCode = Type.GetTypeCode(dataType); 2117Type pType = infos[i].ParameterType; 2239new TraceLoggingEventTypes(EventName, EventTags.None, new Type[] { typeof(string) }); 2554private Type[]? _parameterTypes; 2555public Type[] ParameterTypes 2561static Type[] GetParameterTypes(ParameterInfo[] parameters) 2563var types = new Type[parameters.Length]; 2985Type attributeType, 3016Type attributeType, 3078private static bool AttributeTypeNamesMatch(Type attributeType, Type reflectedAttributeType) 3092private static Type? GetEventSourceBaseType(Type eventSourceType, bool allowEventSourceOverride, bool reflectionOnly) 3094Type? ret = eventSourceType; 3134Type eventSourceType, 3204Type? nestedType = eventSourceType.GetNestedType(providerEnumKind); 3469Type staticFieldType = staticField.FieldType; 3538Type dataType = parameter.ParameterType; 3544(dataType.IsEnum && Type.GetTypeCode(dataType.GetEnumUnderlyingType()) <= TypeCode.UInt32)) 3922Type? metricsEventSourceType = Type.GetType( 3930MethodInfo? getInstanceMethod = metricsEventSourceType.GetMethod("GetInstance", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static, null, Type.EmptyTypes, null); 5525public void AddEventParameter(Type type, string name) 5553mapsTab ??= new Dictionary<string, Type>(); 5711static FieldInfo[] GetEnumFields(Type localEnumType) 5720foreach (Type enumType in mapsTab.Values) 6033private string GetTypeName(Type type) 6048switch (Type.GetTypeCode(type)) 6200private Dictionary<string, Type>? mapsTab;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\ArrayTypeInfo.cs (1)
10public ArrayTypeInfo(Type type, TraceLoggingTypeInfo elementInfo)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EnumerableTypeInfo.cs (1)
13public EnumerableTypeInfo(Type type, TraceLoggingTypeInfo elementInfo)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\InvokeTypeInfo.cs (1)
18Type type,
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (4)
103public static Func<object?, PropertyValue> GetFactory(Type type) 174Type type = property.PropertyType; 205protected static Delegate GetGetMethod(PropertyInfo property, Type propertyType) 218Type type = property.PropertyType;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (5)
64Type type, 123Type type, 315public NullableTypeInfo(Type type, List<Type> recursionCheck) 318Type[] typeArgs = type.GenericTypeArguments;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\Statics.cs (13)
329Type attributeType) 346public static AttributeType? GetCustomAttribute<AttributeType>(Type type) 358public static Type? FindEnumerableElementType( 360Type type) 362Type? elementType = null; 370Type[] ifaceTypes = type.FindInterfaces(IsGenericMatch, typeof(IEnumerable<>)); 372foreach (Type ifaceType in ifaceTypes) 388public static bool IsGenericMatch(Type type, object? openType) 390return type.IsGenericType && type.GetGenericTypeDefinition() == (Type?)openType; 395Type dataType, 396List<Type> recursionCheck) 417Type elementType = dataType.GetElementType()!; 578Type? elementType = FindEnumerableElementType(dataType);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventTypes.cs (4)
49params Type[] types) 178var recursionCheck = new List<Type>(paramInfos.Length); 189private static TraceLoggingTypeInfo[] MakeArray(Type[] types) 193var recursionCheck = new List<Type>(types.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingTypeInfo.cs (10)
21private readonly Type dataType; 24internal TraceLoggingTypeInfo(Type dataType) 34Type dataType, 86internal Type DataType => this.dataType; 138private static Dictionary<Type, TraceLoggingTypeInfo>? threadCache; 141public static TraceLoggingTypeInfo GetInstance(Type type, List<Type>? recursionCheck) 143Dictionary<Type, TraceLoggingTypeInfo> cache = threadCache ??= new Dictionary<Type, TraceLoggingTypeInfo>(); 147recursionCheck ??= new List<Type>();
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TypeAnalysis.cs (3)
24Type dataType, 26List<Type> recursionCheck) 54Type propertyType = propertyInfo.PropertyType;
src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
522object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Enum.cs (42)
60Type underlyingType = typeof(TEnum).GetEnumUnderlyingType(); 87public static string? GetName(Type enumType, object value) 105Type underlyingType = enumType.GetEnumUnderlyingType(); 106switch (Type.GetTypeCode(underlyingType)) // can't use InternalGetCorElementType as enumType may actually be the underlying type 224Type underlyingType = typeof(TEnum).GetEnumUnderlyingType(); 248public static string[] GetNames(Type enumType) 281public static Type GetUnderlyingType(Type enumType) 307public static Array GetValues(Type enumType) 332public static Array GetValuesAsUnderlyingType(Type enumType) 475Type underlyingType = typeof(TEnum).GetEnumUnderlyingType(); 519public static bool IsDefined(Type enumType, object value) 548public static object Parse(Type enumType, string value) => 560public static object Parse(Type enumType, ReadOnlySpan<char> value) => 576public static object Parse(Type enumType, string value, bool ignoreCase) 601public static object Parse(Type enumType, ReadOnlySpan<char> value, bool ignoreCase) 672public static bool TryParse(Type enumType, string? value, [NotNullWhen(true)] out object? result) => 680public static bool TryParse(Type enumType, ReadOnlySpan<char> value, [NotNullWhen(true)] out object? result) => 692public static bool TryParse(Type enumType, string? value, bool ignoreCase, [NotNullWhen(true)] out object? result) 712public static bool TryParse(Type enumType, ReadOnlySpan<char> value, bool ignoreCase, [NotNullWhen(true)] out object? result) => 716private static unsafe bool TryParse(Type enumType, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, [NotNullWhen(true)] out object? result) 892Type underlyingType = typeof(TEnum).GetEnumUnderlyingType(); 1001Type underlyingType = GetUnderlyingType(enumType); 1150Type valueType = value.GetType(); 1624public static string Format(Type enumType, object value, [StringSyntax(StringSyntaxAttribute.EnumFormat)] string format) 1631Type valueType = value.GetType(); 1647Type underlyingType = GetUnderlyingType(rtType); 1750Type underlyingType = typeof(TEnum).GetEnumUnderlyingType(); 1809Type underlyingType = typeof(TEnum).GetEnumUnderlyingType(); 2125private static RuntimeType ValidateRuntimeType(Type enumType) 2146private static void ThrowInvalidRuntimeType(Type enumType) => 2191object IConvertible.ToType(Type type, IFormatProvider? provider) => Convert.DefaultToType(this, type, provider); 2193public static object ToObject(Type enumType, object value) 2211Type valueType = value.GetType(); 2224public static object ToObject(Type enumType, sbyte value) => 2227public static object ToObject(Type enumType, short value) => 2230public static object ToObject(Type enumType, int value) => 2233public static object ToObject(Type enumType, byte value) => 2237public static object ToObject(Type enumType, ushort value) => 2241public static object ToObject(Type enumType, uint value) => 2244public static object ToObject(Type enumType, long value) => 2248public static object ToObject(Type enumType, ulong value) =>
src\libraries\System.Private.CoreLib\src\System\Exception.cs (1)
202public new Type GetType() => base.GetType();
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (1)
664public virtual object? GetFormat(Type? formatType)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (1)
320public object? GetFormat(Type? formatType)
src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (1)
783public object? GetFormat(Type? formatType)
src\libraries\System.Private.CoreLib\src\System\IConvertible.cs (1)
59object ToType(Type conversionType, IFormatProvider? provider);
src\libraries\System.Private.CoreLib\src\System\IFormatProvider.cs (1)
12object? GetFormat(Type? formatType);
src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
255object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
270object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
267object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\MulticastDelegate.cs (1)
24protected MulticastDelegate([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] Type target, string method) : base(target, method)
src\libraries\System.Private.CoreLib\src\System\Nullable.cs (3)
103public static Type? GetUnderlyingType(Type nullableType) 110Type genericType = nullableType.GetGenericTypeDefinition();
src\libraries\System.Private.CoreLib\src\System\ObjectDisposedException.cs (1)
70public static void ThrowIf([DoesNotReturnIf(true)] bool condition, Type type)
src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (17)
31Type[] types = GetTypes(); 42public virtual Type[] GetTypes() 51Type[][] moduleTypes = new Type[m.Length][]; 60Type[] ret = new Type[finalLength]; 71public virtual IEnumerable<Type> ExportedTypes 77public virtual Type[] GetExportedTypes() { throw NotImplemented.ByDesign; } 79public virtual Type[] GetForwardedTypes() { throw NotImplemented.ByDesign; } 97public virtual Stream? GetManifestResourceStream(Type type, string name) { throw NotImplemented.ByDesign; } 105public virtual Type? GetType(string name) => GetType(name, throwOnError: false, ignoreCase: false); 107public virtual Type? GetType(string name, bool throwOnError) => GetType(name, throwOnError: throwOnError, ignoreCase: false); 109public virtual Type? GetType(string name, bool throwOnError, bool ignoreCase) { throw NotImplemented.ByDesign; } 111public virtual bool IsDefined(Type attributeType, bool inherit) { throw NotImplemented.ByDesign; } 117public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) { throw NotImplemented.ByDesign; } 132Type? t = GetType(typeName, throwOnError: false, ignoreCase: ignoreCase); 206public static Assembly? GetAssembly(Type type)
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (2)
169Type readerType = Type.GetType(
src\libraries\System.Private.CoreLib\src\System\Reflection\Binder.cs (4)
13public abstract object ChangeType(object value, Type type, CultureInfo? culture); 15public abstract MethodBase? SelectMethod(BindingFlags bindingAttr, MethodBase[] match, Type[] types, ParameterModifier[]? modifiers); 16public abstract PropertyInfo? SelectProperty(BindingFlags bindingAttr, PropertyInfo[] match, Type? returnType, Type[]? indexes, ParameterModifier[]? modifiers);
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (1)
21/// <see cref="Type.Missing"/> is specified. In addition, the target constructor may be inlined for performance and not
src\libraries\System.Private.CoreLib\src\System\Reflection\CustomAttributeData.cs (1)
84public virtual Type AttributeType => Constructor.DeclaringType!;
src\libraries\System.Private.CoreLib\src\System\Reflection\CustomAttributeExtensions.cs (18)
11public static Attribute? GetCustomAttribute(this Assembly element, Type attributeType) 15public static Attribute? GetCustomAttribute(this Module element, Type attributeType) 19public static Attribute? GetCustomAttribute(this MemberInfo element, Type attributeType) 23public static Attribute? GetCustomAttribute(this ParameterInfo element, Type attributeType) 45public static Attribute? GetCustomAttribute(this MemberInfo element, Type attributeType, bool inherit) 49public static Attribute? GetCustomAttribute(this ParameterInfo element, Type attributeType, bool inherit) 93public static IEnumerable<Attribute> GetCustomAttributes(this Assembly element, Type attributeType) 97public static IEnumerable<Attribute> GetCustomAttributes(this Module element, Type attributeType) 101public static IEnumerable<Attribute> GetCustomAttributes(this MemberInfo element, Type attributeType) 105public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element, Type attributeType) 127public static IEnumerable<Attribute> GetCustomAttributes(this MemberInfo element, Type attributeType, bool inherit) 131public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element, Type attributeType, bool inherit) 147public static bool IsDefined(this Assembly element, Type attributeType) 151public static bool IsDefined(this Module element, Type attributeType) 155public static bool IsDefined(this MemberInfo element, Type attributeType) 159public static bool IsDefined(this ParameterInfo element, Type attributeType) 164public static bool IsDefined(this MemberInfo element, Type attributeType, bool inherit) 168public static bool IsDefined(this ParameterInfo element, Type attributeType, bool inherit)
src\libraries\System.Private.CoreLib\src\System\Reflection\CustomAttributeNamedArgument.cs (2)
20Type type = memberInfo switch 62internal Type ArgumentType =>
src\libraries\System.Private.CoreLib\src\System\Reflection\CustomAttributeTypedArgument.cs (6)
16private readonly Type _argumentType; 18public CustomAttributeTypedArgument(Type argumentType, object? value) 54if (ArgumentType == typeof(Type)) 55return $"typeof({((Type)Value!).FullName})"; 60Type elementType = ArgumentType.GetElementType()!; 96public Type ArgumentType => _argumentType;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\AssemblyBuilder.cs (2)
63public override Type[] GetExportedTypes() => 83public override Stream? GetManifestResourceStream(Type type, string name) =>
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\ConstructorOnTypeBuilderInstantiation.cs (6)
31internal override Type[] GetParameterTypes() 40public override Type? DeclaringType => _type; 41public override Type? ReflectedType => _type; 43public override object[] GetCustomAttributes(Type attributeType, bool inherit) { return _ctor.GetCustomAttributes(attributeType, inherit); } 44public override bool IsDefined(Type attributeType, bool inherit) { return _ctor.IsDefined(attributeType, inherit); } 59public override Type[] GetGenericArguments() { return _ctor.GetGenericArguments(); }
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\DynamicMethod.cs (28)
30Type? returnType, 31Type[]? parameterTypes) 46Type? returnType, 47Type[]? parameterTypes, 63Type? returnType, 64Type[]? parameterTypes, 82Type? returnType, 83Type[]? parameterTypes, 104Type? returnType, 105Type[]? parameterTypes, 124Type? returnType, 125Type[]? parameterTypes, 126Type owner) 143Type? returnType, 144Type[]? parameterTypes, 145Type owner, 165Type? returnType, 166Type[]? parameterTypes, 167Type owner, 216Type? returnType, 217Type[]? signature, 218Type? owner, 317public override Type? DeclaringType => null; 319public override Type? ReflectedType => null; 346public override object[] GetCustomAttributes(Type attributeType, bool inherit) 368public override bool IsDefined(Type attributeType, bool inherit) 375public override Type ReturnType => _returnType; 417Type[] parameterTypes = _parameterTypes;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\EmptyCAHolder.cs (2)
10object[] ICustomAttributeProvider.GetCustomAttributes(Type attributeType, bool inherit) => Array.Empty<object>(); 14bool ICustomAttributeProvider.IsDefined(Type attributeType, bool inherit) => false;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\EnumBuilder.cs (5)
20public Type CreateType() 43public override Type MakePointerType() 48public override Type MakeByRefType() 54public override Type MakeArrayType() 60public override Type MakeArrayType(int rank)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\FieldOnTypeBuilderInstantiation.cs (7)
47public override Type? DeclaringType => _type; 48public override Type? ReflectedType => _type; 50public override object[] GetCustomAttributes(Type attributeType, bool inherit) { return _field.GetCustomAttributes(attributeType, inherit); } 51public override bool IsDefined(Type attributeType, bool inherit) { return _field.IsDefined(attributeType, inherit); } 57public override Type[] GetRequiredCustomModifiers() { return _field.GetRequiredCustomModifiers(); } 58public override Type[] GetOptionalCustomModifiers() { return _field.GetOptionalCustomModifiers(); } 68public override Type FieldType => _field.FieldType;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\GenericTypeParameterBuilder.cs (4)
25public void SetBaseTypeConstraint([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? baseTypeConstraint) => SetBaseTypeConstraintCore(baseTypeConstraint); 27protected abstract void SetBaseTypeConstraintCore([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? baseTypeConstraint); 29public void SetInterfaceConstraints(params Type[]? interfaceConstraints) => SetInterfaceConstraintsCore(interfaceConstraints); 31protected abstract void SetInterfaceConstraintsCore(params Type[]? interfaceConstraints);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\ILGenerator.cs (19)
43Type? returnType, Type[]? parameterTypes, Type[]? optionalParameterTypes); 45public abstract void EmitCalli(OpCode opcode, CallingConvention unmanagedCallConv, Type? returnType, Type[]? parameterTypes); 47public abstract void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[]? optionalParameterTypes); 53public abstract void Emit(OpCode opcode, Type cls); 73public abstract void BeginCatchBlock(Type? exceptionType); 89public virtual void ThrowException([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type excType) 98ConstructorInfo con = excType.GetConstructor(Type.EmptyTypes) ?? throw new ArgumentException(SR.Arg_NoDefCTorWithoutTypeName, nameof(excType)); 104private static readonly Type[] s_parameterTypes = [typeof(string)]; 110Type consoleType = Type.GetType(ConsoleTypeFullName, throwOnError: true)!; 122Emit(OpCodes.Call, Type.GetType(ConsoleTypeFullName, throwOnError: true)!.GetMethod("get_Out")!); 125Type cls = localBuilder.LocalType; 145Emit(OpCodes.Call, Type.GetType(ConsoleTypeFullName, throwOnError: true)!.GetMethod("get_Out")!); 157Type cls = fld.FieldType; 172public virtual LocalBuilder DeclareLocal(Type localType) 177public abstract LocalBuilder DeclareLocal(Type localType, bool pinned);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilder.cs (14)
77public void SetParameters(params Type[] parameterTypes) 80public void SetReturnType(Type? returnType) 83public void SetSignature(Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 84Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers) 88protected abstract void SetSignatureCore(Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 89Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (11)
12internal static MethodInfo MakeGenericMethod(MethodInfo method, Type[] inst) 24private readonly Type[] _inst; 28internal MethodBuilderInstantiation(MethodInfo method, Type[] inst) 36internal override Type[] GetParameterTypes() 45public override Type? DeclaringType => _method.DeclaringType; 46public override Type? ReflectedType => _method.ReflectedType; 48public override object[] GetCustomAttributes(Type attributeType, bool inherit) { return _method.GetCustomAttributes(attributeType, inherit); } 49public override bool IsDefined(Type attributeType, bool inherit) { return _method.IsDefined(attributeType, inherit); } 63public override Type[] GetGenericArguments() { return _inst; } 89public override MethodInfo MakeGenericMethod(params Type[] arguments) 99public override Type ReturnType => _method.ReturnType;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodOnTypeBuilderInstantiation.cs (12)
20private Type _type; 24internal MethodOnTypeBuilderInstantiation(MethodInfo method, Type type) 43Type t = info.DeclaringType!; 53public override Type? DeclaringType => _type; 54public override Type? ReflectedType => _type; 56public override object[] GetCustomAttributes(Type attributeType, bool inherit) { return _method.GetCustomAttributes(attributeType, inherit); } 57public override bool IsDefined(Type attributeType, bool inherit) { return _method.IsDefined(attributeType, inherit); } 85Type[] args = GetGenericArguments(); 100public override Type[] GetGenericArguments() 106public override MethodInfo MakeGenericMethod(params Type[] typeArgs) 120public override Type ReturnType => _method.ReturnType; 127internal override Type[] GetParameterTypes()
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\ModuleBuilder.cs (39)
22public EnumBuilder DefineEnum(string name, TypeAttributes visibility, Type underlyingType) 68protected abstract EnumBuilder DefineEnumCore(string name, TypeAttributes visibility, Type underlyingType); 70public MethodBuilder DefineGlobalMethod(string name, MethodAttributes attributes, Type? returnType, Type[]? parameterTypes) 74Type? returnType, Type[]? parameterTypes) 78Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, 79Type[]? parameterTypes, Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers) 89Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, 90Type[]? parameterTypes, Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers); 100Type? returnType, Type[]? parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet) 107Type? returnType, Type[]? parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet) 114Type? returnType, Type[]? parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet); 123[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent) 127[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, Type[]? interfaces) 135[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, int typesize) 139[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, PackingSize packsize) 143[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, PackingSize packingSize, int typesize) 151[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, Type[]? interfaces, PackingSize packingSize, int typesize); 158public MethodInfo GetArrayMethod(Type arrayClass, string methodName, CallingConventions callingConvention, 159Type? returnType, Type[]? parameterTypes) 167protected abstract MethodInfo GetArrayMethodCore(Type arrayClass, string methodName, 168CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes); 187public abstract int GetTypeMetadataToken(Type type);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (26)
24internal Type _baseType = null!; 43internal static Type? FormCompoundType(string? format, Type baseType, int curIndex) 215internal SymbolType(Type baseType, TypeKind typeKind) 264public override Type MakePointerType() 269public override Type MakeByRefType() 275public override Type MakeArrayType() 281public override Type MakeArrayType(int rank) 322Type baseType; 333Type baseType; 347Type baseType; 368public override Type BaseType => typeof(Array); 372CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 385CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 410public override Type GetInterface(string name, bool ignoreCase) 416public override Type[] GetInterfaces() 435Type? returnType, Type[]? types, ParameterModifier[]? modifiers) 447public override Type[] GetNestedTypes(BindingFlags bindingAttr) 453public override Type GetNestedType(string name, BindingFlags bindingAttr) 477public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) 491Type baseType; 528public override Type? GetElementType() 538public override Type UnderlyingSystemType => this; 545public override object[] GetCustomAttributes(Type attributeType, bool inherit) 550public override bool IsDefined(Type attributeType, bool inherit)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilder.cs (92)
27public void AddInterfaceImplementation([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType) 34protected abstract void AddInterfaceImplementationCore([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType); 37public Type CreateType() 47public ConstructorBuilder DefineConstructor(MethodAttributes attributes, CallingConventions callingConvention, Type[]? parameterTypes) 51Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers) 55Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers); 62public EventBuilder DefineEvent(string name, EventAttributes attributes, Type eventtype) 69protected abstract EventBuilder DefineEventCore(string name, EventAttributes attributes, Type eventtype); 71public FieldBuilder DefineField(string fieldName, Type type, FieldAttributes attributes) 74public FieldBuilder DefineField(string fieldName, Type type, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers, 83protected abstract FieldBuilder DefineFieldCore(string fieldName, Type type, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers, 113Type? returnType, Type[]? parameterTypes) 116public MethodBuilder DefineMethod(string name, MethodAttributes attributes, Type? returnType, Type[]? parameterTypes) 120Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 121Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers) 139Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 140Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers); 159[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent) 163[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, Type[]? interfaces) 171[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, Type[]? interfaces, PackingSize packSize, int typeSize); 174[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, int typeSize) 178[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, PackingSize packSize) 182[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, PackingSize packSize, int typeSize) 191CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes, 198CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes, 207Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 208Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers, 224Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 225Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers, 228public PropertyBuilder DefineProperty(string name, PropertyAttributes attributes, Type? returnType, Type[]? parameterTypes) 232CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes) 236Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 237Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers) 243Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 244Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers) 254Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 255Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers); 289public void SetParent([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent) 292protected abstract void SetParentCore([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent); 294public override Type MakePointerType() 299public override Type MakeByRefType() 305public override Type MakeArrayType() 311public override Type MakeArrayType(int rank) 319public override Type MakeGenericType(params Type[] typeArguments) 327public static MethodInfo GetMethod(Type type, MethodInfo method) 374public static ConstructorInfo GetConstructor(Type type, ConstructorInfo constructor) 407public static FieldInfo GetField(Type type, FieldInfo field)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (41)
18private Type _genericType; 19private Type[] _typeArguments; 32internal static Type MakeGenericType(Type type, Type[] typeArguments) 41foreach (Type t in typeArguments) 51internal TypeBuilderInstantiation(Type type, Type[] inst) 67public override Type? DeclaringType => _genericType.DeclaringType; 69public override Type? ReflectedType => _genericType.ReflectedType; 77public override Type MakePointerType() 81public override Type MakeByRefType() 85public override Type MakeArrayType() 89public override Type MakeArrayType(int rank) 115private Type Substitute(Type[] substitutes) 117Type[] inst = GetGenericArguments(); 118Type[] instSubstituted = new Type[inst.Length]; 122Type t = inst[i]; 141public override Type? BaseType 151Type? typeBldrBase = _genericType.BaseType; 165protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) { throw new NotSupportedException(); } 171protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) { throw new NotSupportedException(); } 184public override Type GetInterface(string name, bool ignoreCase) { throw new NotSupportedException(); } 187public override Type[] GetInterfaces() { throw new NotSupportedException(); } 196protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) { throw new NotSupportedException(); } 202public override Type[] GetNestedTypes(BindingFlags bindingAttr) { throw new NotSupportedException(); } 205public override Type GetNestedType(string name, BindingFlags bindingAttr) { throw new NotSupportedException(); } 210public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) { throw new NotSupportedException(); } 228public override Type GetElementType() { throw new NotSupportedException(); } 230public override Type UnderlyingSystemType => this; 231public override Type[] GetGenericArguments() { return _typeArguments; } 252public override Type GetGenericTypeDefinition() { return _genericType; } 255public override Type MakeGenericType(params Type[] inst) { throw new InvalidOperationException(SR.Format(SR.Arg_NotGenericTypeDefinition, this)); } 256public override bool IsAssignableFrom([NotNullWhen(true)] Type? c) { throw new NotSupportedException(); } 258public override bool IsSubclassOf(Type c) 267public override object[] GetCustomAttributes(Type attributeType, bool inherit) { throw new NotSupportedException(); } 269public override bool IsDefined(Type attributeType, bool inherit) { throw new NotSupportedException(); }
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (8)
236internal static string? ToString(Type type, Format format) 249private void AddElementType(Type type) 266private void AddAssemblyQualifiedName(Type type, Format format) 268Type rootType = type; 274var nestings = new List<Type>(); 275for (Type? t = rootType; t != null; t = t.IsGenericParameter ? null : t.DeclaringType) 280Type enclosingType = nestings[i]; 292Type[] genericArguments = rootType.GetGenericArguments();
src\libraries\System.Private.CoreLib\src\System\Reflection\EventInfo.cs (5)
37Type? cl = EventHandlerType; 38Type mc = typeof(MulticastDelegate); 43public virtual Type? EventHandlerType 49Type del = typeof(Delegate); 52Type c = p[i].ParameterType;
src\libraries\System.Private.CoreLib\src\System\Reflection\ExceptionHandlingClause.cs (1)
17public virtual Type? CatchType => null;
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (2)
397private static FieldAccessorType GetPrimitiveAccessorTypeForInstance(Type fieldType) 424private static FieldAccessorType GetPrimitiveAccessorTypeForStatic(Type fieldType)
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldInfo.cs (5)
17public abstract Type FieldType { get; } 68public void SetValue(object? obj, object? value) => SetValue(obj, value, BindingFlags.Default, Type.DefaultBinder, null); 78public virtual Type GetModifiedFieldType() => throw new NotSupportedException(); 80public virtual Type[] GetOptionalCustomModifiers() { throw NotImplemented.ByDesign; } 81public virtual Type[] GetRequiredCustomModifiers() { throw NotImplemented.ByDesign; }
src\libraries\System.Private.CoreLib\src\System\Reflection\ICustomAttributeProvider.cs (2)
9object[] GetCustomAttributes(Type attributeType, bool inherit); 10bool IsDefined(Type attributeType, bool inherit);
src\libraries\System.Private.CoreLib\src\System\Reflection\InterfaceMapping.cs (2)
8public Type TargetType; // The type implementing the interface 9public Type InterfaceType; // The type representing the interface
src\libraries\System.Private.CoreLib\src\System\Reflection\IntrospectionExtensions.cs (1)
12public static TypeInfo GetTypeInfo(this Type type)
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (8)
26Type[] delegateParameters = [typeof(object), typeof(object), typeof(object), typeof(object), typeof(object)]; 94Type[] delegateParameters = [typeof(object), typeof(Span<object>)]; 151Type[] delegateParameters = [typeof(object), typeof(object), typeof(IntPtr*)]; 199private static void Unbox(ILGenerator il, Type parameterType) 239Type returnType = method.DeclaringType!; 342s_Pointer_Box ??= typeof(Pointer).GetMethod(nameof(Pointer.Box), [typeof(void*), typeof(Type)])!; 346s_Type_GetTypeFromHandle ??= typeof(Type).GetMethod(nameof(Type.GetTypeFromHandle), [typeof(RuntimeTypeHandle)])!;
src\libraries\System.Private.CoreLib\src\System\Reflection\IReflect.cs (7)
15MethodInfo? GetMethod(string name, BindingFlags bindingAttr, Binder? binder, Type[] types, ParameterModifier[]? modifiers); 44PropertyInfo? GetProperty(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[] types, ParameterModifier[]? modifiers); 52[DynamicallyAccessedMembers(Type.GetAllMembers)] 56[DynamicallyAccessedMembers(Type.GetAllMembers)] 80[DynamicallyAccessedMembers(Type.InvokeMemberMembers)] 85Type UnderlyingSystemType { get; }
src\libraries\System.Private.CoreLib\src\System\Reflection\LocalVariableInfo.cs (1)
10public virtual Type LocalType { get { Debug.Fail("type must be set!"); return null!; } }
src\libraries\System.Private.CoreLib\src\System\Reflection\MemberInfo.cs (5)
15public abstract Type? DeclaringType { get; } 16public abstract Type? ReflectedType { get; } 25if (this is Type type) 34public abstract bool IsDefined(Type attributeType, bool inherit); 36public abstract object[] GetCustomAttributes(Type attributeType, bool inherit);
src\libraries\System.Private.CoreLib\src\System\Reflection\Metadata\MetadataUpdateHandlerAttribute.cs (3)
13/// The <see cref="Type" /> specified by this attribute should implement static methods matching the signature of one or more 31public MetadataUpdateHandlerAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type handlerType) => 36public Type HandlerType { get; }
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBase.cs (8)
51public virtual Type[] GetGenericArguments() { throw new NotSupportedException(SR.NotSupported_SubclassOverride); } 91internal static void AppendParameters(ref ValueStringBuilder sbParamList, Type[] parameterTypes, CallingConventions callingConvention) 97Type t = parameterTypes[i]; 126internal virtual Type[] GetParameterTypes() 131return Type.EmptyTypes; 134Type[] parameterTypes = new Type[paramInfo.Length]; 157Type argumentType = sigType.GetGenericArguments()[0];
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (1)
360if (ReferenceEquals(arg, Type.Missing))
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInfo.cs (5)
16public virtual Type ReturnType => throw NotImplemented.ByDesign; 18public override Type[] GetGenericArguments() { throw new NotSupportedException(SR.NotSupported_SubclassOverride); } 23public virtual MethodInfo MakeGenericMethod(params Type[] typeArguments) { throw new NotSupportedException(SR.NotSupported_SubclassOverride); } 29public virtual Delegate CreateDelegate(Type delegateType) { throw new NotSupportedException(SR.NotSupported_SubclassOverride); } 30public virtual Delegate CreateDelegate(Type delegateType, object? target) { throw new NotSupportedException(SR.NotSupported_SubclassOverride); }
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (1)
22/// <see cref="Type.Missing"/> is specified. In addition, the target method may be inlined for performance and not
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedFunctionPointerType.cs (12)
15private Type[]? _parameterTypes; 16private Type? _returnType; 18internal ModifiedFunctionPointerType(Type unmodifiedType, TypeSignature typeSignature) 24public override Type GetFunctionPointerReturnType() 28Type Initialize() 35public override Type[] GetFunctionPointerParameterTypes() 37return (Type[])(_parameterTypes ?? Initialize()).Clone(); 39Type[] Initialize() 41Type[] parameterTypes = UnmodifiedType.GetFunctionPointerParameterTypes(); 51public override Type[] GetFunctionPointerCallingConventions() 53ArrayBuilder<Type> builder = default; 72foreach (Type type in GetFunctionPointerReturnType().GetOptionalCustomModifiers())
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedGenericType.cs (6)
11private Type[]? _genericArguments; 13internal ModifiedGenericType(Type unmodifiedType, TypeSignature typeSignature) 19public override Type[] GetGenericArguments() 21return (Type[])(_genericArguments ?? Initialize()).Clone(); 23Type[] Initialize() 25Type[] genericArguments = UnmodifiedType.GetGenericArguments();
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedHasElementType.cs (4)
14private Type? _elementType; 16internal ModifiedHasElementType(Type unmodifiedType, TypeSignature typeSignature) 22public override Type? GetElementType() 26Type Initialize()
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (29)
16private readonly Type _unmodifiedType; 18internal ModifiedType(Type unmodifiedType, TypeSignature typeSignature) 29protected static Type Create(Type unmodifiedType, TypeSignature typeSignature) 31Type modifiedType; 51protected Type UnmodifiedType => _unmodifiedType; 56public override Type[] GetRequiredCustomModifiers() 62public override Type[] GetOptionalCustomModifiers() 71public override bool Equals(Type? other) => throw new NotSupportedException(SR.NotSupported_ModifiedType); 75public override Type UnderlyingSystemType => _unmodifiedType; 79public override Type GetGenericTypeDefinition() => _unmodifiedType.GetGenericTypeDefinition(); 96public override Type? BaseType => throw new NotSupportedException(SR.NotSupported_ModifiedType); 97public override Type? DeclaringType => throw new NotSupportedException(SR.NotSupported_ModifiedType); 98public override Type? ReflectedType => throw new NotSupportedException(SR.NotSupported_ModifiedType); 102CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) => throw new NotSupportedException(SR.NotSupported_ModifiedType); 109CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 121public override Type[] GetFunctionPointerCallingConventions() => _unmodifiedType.GetFunctionPointerCallingConventions(); 122public override Type[] GetFunctionPointerParameterTypes() => _unmodifiedType.GetFunctionPointerParameterTypes(); 123public override Type GetFunctionPointerReturnType() => _unmodifiedType.GetFunctionPointerReturnType(); 127public override Type? GetInterface(string name, bool ignoreCase) => throw new NotSupportedException(SR.NotSupported_ModifiedType); 130public override Type[] GetInterfaces() => throw new NotSupportedException(SR.NotSupported_ModifiedType); 131public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) => _unmodifiedType.GetInterfaceMap(interfaceType); 141Type? returnType, Type[]? types, ParameterModifier[]? modifiers) 151public override Type[] GetNestedTypes(BindingFlags bindingAttr) => throw new NotSupportedException(SR.NotSupported_ModifiedType); 154public override Type? GetNestedType(string name, BindingFlags bindingAttr) => throw new NotSupportedException(SR.NotSupported_ModifiedType); 192public override Type? GetElementType() => _unmodifiedType.GetElementType(); // Supported 197public override object[] GetCustomAttributes(Type attributeType, bool inherit) => _unmodifiedType.GetCustomAttributes(attributeType, inherit); 198public override bool IsDefined(Type attributeType, bool inherit) => _unmodifiedType.IsDefined(attributeType, inherit);
src\libraries\System.Private.CoreLib\src\System\Reflection\Module.cs (24)
32public virtual bool IsDefined(Type attributeType, bool inherit) { throw NotImplemented.ByDesign; } 36public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) { throw NotImplemented.ByDesign; } 47public MethodInfo? GetMethod(string name, Type[] types) => GetMethod(name, DefaultLookup, null, CallingConventions.Any, types, null); 49public MethodInfo? GetMethod(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 62protected virtual MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) { throw NotImplemented.ByDesign; } 80public virtual Type[] GetTypes() { throw NotImplemented.ByDesign; } 83public virtual Type? GetType(string className) => GetType(className, throwOnError: false, ignoreCase: false); 85public virtual Type? GetType(string className, bool ignoreCase) => GetType(className, throwOnError: false, ignoreCase: ignoreCase); 87public virtual Type? GetType(string className, bool throwOnError, bool ignoreCase) { throw NotImplemented.ByDesign; } 90public virtual Type[] FindTypes(TypeFilter? filter, object? filterCriteria) 92Type[] c = GetTypes(); 104Type[] ret = new Type[cnt]; 119public virtual FieldInfo? ResolveField(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) { throw NotImplemented.ByDesign; } 124public virtual MemberInfo? ResolveMember(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) { throw NotImplemented.ByDesign; } 129public virtual MethodBase? ResolveMethod(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) { throw NotImplemented.ByDesign; } 137public Type ResolveType(int metadataToken) => ResolveType(metadataToken, null, null); 139public virtual Type ResolveType(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) { throw NotImplemented.ByDesign; } 179private static bool FilterTypeNameImpl(Type cls, object filterCriteria, StringComparison comparison)
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfo.cs (3)
18internal NullabilityInfo(Type type, NullabilityState readState, NullabilityState writeState, 29/// The <see cref="System.Type" /> of the member or generic parameter 32public Type Type { get; }
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (23)
337private NullabilityInfo GetNullabilityInfo(MemberInfo memberInfo, Type type, NullableAttributeStateParser parser) 350private NullabilityInfo GetNullabilityInfo(MemberInfo memberInfo, Type type, NullableAttributeStateParser parser, ref int index) 355Type underlyingType = type; 395Type[] genericArguments = underlyingType.GetGenericArguments(); 425Type? metaType = null; 443Type? type = member.DeclaringType; 452private static Type GetPropertyMetaType(PropertyInfo property) 462private void CheckGenericParameters(NullabilityInfo nullability, MemberInfo metaMember, Type metaType, Type? reflectedType) 475Type[] genericArguments = metaType.GetGenericArguments(); 495private bool TryUpdateGenericParameterNullability(NullabilityInfo nullability, Type genericParameter, Type? reflectedType) 533private bool TryUpdateGenericTypeParameterNullabilityFromReflectedType(NullabilityInfo nullability, Type genericParameter, Type context, Type reflectedType) 542Type contextTypeDefinition = context.IsGenericType && !context.IsGenericTypeDefinition ? context.GetGenericTypeDefinition() : context; 548Type? baseType = contextTypeDefinition.BaseType; 560Type[] genericArguments = baseType.GetGenericArguments(); 561Type genericArgument = genericArguments[genericParameter.GenericParameterPosition]; 575static int CountNullabilityStates(Type type) 577Type underlyingType = Nullable.GetUnderlyingType(type) ?? type; 581foreach (Type genericArgument in underlyingType.GetGenericArguments()) 645private static bool IsValueTypeOrValueTypeByRef(Type type) =>
src\libraries\System.Private.CoreLib\src\System\Reflection\ParameterInfo.cs (9)
22public virtual Type ParameterType => ClassImpl!; 35public virtual bool IsDefined(Type attributeType, bool inherit) 45public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) 51public virtual Type GetModifiedParameterType() => throw new NotSupportedException(); 53public virtual Type[] GetOptionalCustomModifiers() => Type.EmptyTypes; 54public virtual Type[] GetRequiredCustomModifiers() => Type.EmptyTypes; 111protected Type? ClassImpl;
src\libraries\System.Private.CoreLib\src\System\Reflection\Pointer.cs (1)
23public static object Box(void* ptr, Type type)
src\libraries\System.Private.CoreLib\src\System\Reflection\PropertyInfo.cs (6)
16public abstract Type PropertyType { get; } 36public virtual Type GetModifiedPropertyType() => throw new NotSupportedException(); 37public virtual Type[] GetOptionalCustomModifiers() => Type.EmptyTypes; 38public virtual Type[] GetRequiredCustomModifiers() => Type.EmptyTypes;
src\libraries\System.Private.CoreLib\src\System\Reflection\ReflectionTypeLoadException.cs (6)
15public ReflectionTypeLoadException(Type?[]? classes, Exception?[]? exceptions) : 20public ReflectionTypeLoadException(Type?[]? classes, Exception?[]? exceptions, string? message) 23Types = classes ?? Type.EmptyTypes; 32Types = Type.EmptyTypes; 41info.AddValue("Types", null, typeof(Type[])); 45public Type?[] Types { get; }
src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeConstructorInfo.cs (2)
18Type? declaringType = DeclaringType; 50internal static void CheckCanCreateInstance(Type declaringType, bool isVarArg)
src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs (4)
18Type? declaringType = DeclaringType; 50static bool IsDisallowedByRefType(Type type) 55Type elementType = type.GetElementType()!; 85Type elementType = ReturnType.GetElementType()!;
src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeReflectionExtensions.cs (10)
15this Type type) 24this Type type) 33this Type type) 42this Type type) 51this Type type, string name) 60this Type type, string name, Type[] parameters) 69this Type type, string name) 78this Type type, string name) 92public static InterfaceMapping GetRuntimeInterfaceMap(this TypeInfo typeInfo, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType)
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureConstructedGenericType.cs (9)
12internal SignatureConstructedGenericType(Type genericTypeDefinition, Type[] typeArguments) 17typeArguments = (Type[])(typeArguments.Clone()); 55public sealed override Type GetGenericTypeDefinition() => _genericTypeDefinition; 56public sealed override Type[] GetGenericArguments() => GenericTypeArguments; 57public sealed override Type[] GenericTypeArguments => (Type[])(_genericTypeArguments.Clone()); 77private readonly Type _genericTypeDefinition; 78private readonly Type[] _genericTypeArguments;
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureGenericParameterType.cs (3)
32public sealed override Type GetGenericTypeDefinition() => throw new InvalidOperationException(SR.InvalidOperation_NotGenericType); 33public sealed override Type[] GetGenericArguments() => EmptyTypes; 34public sealed override Type[] GenericTypeArguments => EmptyTypes;
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureHasElementType.cs (3)
33public sealed override Type GetGenericTypeDefinition() => throw new InvalidOperationException(SR.InvalidOperation_NotGenericType); 34public sealed override Type[] GetGenericArguments() => EmptyTypes; 35public sealed override Type[] GenericTypeArguments => EmptyTypes;
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureType.cs (33)
41public sealed override Type MakeArrayType() => new SignatureArrayType(this, rank: 1, isMultiDim: false); 43public sealed override Type MakeArrayType(int rank) 49public sealed override Type MakeByRefType() => new SignatureByRefType(this); 50public sealed override Type MakePointerType() => new SignaturePointerType(this); 54public sealed override Type MakeGenericType(params Type[] typeArguments) => throw new NotSupportedException(SR.NotSupported_SignatureType); // There is no SignatureType for type definition types so it would never be legal to call this. 57public sealed override Type? GetElementType() => ElementType; 59public abstract override Type GetGenericTypeDefinition(); 60public abstract override Type[] GenericTypeArguments { get; } 61public abstract override Type[] GetGenericArguments(); 68public sealed override bool Equals(Type? o) => base.Equals(o); 71public sealed override Type UnderlyingSystemType => this; // Equals(Type) depends on this. 84public sealed override Type ReflectedType => throw new NotSupportedException(SR.NotSupported_SignatureType); 85public sealed override Type BaseType => throw new NotSupportedException(SR.NotSupported_SignatureType); 88public sealed override Type[] GetInterfaces() => throw new NotSupportedException(SR.NotSupported_SignatureType); 89public sealed override bool IsAssignableFrom([NotNullWhen(true)] Type? c) => throw new NotSupportedException(SR.NotSupported_SignatureType); 93public sealed override Type DeclaringType => throw new NotSupportedException(SR.NotSupported_SignatureType); 96public sealed override Type[] GetGenericParameterConstraints() => throw new NotSupportedException(SR.NotSupported_SignatureType); 101public sealed override Type GetEnumUnderlyingType() => throw new NotSupportedException(SR.NotSupported_SignatureType); 130public sealed override Type GetNestedType(string name, BindingFlags bindingAttr) => throw new NotSupportedException(SR.NotSupported_SignatureType); 133public sealed override Type[] GetNestedTypes(BindingFlags bindingAttr) => throw new NotSupportedException(SR.NotSupported_SignatureType); 142protected sealed override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => throw new NotSupportedException(SR.NotSupported_SignatureType); 145protected sealed override MethodInfo GetMethodImpl(string name, int genericParameterCount, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => throw new NotSupportedException(SR.NotSupported_SignatureType); 148protected sealed override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) => throw new NotSupportedException(SR.NotSupported_SignatureType); 172public sealed override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_SignatureType); 173public sealed override bool IsDefined(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_SignatureType); 178public sealed override Type GetInterface(string name, bool ignoreCase) => throw new NotSupportedException(SR.NotSupported_SignatureType); 181protected sealed override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) => throw new NotSupportedException(SR.NotSupported_SignatureType); 188public sealed override Type[] FindInterfaces(TypeFilter filter, object? filterCriteria) => throw new NotSupportedException(SR.NotSupported_SignatureType); 189public sealed override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) => throw new NotSupportedException(SR.NotSupported_SignatureType); 192public sealed override bool IsEquivalentTo([NotNullWhen(true)] Type? other) => throw new NotSupportedException(SR.NotSupported_SignatureType); 200public sealed override bool IsSubclassOf(Type c) => throw new NotSupportedException(SR.NotSupported_SignatureType);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureTypeExtensions.cs (23)
17public static bool MatchesParameterTypeExactly(this Type pattern, ParameterInfo parameter) 32internal static bool MatchesExactly(this SignatureType pattern, Type actual) 56Type[] patternGenericTypeArguments = pattern.GenericTypeArguments; 57Type[] actualGenericTypeArguments = actual.GenericTypeArguments; 63Type patternGenericTypeArgument = patternGenericTypeArguments[i]; 102internal static Type? TryResolveAgainstGenericMethod(this SignatureType signatureType, MethodInfo genericMethod) 111private static Type? TryResolve(this SignatureType signatureType, Type[] genericMethodParameters) 131Type[] genericTypeArguments = signatureType.GenericTypeArguments; 133Type?[] newGenericTypeArguments = new Type[count]; 136Type genericTypeArgument = genericTypeArguments[i]; 165private static Type? TryMakeArrayType(this Type type) 179private static Type? TryMakeArrayType(this Type type, int rank) 191private static Type? TryMakeByRefType(this Type type) 203private static Type? TryMakePointerType(this Type type) 217private static Type? TryMakeGenericType(this Type type, Type[] instantiation)
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeDelegator.cs (19)
27protected Type typeImpl = null!; 34public TypeDelegator([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type delegatingType) 58public override Type? BaseType => typeImpl.BaseType; 62CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 72CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 91public override Type[] GetFunctionPointerCallingConventions() => typeImpl.GetFunctionPointerCallingConventions(); 92public override Type[] GetFunctionPointerParameterTypes() => typeImpl.GetFunctionPointerParameterTypes(); 93public override Type GetFunctionPointerReturnType() => typeImpl.GetFunctionPointerReturnType(); 97public override Type? GetInterface(string name, bool ignoreCase) => typeImpl.GetInterface(name, ignoreCase); 100public override Type[] GetInterfaces() => typeImpl.GetInterfaces(); 110Type? returnType, Type[]? types, ParameterModifier[]? modifiers) 125public override Type[] GetNestedTypes(BindingFlags bindingAttr) => typeImpl.GetNestedTypes(bindingAttr); 128public override Type? GetNestedType(string name, BindingFlags bindingAttr) => typeImpl.GetNestedType(name, bindingAttr); 160public override Type? GetElementType() => typeImpl.GetElementType(); 163public override Type UnderlyingSystemType => typeImpl.UnderlyingSystemType; 167public override object[] GetCustomAttributes(Type attributeType, bool inherit) => typeImpl.GetCustomAttributes(attributeType, inherit); 169public override bool IsDefined(Type attributeType, bool inherit) => typeImpl.IsDefined(attributeType, inherit); 170public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) => typeImpl.GetInterfaceMap(interfaceType);
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeFilter.cs (1)
6public delegate bool TypeFilter(Type m, object? filterCriteria);
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeInfo.cs (8)
14public virtual Type AsType() => this; 16public virtual Type[] GenericTypeParameters => IsGenericTypeDefinition ? GetGenericArguments() : EmptyTypes; 45Type type) => type.GetMethods(DeclaredOnlyLookup); 83foreach (Type t in GetDeclaredOnlyNestedTypes(this)) 90static Type[] GetDeclaredOnlyNestedTypes( 91Type type) => type.GetNestedTypes(DeclaredOnlyLookup); 101public virtual IEnumerable<Type> ImplementedInterfaces 126Type[] constraints = GetGenericParameterConstraints();
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeNameResolver.cs (8)
32private Type? Resolve(TypeName typeName) 44Type? type = Resolve(typeName.GetElementType()); 66private Type? GetSimpleType(TypeName typeName) 100private Type? GetGenericType(TypeName typeName) 102Type? type = Resolve(typeName.GetGenericTypeDefinition()); 107Type[] genericTypes = new Type[genericArgs.Length]; 110Type? genericArg = Resolve(genericArgs[i]);
src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (4)
291Type readerType = Type.GetType(readerTypeName, throwOnError: true)!; 297Type? resSetType = mediator.UserResourceSet; 301resSetType = Type.GetType(resSetTypeName, true, false)!;
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (8)
108private readonly Type? _userResourceSet; // Which ResourceSet instance to create 170Type? userResourceSet) 202Type? usingResourceSet) 220public ResourceManager(Type resourceSource) 230char c = Type.Delimiter; 270public virtual Type ResourceSetType => _userResourceSet ?? typeof(RuntimeResourceSet); 308Type? usingResourceSet) 752internal Type? UserResourceSet => _rm._userResourceSet;
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (4)
25private static Type? s_binaryFormatterType; 82Type type = FindType(typeIndex); 104Type binaryFormatterType = Type.GetType("System.Runtime.Serialization.Formatters.Binary.BinaryFormatter, System.Runtime.Serialization.Formatters", throwOnError: true)!;
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (7)
82private Type?[] _typeTable; // Lazy array of Types for resource values. 568Type type = FindType(typeIndex); 865_typeTable = new Type[numTypes]; 969private Type FindType(int typeIndex) 985Type UseReflectionToGetTypeLocal(int typeIndex) => UseReflectionToGetType(typeIndex); 992private Type UseReflectionToGetType(int typeIndex) 1001_typeTable[typeIndex] = Type.GetType(typeName, true);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceSet.cs (3)
101public virtual Type GetDefaultReader() 109public virtual Type GetDefaultWriter() 111return Type.GetType("System.Resources.ResourceWriter, System.Resources.Writer", throwOnError: true)!;
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncIteratorStateMachineAttribute.cs (1)
12public AsyncIteratorStateMachineAttribute(Type stateMachineType)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderAttribute.cs (4)
15/// <param name="builderType">The <see cref="Type"/> of the associated builder.</param> 16public AsyncMethodBuilderAttribute(Type builderType) => BuilderType = builderType; 18/// <summary>Gets the <see cref="Type"/> of the associated builder.</summary> 19public Type BuilderType { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (2)
93Type stateMachineType = stateMachine.GetType(); 106internal static void LogTraceOperationBegin(Task t, Type stateMachineType)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncStateMachineAttribute.cs (1)
9public AsyncStateMachineAttribute(Type stateMachineType)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\CollectionBuilderAttribute.cs (2)
22public CollectionBuilderAttribute(Type builderType, string methodName) 29public Type BuilderType { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\CompExactlyDependsOnAttribute.cs (2)
16public CompExactlyDependsOnAttribute(Type intrinsicsTypeUsedInHelperFunction) 21public Type IntrinsicsTypeUsedInHelperFunction { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\FixedBufferAttribute.cs (2)
12public FixedBufferAttribute(Type elementType, int length) 18public Type ElementType { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\IteratorStateMachineAttribute.cs (1)
9public IteratorStateMachineAttribute(Type stateMachineType)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\MetadataUpdateOriginalTypeAttribute.cs (2)
20public MetadataUpdateOriginalTypeAttribute(Type originalType) => OriginalType = originalType; 22public Type OriginalType { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.cs (1)
161internal static bool IsKnownConstant(Type? t) => false;
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\StateMachineAttribute.cs (2)
9public StateMachineAttribute(Type stateMachineType) 14public Type StateMachineType { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TypeForwardedToAttribute.cs (2)
9public TypeForwardedToAttribute(Type destination) 14public Type Destination { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CoClassAttribute.cs (2)
9public CoClassAttribute(Type coClass) 14public Type CoClass { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComDefaultInterfaceAttribute.cs (2)
9public ComDefaultInterfaceAttribute(Type defaultInterface) 14public Type Value { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComEventInterfaceAttribute.cs (4)
18[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type SourceInterface, 19[DynamicallyAccessedMembers(EventProviderAccessedMemberTypes)] Type EventProvider) 26public Type SourceInterface { get; } 28public Type EventProvider { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComSourceInterfacesAttribute.cs (10)
17public ComSourceInterfacesAttribute(Type sourceInterface) 22public ComSourceInterfacesAttribute(Type sourceInterface1, Type sourceInterface2) 27public ComSourceInterfacesAttribute(Type sourceInterface1, Type sourceInterface2, Type sourceInterface3) 32public ComSourceInterfacesAttribute(Type sourceInterface1, Type sourceInterface2, Type sourceInterface3, Type sourceInterface4)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (1)
111/// allocated with the <see cref="CompilerServices.RuntimeHelpers.AllocateTypeAssociatedMemory(Type, int)"/> API.
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ICustomFactory.cs (1)
8MarshalByRefObject CreateInstance(Type serverType);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\LibraryImportAttribute.cs (2)
57/// Gets or sets the <see cref="Type"/> used to control how string arguments to the method are marshalled. 63public Type? StringMarshallingCustomType { get; set; }
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (8)
106public static int SizeOf(Type t) 531public static void PrelinkAll(Type c) 558Type structureType) 614Type structureType = typeof(T); 1049public static Guid GenerateGuidForType(Type type) 1067public static string? GenerateProgIdForType(Type type) 1092public static Delegate GetDelegateForFunctionPointer(IntPtr ptr, Type t) 1247public static Type? GetTypeFromCLSID(Guid clsid) => GetTypeFromCLSID(clsid, null, throwOnError: false);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.NoCom.cs (8)
50public static object? CreateWrapperOfType(object? o, Type t) 75public static IntPtr GetComInterfaceForObject(object o, Type T) 82public static IntPtr GetComInterfaceForObject(object o, Type T, CustomQueryInterfaceMode mode) 126public static object GetTypedObjectForIUnknown(IntPtr pUnk, Type t) 166public static int GetStartComSlot(Type t) 172public static int GetEndComSlot(Type t) 178internal static Type? GetTypeFromCLSID(Guid clsid, string? server, bool throwOnError) 206public static bool IsTypeVisibleFromCom(Type t)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
158internal static Type? GetTypeFromProgID(string progID, string? server, bool throwOnError)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MarshalAsAttribute.cs (2)
22public Type? SafeArrayUserDefinedSubType; 35public Type? MarshalTypeRef; // Type of marshaler class
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\CustomMarshallerAttribute.cs (4)
18public CustomMarshallerAttribute(Type managedType, MarshalMode marshalMode, Type marshallerType) 28public Type ManagedType { get; } 38public Type MarshallerType { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\MarshalUsingAttribute.cs (2)
30public MarshalUsingAttribute(Type nativeType) 39public Type? NativeType { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\NativeMarshallingAttribute.cs (2)
22public NativeMarshallingAttribute(Type nativeType) 30public Type NativeType { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\UnmanagedCallConvAttribute.cs (1)
23public Type[]? CallConvs;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\UnmanagedCallersOnlyAttribute.cs (1)
31public Type[]? CallConvs;
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (1)
509/// * <see cref="Type.GetType" />
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\IFormatterConverter.cs (1)
10object Convert(object value, Type type);
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (33)
20private Type[] _types; 26private Type _rootType; 30public SerializationInfo(Type type, IFormatterConverter converter) 41_types = new Type[DefaultSize]; 50public SerializationInfo(Type type, IFormatterConverter converter, bool requireSameTokenInPartialTrust) 82public void SetType(Type type) 98public Type ObjectType => _rootType; 121Type[] newTypes = new Type[newSize]; 133public void AddValue(string name, object? value, Type type) 227internal void AddValueInternal(string name, object? value, Type type) 265internal void UpdateValue(string name, object value, Type type) 302private object? GetElement(string name, out Type foundType) 318private object? GetElementNoThrow(string name, out Type? foundType) 335public object? GetValue(string name, Type type) 342object? value = GetElement(name, out Type foundType); 353internal object? GetValueNoThrow(string name, Type type) 358object? value = GetElementNoThrow(name, out Type? foundType); 374object? value = GetElement(name, out Type foundType); 380object? value = GetElement(name, out Type foundType); 387object? value = GetElement(name, out Type foundType); 393object? value = GetElement(name, out Type foundType); 399object? value = GetElement(name, out Type foundType); 406object? value = GetElement(name, out Type foundType); 412object? value = GetElement(name, out Type foundType); 419object? value = GetElement(name, out Type foundType); 425object? value = GetElement(name, out Type foundType); 432object? value = GetElement(name, out Type foundType); 438object? value = GetElement(name, out Type foundType); 445object? value = GetElement(name, out Type foundType); 451object? value = GetElement(name, out Type foundType); 457object? value = GetElement(name, out Type foundType); 463object? value = GetElement(name, out Type foundType);
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfoEnumerator.cs (6)
13private readonly Type _type; 15internal SerializationEntry(string entryName, object? entryValue, Type entryType) 24public Type ObjectType => _type; 31private readonly Type[] _types; 36internal SerializationInfoEnumerator(string[] members, object?[] info, Type[] types, int numItems) 113public Type ObjectType
src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\VersioningHelper.cs (1)
32public static string MakeVersionSafeName(string? name, ResourceScope from, ResourceScope to, Type? type)
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (12)
17public override Type? BaseType => GetBaseType(); 26public override Type? ReflectedType => DeclaringType; 33public override Type UnderlyingSystemType => this; 58public override object[] GetCustomAttributes(Type attributeType, bool inherit) 96public override Type? GetElementType() => RuntimeTypeHandle.GetElementType(this); 160public override Type GetEnumUnderlyingType() 191public override bool IsDefined(Type attributeType, bool inherit) 260public override bool IsAssignableFrom([NotNullWhen(true)] Type? c) 287Type[] constraints = GetGenericParameterConstraints(); 581if (!FilterApplyMethodInfo((RuntimeMethodInfo)semiFinalist, bindingFlags, CallingConventions.Any, new Type[argCnt])) 633if (!FilterApplyMethodInfo((RuntimeMethodInfo)semiFinalist, bindingFlags, CallingConventions.Any, new Type[argCnt])) 700Type[] constraints = GetGenericParameterConstraints();
src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
258object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Security\PermissionSet.cs (4)
37public IPermission? GetPermission(Type? permClass) { return GetPermissionImpl(permClass); } 38protected virtual IPermission? GetPermissionImpl(Type? permClass) { return default; } 44public IPermission? RemovePermission(Type? permClass) { return RemovePermissionImpl(permClass); } 45protected virtual IPermission? RemovePermissionImpl(Type? permClass) { return default; }
src\libraries\System.Private.CoreLib\src\System\Security\SecurityException.cs (3)
40public SecurityException(string? message, Type? type) 47public SecurityException(string? message, Type? type, string? state) 89public Type? PermissionType { get; set; }
src\libraries\System.Private.CoreLib\src\System\Single.cs (1)
517object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (3)
169Type type = assembly.GetType(StartupHookTypeName, throwOnError: true)!; 175Type.EmptyTypes, // parameters 202StartupHookTypeName + Type.Delimiter + InitializeMethodName,
src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (7)
81internal static void ThrowInvalidTypeWithPointersNotSupported(Type targetType) 294internal static void ThrowWrongKeyTypeArgumentException<T>(T key, Type targetType) 301internal static void ThrowWrongValueTypeArgumentException<T>(T value, Type targetType) 462internal static void ThrowObjectDisposedException(Type? type) 691Type? declaringType = memberInfo.DeclaringType; 728private static ArgumentException GetWrongKeyTypeArgumentException(object? key, Type targetType) 733private static ArgumentException GetWrongValueTypeArgumentException(object? value, Type targetType)
src\libraries\System.Private.CoreLib\src\System\Type.cs (96)
21public new Type GetType() => base.GetType(); 43public override Type? DeclaringType => null; 46public override Type? ReflectedType => null; 47public abstract Type UnderlyingSystemType { get; } 73public abstract Type? GetElementType(); 78public virtual Type GetGenericTypeDefinition() => throw new NotSupportedException(SR.NotSupported_SubclassOverride); 79public virtual Type[] GenericTypeArguments => (IsGenericType && !IsGenericTypeDefinition) ? GetGenericArguments() : EmptyTypes; 80public virtual Type[] GetGenericArguments() => throw new NotSupportedException(SR.NotSupported_SubclassOverride); 82public virtual Type[] GetOptionalCustomModifiers() => EmptyTypes; 83public virtual Type[] GetRequiredCustomModifiers() => EmptyTypes; 87public virtual Type[] GetGenericParameterConstraints() 143public bool IsAssignableTo([NotNullWhen(true)] Type? targetType) => targetType?.IsAssignableFrom(this) ?? false; 160public ConstructorInfo? GetConstructor(Type[] types) => GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, types, null); 173/// An empty array of the type <see cref="Type"/> (that is, Type[] types = Array.Empty{Type}()) to get a constructor that takes no parameters. 181public ConstructorInfo? GetConstructor(BindingFlags bindingAttr, Type[] types) => GetConstructor(bindingAttr, binder: null, types, modifiers: null); 184public ConstructorInfo? GetConstructor(BindingFlags bindingAttr, Binder? binder, Type[] types, ParameterModifier[]? modifiers) => GetConstructor(bindingAttr, binder, CallingConventions.Any, types, modifiers); 187public ConstructorInfo? GetConstructor(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 199protected abstract ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers); 231public virtual Type[] GetFunctionPointerCallingConventions() => throw new NotSupportedException(); 232public virtual Type GetFunctionPointerReturnType() => throw new NotSupportedException(); 233public virtual Type[] GetFunctionPointerParameterTypes() => throw new NotSupportedException(); 260/// Searches for the <see cref="MemberInfo"/> on the current <see cref="Type"/> that matches the specified <see cref="MemberInfo"/>. 263/// The <see cref="MemberInfo"/> to find on the current <see cref="Type"/>. 265/// <returns>An object representing the member on the current <see cref="Type"/> that matches the specified member.</returns> 268/// <exception cref="ArgumentException"><paramref name="member"/> does not match a member on the current <see cref="Type"/>.</exception> 315/// An array of <see cref="Type"/> objects representing the number, order, and type of the parameters for the method to get. 317/// An empty array of <see cref="Type"/> objects (as provided by the <see cref="EmptyTypes"/> field) to get a method that takes no parameters. 321public MethodInfo? GetMethod(string name, BindingFlags bindingAttr, Type[] types) => GetMethod(name, bindingAttr, binder: null, types, modifiers: null); 324public MethodInfo? GetMethod(string name, Type[] types) => GetMethod(name, types, null); 327public MethodInfo? GetMethod(string name, Type[] types, ParameterModifier[]? modifiers) => GetMethod(name, DefaultLookup, null, types, modifiers); 330public MethodInfo? GetMethod(string name, BindingFlags bindingAttr, Binder? binder, Type[] types, ParameterModifier[]? modifiers) => GetMethod(name, bindingAttr, binder, CallingConventions.Any, types, modifiers); 333public MethodInfo? GetMethod(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 346protected abstract MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers); 349public MethodInfo? GetMethod(string name, int genericParameterCount, Type[] types) => GetMethod(name, genericParameterCount, types, null); 352public MethodInfo? GetMethod(string name, int genericParameterCount, Type[] types, ParameterModifier[]? modifiers) => GetMethod(name, genericParameterCount, DefaultLookup, null, types, modifiers); 365/// An array of <see cref="Type"/> objects representing the number, order, and type of the parameters for the method to get. 367/// An empty array of <see cref="Type"/> objects (as provided by the <see cref="EmptyTypes"/> field) to get a method that takes no parameters. 371public MethodInfo? GetMethod(string name, int genericParameterCount, BindingFlags bindingAttr, Type[] types) => GetMethod(name, genericParameterCount, bindingAttr, null, types, null); 374public MethodInfo? GetMethod(string name, int genericParameterCount, BindingFlags bindingAttr, Binder? binder, Type[] types, ParameterModifier[]? modifiers) => GetMethod(name, genericParameterCount, bindingAttr, binder, CallingConventions.Any, types, modifiers); 377public MethodInfo? GetMethod(string name, int genericParameterCount, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 390protected virtual MethodInfo? GetMethodImpl(string name, int genericParameterCount, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => throw new NotSupportedException(); 399public Type? GetNestedType(string name) => GetNestedType(name, DefaultLookup); 402public abstract Type? GetNestedType(string name, BindingFlags bindingAttr); 405public Type[] GetNestedTypes() => GetNestedTypes(DefaultLookup); 408public abstract Type[] GetNestedTypes(BindingFlags bindingAttr); 424public PropertyInfo? GetProperty(string name, Type? returnType) 432public PropertyInfo? GetProperty(string name, Type[] types) => GetProperty(name, null, types); 435public PropertyInfo? GetProperty(string name, Type? returnType, Type[] types) => GetProperty(name, returnType, types, null); 438public PropertyInfo? GetProperty(string name, Type? returnType, Type[] types, ParameterModifier[]? modifiers) => GetProperty(name, DefaultLookup, null, returnType, types, modifiers); 441public PropertyInfo? GetProperty(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[] types, ParameterModifier[]? modifiers) 450protected abstract PropertyInfo? GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers); 480public static Type[] GetTypeArray(object[] args) 484Type[] cls = new Type[args.Length]; 495public static TypeCode GetTypeCode(Type? type) 549Type systemType = UnderlyingSystemType; 559public static Type? GetTypeFromCLSID(Guid clsid) => GetTypeFromCLSID(clsid, null, throwOnError: false); 561public static Type? GetTypeFromCLSID(Guid clsid, bool throwOnError) => GetTypeFromCLSID(clsid, null, throwOnError: throwOnError); 563public static Type? GetTypeFromCLSID(Guid clsid, string? server) => GetTypeFromCLSID(clsid, server, throwOnError: false); 565public static Type? GetTypeFromCLSID(Guid clsid, string? server, bool throwOnError) => Marshal.GetTypeFromCLSID(clsid, server, throwOnError); 568public static Type? GetTypeFromProgID(string progID) => GetTypeFromProgID(progID, null, throwOnError: false); 570public static Type? GetTypeFromProgID(string progID, bool throwOnError) => GetTypeFromProgID(progID, null, throwOnError: throwOnError); 572public static Type? GetTypeFromProgID(string progID, string? server) => GetTypeFromProgID(progID, server, throwOnError: false); 574public static Type? GetTypeFromProgID(string progID, string? server, bool throwOnError) => Marshal.GetTypeFromProgID(progID, server, throwOnError); 576public abstract Type? BaseType { get; } 593public Type? GetInterface(string name) => GetInterface(name, ignoreCase: false); 596public abstract Type? GetInterface(string name, bool ignoreCase); 598public abstract Type[] GetInterfaces(); 600public virtual InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) => throw new NotSupportedException(SR.NotSupported_SubclassOverride); 603public virtual bool IsEquivalentTo([NotNullWhen(true)] Type? other) => this == other; 608public virtual Type GetEnumUnderlyingType() 643public virtual Type MakeArrayType() => throw new NotSupportedException(); 645public virtual Type MakeArrayType(int rank) => throw new NotSupportedException(); 646public virtual Type MakeByRefType() => throw new NotSupportedException(); 650public virtual Type MakeGenericType(params Type[] typeArguments) => throw new NotSupportedException(SR.NotSupported_SubclassOverride); 652public virtual Type MakePointerType() => throw new NotSupportedException(); 654public static Type MakeGenericSignatureType(Type genericTypeDefinition, params Type[] typeArguments) => new SignatureConstructedGenericType(genericTypeDefinition, typeArguments); 656public static Type MakeGenericMethodParameter(int position) 670Type elementType = GetRootElementType(); 683public override bool Equals(object? o) => o == null ? false : Equals(o as Type); 686Type systemType = UnderlyingSystemType; 691public virtual bool Equals(Type? o) => o == null ? false : ReferenceEquals(this.UnderlyingSystemType, o.UnderlyingSystemType); 694public static bool operator ==(Type? left, Type? right) 709public static bool operator !=(Type? left, Type? right) 715public static Type? ReflectionOnlyGetType(string typeName, bool throwIfNotFound, bool ignoreCase) => throw new PlatformNotSupportedException(SR.PlatformNotSupported_ReflectionOnly); 725public static readonly Type[] EmptyTypes = Array.Empty<Type>();
src\libraries\System.Private.CoreLib\src\System\Type.Enum.cs (4)
28Type valueType = value.GetType(); 52Type underlyingType = GetEnumUnderlyingType(); 73Type valueType = value.GetType(); 167internal static bool IsIntegerType(Type t)
src\libraries\System.Private.CoreLib\src\System\Type.Helpers.cs (21)
21Type? underlyingType = UnderlyingSystemType; 55Type[] genericArguments = GetGenericArguments(); 66internal Type GetRootElementType() 68Type rootElementType = this; 91Type type = this; 107foreach (Type t in GetGenericArguments()) 119public virtual Type[] FindInterfaces(TypeFilter filter, object? filterCriteria) 123Type?[] c = GetInterfaces(); 135Type[] ret = new Type[cnt]; 139if (c[i] is Type t) 154Type?[]? t = null; 315if (t[i] is Type type) 322public virtual bool IsSubclassOf(Type c) 324Type? p = this; 337public virtual bool IsAssignableFrom([NotNullWhen(true)] Type? c) 347Type toType = this.UnderlyingSystemType; 361Type[] constraints = GetGenericParameterConstraints(); 377internal bool ImplementInterface(Type ifaceType) 379Type? t = this; 388Type[] interfaces = t.GetInterfaces();
src\libraries\System.Private.CoreLib\src\System\TypedReference.cs (1)
80public static Type GetTargetType(TypedReference value)
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
249object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
265object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
264object IConvertible.ToType(Type type, IFormatProvider? provider)
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (2)
224/// Managed pointer types are sometimes called byref types (<seealso cref="Type.IsByRef"/>) 241/// Unmanaged pointer types are often just called pointers (<seealso cref="Type.IsPointer"/>)
src\System\Attribute.CoreCLR.cs (52)
16private static Attribute[] InternalGetCustomAttributes(PropertyInfo element, Type type, bool inherit) 29Type[] indexParamTypes = GetIndexParameterTypes(element); 35Dictionary<Type, AttributeUsageAttribute> types = new Dictionary<Type, AttributeUsageAttribute>(11); 53private static bool InternalIsDefined(PropertyInfo element, Type attributeType, bool inherit) 67Type[] indexParamTypes = GetIndexParameterTypes(element); 86private static PropertyInfo? GetParentDefinition(PropertyInfo property, Type[] propertyParameters) 120private static Attribute[] InternalGetCustomAttributes(EventInfo element, Type type, bool inherit) 141Dictionary<Type, AttributeUsageAttribute> types = new Dictionary<Type, AttributeUsageAttribute>(11); 178private static bool InternalIsDefined(EventInfo element, Type attributeType, bool inherit) 237private static Attribute[] InternalParamGetCustomAttributes(ParameterInfo param, Type? type, bool inherit) 248List<Type> disAllowMultiple = new List<Type>(); 257Type objType = objAttr[i]!.GetType(); 285Type objType = objAttr[i]!.GetType(); 326private static bool InternalParamIsDefined(ParameterInfo param, Type type, bool inherit) 351Type objType = objAttr[i].GetType(); 367private static void CopyToAttributeList(List<Attribute> attributeList, Attribute[] attributes, Dictionary<Type, AttributeUsageAttribute> types) 373Type attrType = attributes[i].GetType(); 380private static Type[] GetIndexParameterTypes(PropertyInfo element) 386Type[] indexParamTypes = new Type[indexParams.Length]; 394return Type.EmptyTypes; 397private static void AddAttributesToList(List<Attribute> attributeList, Attribute[] attributes, Dictionary<Type, AttributeUsageAttribute> types) 401Type attrType = attributes[i].GetType(); 421private static AttributeUsageAttribute InternalGetAttributeUsage(Type type) 436private static Attribute[] CreateAttributeArrayHelper(Type elementType, int elementCount) => 445public static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType) 450public static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType, bool inherit) 483public static bool IsDefined(MemberInfo element, Type attributeType) 488public static bool IsDefined(MemberInfo element, Type attributeType, bool inherit) 505public static Attribute? GetCustomAttribute(MemberInfo element, Type attributeType) 510public static Attribute? GetCustomAttribute(MemberInfo element, Type attributeType, bool inherit) 532public static Attribute[] GetCustomAttributes(ParameterInfo element, Type attributeType) 537public static Attribute[] GetCustomAttributes(ParameterInfo element, Type attributeType, bool inherit) 569public static bool IsDefined(ParameterInfo element, Type attributeType) 574public static bool IsDefined(ParameterInfo element, Type attributeType, bool inherit) 603public static Attribute? GetCustomAttribute(ParameterInfo element, Type attributeType) 608public static Attribute? GetCustomAttribute(ParameterInfo element, Type attributeType, bool inherit) 627public static Attribute[] GetCustomAttributes(Module element, Type attributeType) 644public static Attribute[] GetCustomAttributes(Module element, Type attributeType, bool inherit) 655public static bool IsDefined(Module element, Type attributeType) 660public static bool IsDefined(Module element, Type attributeType, bool inherit) 673public static Attribute? GetCustomAttribute(Module element, Type attributeType) 678public static Attribute? GetCustomAttribute(Module element, Type attributeType, bool inherit) 697public static Attribute[] GetCustomAttributes(Assembly element, Type attributeType) 702public static Attribute[] GetCustomAttributes(Assembly element, Type attributeType, bool inherit) 725public static bool IsDefined(Assembly element, Type attributeType) 730public static bool IsDefined(Assembly element, Type attributeType, bool inherit) 743public static Attribute? GetCustomAttribute(Assembly element, Type attributeType) 748public static Attribute? GetCustomAttribute(Assembly element, Type attributeType, bool inherit)
src\System\Collections\Generic\ComparerHelpers.cs (2)
28internal static object CreateDefaultComparer(Type type) 62internal static object CreateDefaultEqualityComparer(Type type)
src\System\Delegate.CoreCLR.cs (9)
57protected Delegate([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] Type target, string method) 187Type targetType = declaringType.GetGenericTypeDefinition(); 188Type? currentType; 225public static Delegate? CreateDelegate(Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure) 260public static Delegate? CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] Type target, string method, bool ignoreCase, bool throwOnBindFailure) 296public static Delegate? CreateDelegate(Type type, MethodInfo method, bool throwOnBindFailure) 331public static Delegate? CreateDelegate(Type type, object? firstArgument, MethodInfo method, bool throwOnBindFailure) 367internal static Delegate CreateDelegateNoSecurityCheck(Type type, object? target, RuntimeMethodHandle method)
src\System\Diagnostics\StackFrameHelper.cs (3)
102Type? symbolsType = Type.GetType( 111Type[] parameterTypes =
src\System\Diagnostics\StackTrace.CoreCLR.cs (1)
31Type? t = mb.DeclaringType;
src\System\Object.CoreCLR.cs (1)
14public unsafe Type GetType()
src\System\Reflection\ConstructorInfo.CoreCLR.cs (1)
8internal virtual Type GetReturnType() { throw new NotImplementedException(); }
src\System\Reflection\Emit\CustomAttributeBuilder.cs (22)
85Type[] paramTypes; 136Type propType = property.PropertyType; 192Type fldType = namedField.FieldType; 242private static bool ValidateType(Type t) 248if (t == typeof(string) || t == typeof(Type)) 254return Type.GetTypeCode(Enum.GetUnderlyingType(t)) is 267private static void VerifyTypeAndPassedObjectType(Type type, Type passedType, string paramName) 269if (type != typeof(object) && Type.GetTypeCode(passedType) != Type.GetTypeCode(type)) 279private static void EmitType(BinaryWriter writer, Type type) 283switch (Type.GetTypeCode(type)) 335else if (type == typeof(Type)) 371private static void EmitValue(BinaryWriter writer, Type type, object? value) 375switch (Type.GetTypeCode(Enum.GetUnderlyingType(type))) 413else if (type == typeof(Type)) 419string typeName = TypeNameBuilder.ToString((Type)value, TypeNameBuilder.Format.AssemblyQualifiedName) ?? 431Type et = type.GetElementType()!; 439switch (Type.GetTypeCode(type)) 488Type ot = value == null ? typeof(string) : value is Type ? typeof(Type) : value.GetType();
src\System\Reflection\Emit\DynamicILGenerator.cs (27)
35public override LocalBuilder DeclareLocal(Type localType, bool pinned) 129public override void Emit(OpCode opcode, Type type) 173Type? returnType, 174Type[]? parameterTypes, 175Type[]? optionalParameterTypes) 213public override void EmitCalli(OpCode opcode, CallingConvention unmanagedCallConv, Type? returnType, Type[]? parameterTypes) 241public override void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[]? optionalParameterTypes) 328public override void BeginCatchBlock(Type? exceptionType) 390private int GetMemberRefToken(MethodInfo methodInfo, Type[]? optionalParameterTypes) 392Type[]? parameterTypes; 393Type[][]? requiredCustomModifiers; 394Type[][]? optionalCustomModifiers; 408parameterTypes = new Type[paramInfo.Length]; 409requiredCustomModifiers = new Type[parameterTypes.Length][]; 410optionalCustomModifiers = new Type[parameterTypes.Length][]; 441Type? returnType, 442Type[]? parameterTypes) 451Type? returnType, 452Type[]? parameterTypes, 453Type[][]? requiredCustomModifiers, 454Type[][]? optionalCustomModifiers, 455Type[]? optionalParameterTypes) 467private void AddParameters(SignatureHelper sigHelp, Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers) 1016Type t = m.DeclaringType!.GetGenericTypeDefinition();
src\System\Reflection\Emit\DynamicMethod.CoreCLR.cs (2)
44public sealed override Delegate CreateDelegate(Type delegateType) => 47public sealed override Delegate CreateDelegate(Type delegateType, object? target)
src\System\Reflection\Emit\RuntimeAssemblyBuilder.cs (3)
217public override object[] GetCustomAttributes(Type attributeType, bool inherit) => 220public override bool IsDefined(Type attributeType, bool inherit) => 235public override Type? GetType(string name, bool throwOnError, bool ignoreCase) =>
src\System\Reflection\Emit\RuntimeConstructorBuilder.cs (10)
17Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers, RuntimeModuleBuilder mod, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] RuntimeTypeBuilder type) 30Type[]? parameterTypes, RuntimeModuleBuilder mod, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] RuntimeTypeBuilder type) : 38internal override Type[] GetParameterTypes() 67public override Type? ReflectedType => m_methodBuilder.ReflectedType; 69public override Type? DeclaringType => m_methodBuilder.DeclaringType; 112public override object[] GetCustomAttributes(Type attributeType, bool inherit) 117public override bool IsDefined(Type attributeType, bool inherit) 155internal override Type GetReturnType()
src\System\Reflection\Emit\RuntimeEnumBuilder.cs (18)
87public override Type? BaseType => m_typeBuilder.BaseType; 93CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 107CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 135public override Type? GetInterface(string name, bool ignoreCase) 141public override Type[] GetInterfaces() 160Type? returnType, Type[]? types, ParameterModifier[]? modifiers) 172public override Type[] GetNestedTypes(BindingFlags bindingAttr) 178public override Type? GetNestedType(string name, BindingFlags bindingAttr) 195public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) 246public override Type? GetElementType() 257public override Type GetEnumUnderlyingType() 262public override Type UnderlyingSystemType => GetEnumUnderlyingType(); 271public override object[] GetCustomAttributes(Type attributeType, bool inherit) 283public override Type? DeclaringType => m_typeBuilder.DeclaringType; 287public override Type? ReflectedType => m_typeBuilder.ReflectedType; 290public override bool IsDefined(Type attributeType, bool inherit) 301Type underlyingType, // underlying type for an Enum
src\System\Reflection\Emit\RuntimeFieldBuilder.cs (9)
16private readonly Type m_fieldType; 20internal RuntimeFieldBuilder(RuntimeTypeBuilder typeBuilder, string fieldName, Type type, 21Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers, FieldAttributes attributes) 61public override Type? DeclaringType 72public override Type? ReflectedType 86public override Type FieldType => m_fieldType; 118public override object[] GetCustomAttributes(Type attributeType, bool inherit) 123public override bool IsDefined(Type attributeType, bool inherit)
src\System\Reflection\Emit\RuntimeGenericTypeParameterBuilder.cs (28)
46public override Type? DeclaringType => m_type.DeclaringType; 48public override Type? ReflectedType => m_type.ReflectedType; 61public override Type MakePointerType() 66public override Type MakeByRefType() 72public override Type MakeArrayType() 78public override Type MakeArrayType(int rank) 100public override Type? BaseType => m_type.BaseType; 103protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) { throw new NotSupportedException(); } 109protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) { throw new NotSupportedException(); } 122public override Type GetInterface(string name, bool ignoreCase) { throw new NotSupportedException(); } 125public override Type[] GetInterfaces() { throw new NotSupportedException(); } 134protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) { throw new NotSupportedException(); } 140public override Type[] GetNestedTypes(BindingFlags bindingAttr) { throw new NotSupportedException(); } 143public override Type GetNestedType(string name, BindingFlags bindingAttr) { throw new NotSupportedException(); } 148public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) { throw new NotSupportedException(); } 172public override Type GetElementType() { throw new NotSupportedException(); } 176public override Type UnderlyingSystemType => this; 178public override Type[] GetGenericArguments() { throw new InvalidOperationException(); } 196public override Type GetGenericTypeDefinition() { throw new InvalidOperationException(); } 200public override Type MakeGenericType(params Type[] typeArguments) { throw new InvalidOperationException(SR.Format(SR.Arg_NotGenericTypeDefinition, this)); } 204public override bool IsAssignableFrom([NotNullWhen(true)] Type? c) { throw new NotSupportedException(); } 206public override bool IsSubclassOf(Type c) { throw new NotSupportedException(); } 212public override object[] GetCustomAttributes(Type attributeType, bool inherit) { throw new NotSupportedException(); } 214public override bool IsDefined(Type attributeType, bool inherit) { throw new NotSupportedException(); } 223protected override void SetBaseTypeConstraintCore([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? baseTypeConstraint) 228protected override void SetInterfaceConstraintsCore(params Type[]? interfaceConstraints)
src\System\Reflection\Emit\RuntimeILGenerator.cs (20)
169private int GetMethodToken(MethodBase method, Type[]? optionalParameterTypes, bool useMethodDef) 176Type? returnType, 177Type[]? parameterTypes, 178Type[]? optionalParameterTypes) 515Type? returnType, Type[]? parameterTypes, Type[]? optionalParameterTypes) 556public override void EmitCalli(OpCode opcode, CallingConvention unmanagedCallConv, Type? returnType, Type[]? parameterTypes) 599public override void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[]? optionalParameterTypes) 616Type[] parameters = methodInfo.GetParameterTypes(); 696Type[] parameters = con.GetParameterTypes(); 706public override void Emit(OpCode opcode, Type cls) 1003public override void BeginCatchBlock(Type? exceptionType) 1164public override LocalBuilder DeclareLocal(Type localType, bool pinned) 1263internal Type[] m_catchClass; 1279m_catchClass = new Type[4]; 1290Type? catchClass, // catch exception type 1352internal void MarkCatchAddr(int catchAddr, Type? catchException) 1414internal Type[] GetCatchClass()
src\System\Reflection\Emit\RuntimeLocalBuilder.cs (4)
10private readonly Type m_localType; 16internal RuntimeLocalBuilder(int localIndex, Type localType, MethodInfo methodBuilder) 18internal RuntimeLocalBuilder(int localIndex, Type localType, MethodInfo methodBuilder, bool isPinned) 33public override Type LocalType => m_localType;
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (36)
45internal Type[]? m_parameterTypes; 46private Type m_returnType; 47private Type[]? m_returnTypeRequiredCustomModifiers; 48private Type[]? m_returnTypeOptionalCustomModifiers; 49private Type[][]? m_parameterTypeRequiredCustomModifiers; 50private Type[][]? m_parameterTypeOptionalCustomModifiers; 60Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 61Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers, 73foreach (Type t in parameterTypes) 100m_parameterTypes = new Type[parameterTypes.Length]; 145Type[] catchClass; 240internal override Type[] GetParameterTypes() => m_parameterTypes ??= Type.EmptyTypes; 242internal static Type? GetMethodBaseReturnType(MethodBase? method) 278m_parameterTypes ??= Type.EmptyTypes; 409public override Type? DeclaringType 421public override Type? ReflectedType => DeclaringType; 455public override Type ReturnType => m_returnType; 487public override object[] GetCustomAttributes(Type attributeType, bool inherit) 492public override bool IsDefined(Type attributeType, bool inherit) 508public override Type[] GetGenericArguments() => m_inst ?? Type.EmptyTypes; 512public override MethodInfo MakeGenericMethod(params Type[] typeArguments) 614Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 615Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers) 631m_parameterTypes = new Type[parameterTypes.Length]; 714Type? caType = con.DeclaringType; 720Type? caType = con.DeclaringType;
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (90)
49private readonly Dictionary<string, Type> _typeBuilderDict; 71_typeBuilderDict = new Dictionary<string, Type>(); 77internal void AddType(string name, Type type) => _typeBuilderDict.Add(name, type); 79internal void CheckTypeNameConflict(string strTypeName, Type? enclosingType) 81if (_typeBuilderDict.TryGetValue(strTypeName, out Type? foundType) && 89private static Type? GetType(string strFormat, Type baseType) 180internal Type? FindTypeBuilderWithName(string strTypeName, bool ignoreCase) 194if (_typeBuilderDict.TryGetValue(strTypeName, out Type? foundType)) 203private int GetTypeRefNested(Type type, Module? refedModule) 206Type? enclosingType = type.DeclaringType; 258Type[] parameterTypes = new Type[parameters.Length]; 259Type[][] requiredCustomModifiers = new Type[parameters.Length][]; 260Type[][] optionalCustomModifiers = new Type[parameters.Length][]; 304private int GetMemberRefToken(MethodBase method, Type[]? optionalParameterTypes) 372internal SignatureHelper GetMemberRefSignature(CallingConventions call, Type? returnType, 373Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers, 374Type[]? optionalParameterTypes, int cGenericParameters) 460Type[] parameterTypes = new Type[parameters.Length]; 461Type[][] requiredCustomModifiers = new Type[parameterTypes.Length][]; 462Type[][] optionalCustomModifiers = new Type[parameterTypes.Length][]; 489public override object[] GetCustomAttributes(Type attributeType, bool inherit) 494public override bool IsDefined(Type attributeType, bool inherit) 509public override Type[] GetTypes() 517internal Type[] GetTypesNoLock() 519Type[] typeList = new Type[_typeBuilderDict.Count]; 522foreach (Type builder in _typeBuilderDict.Values) 543public override Type? GetType(string className) 549public override Type? GetType(string className, bool ignoreCase) 555public override Type? GetType(string className, bool throwOnError, bool ignoreCase) 564private Type? GetTypeNoLock(string className, bool throwOnError, bool ignoreCase) 574Type? baseType = InternalModule.GetType(className, throwOnError, ignoreCase); 661public override MethodBase? ResolveMethod(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 667public override FieldInfo? ResolveField(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 673public override Type ResolveType(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 679public override MemberInfo? ResolveMember(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 723CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 742protected override TypeBuilder DefineTypeCore(string name, TypeAttributes attr, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, Type[]? interfaces, PackingSize packingSize, int typesize) 756protected override EnumBuilder DefineEnumCore(string name, TypeAttributes visibility, Type underlyingType) 776MethodAttributes attributes, CallingConventions callingConvention, Type? returnType, 777Type[]? parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet) 792Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, 793Type[]? parameterTypes, Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers) 804Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, 805Type[]? parameterTypes, Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers) 881internal int GetTypeTokenInternal(Type type, bool getGenericDefinition = false) 889public override int GetTypeMetadataToken(Type type) 894private int GetTypeTokenWorkerNoLock(Type type, bool getGenericDefinition) 995Type declaringType = method.DeclaringType ?? 1003Type[] tt = new Type[paramInfo.Length]; 1021Type[] parameterTypes = new Type[parameters.Length]; 1022Type[][] requiredCustomModifiers = new Type[parameterTypes.Length][]; 1023Type[][] optionalCustomModifiers = new Type[parameterTypes.Length][]; 1057internal int GetMethodTokenInternal(MethodBase method, Type[]? optionalParameterTypes, bool useMethodDef) 1122internal int GetArrayMethodToken(Type arrayClass, string methodName, CallingConventions callingConvention, 1123Type? returnType, Type[]? parameterTypes) 1131private int GetArrayMethodTokenNoLock(Type arrayClass, string methodName, CallingConventions callingConvention, 1132Type? returnType, Type[]? parameterTypes) 1151protected override MethodInfo GetArrayMethodCore(Type arrayClass, string methodName, CallingConventions callingConvention, 1152Type? returnType, Type[]? parameterTypes)
src\System\Reflection\Emit\RuntimePropertyBuilder.cs (7)
32Type? returnType, // return type of the property. 161public override Type PropertyType => m_returnType; 180public override object[] GetCustomAttributes(Type attributeType, bool inherit) 185public override bool IsDefined(Type attributeType, bool inherit) 192public override Type? DeclaringType => m_containingType; 194public override Type? ReflectedType => m_containingType; 201private readonly Type m_returnType; // property's return type
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (75)
137internal static bool IsTypeEqual(Type? t1, Type? t2) 144Type? runtimeType1; 145Type? runtimeType2; 181internal static unsafe void SetConstantValue(RuntimeModuleBuilder module, int tk, Type destType, object? value) 188Type type = value.GetType(); 213Type? underlyingType; 312private Type? m_typeParent; 314private List<Type>? m_typeInterfaces; 325private Type? m_enumUnderlyingType; 358m_typeInterfaces = new List<Type>(); 372m_typeInterfaces = new List<Type>(); 380string name, TypeAttributes attr, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, Type[]? interfaces, RuntimeModuleBuilder module, 483Type? temp = m_module.FindTypeBuilderWithName(strValueClassName, false); 611public override Type? DeclaringType => m_DeclaringType; 613public override Type? ReflectedType => m_DeclaringType; 659public override Type? BaseType => m_typeParent; 663CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 682CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 726public override Type? GetInterface(string name, bool ignoreCase) 735public override Type[] GetInterfaces() 770Type? returnType, Type[]? types, ParameterModifier[]? modifiers) 785public override Type[] GetNestedTypes(BindingFlags bindingAttr) 794public override Type? GetNestedType(string name, BindingFlags bindingAttr) 811public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) 840public override bool IsAssignableFrom([NotNullWhen(true)] Type? c) 845Type? fromRuntimeType; 876Type[] interfaces = fromTypeBuilder.GetInterfaces(); 920public override Type GetElementType() 937public override bool IsSubclassOf(Type c) 939Type? p = this; 957public override Type UnderlyingSystemType 989public override object[] GetCustomAttributes(Type attributeType, bool inherit) 1002public override bool IsDefined(Type attributeType, bool inherit) 1022internal void SetInterfaces(params Type[]? interfaces) 1026m_typeInterfaces = new List<Type>(); 1051public override Type[] GetGenericArguments() => m_inst ?? EmptyTypes; 1062public override Type GetGenericTypeDefinition() { if (IsGenericTypeDefinition) return this; if (m_genTypeDef == null) throw new InvalidOperationException(); return m_genTypeDef; } 1087Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 1088Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers) 1119Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 1120Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers, 1250Type? genericTypeDefinition = m_typeParent.GetGenericTypeDefinition(); 1258Type inst = genericTypeDefinition.MakeGenericType(m_typeParent.GetGenericArguments()); 1287Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers) 1303Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers) 1332protected override TypeBuilder DefineNestedTypeCore(string name, TypeAttributes attr, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, Type[]? interfaces, PackingSize packSize, int typeSize) 1343protected override FieldBuilder DefineFieldCore(string fieldName, Type type, Type[]? requiredCustomModifiers, 1344Type[]? optionalCustomModifiers, FieldAttributes attributes) 1391Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 1392Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers) 1431protected override EventBuilder DefineEventCore(string name, EventAttributes attributes, Type eventtype) 1499m_typeInterfaces ??= new List<Type>(); 1685protected override void SetParentCore([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent) 1713protected override void AddInterfaceImplementationCore([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType)
src\System\Reflection\Emit\SignatureHelper.cs (66)
19public static SignatureHelper GetMethodSigHelper(Module? mod, Type? returnType, Type[]? parameterTypes) 24public static SignatureHelper GetMethodSigHelper(Module? mod, CallingConventions callingConvention, Type? returnType) 29internal static SignatureHelper GetMethodSpecSigHelper(Module? scope, Type[] inst) 33foreach (Type t in inst) 40Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, 41Type[]? parameterTypes, Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers) 49Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, 50Type[]? parameterTypes, Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers) 77internal static SignatureHelper GetMethodSigHelper(Module? mod, CallingConvention unmanagedCallConv, Type? returnType) 112public static SignatureHelper GetMethodSigHelper(CallingConventions callingConvention, Type? returnType) 117internal static SignatureHelper GetMethodSigHelper(CallingConvention unmanagedCallingConvention, Type? returnType) 132public static SignatureHelper GetPropertySigHelper(Module? mod, Type? returnType, Type[]? parameterTypes) 138Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, 139Type[]? parameterTypes, Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers) 145Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, 146Type[]? parameterTypes, Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers) 164internal static SignatureHelper GetTypeSigToken(Module module, Type type) 190Type returnType, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers) 202Type returnType, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers) 207private SignatureHelper(Module mod, Type type) 260private void AddOneArgTypeHelper(Type argument, bool pinned) 268private void AddOneArgTypeHelper(Type clsArgument, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers) 279Type t = optionalCustomModifiers[i]; 300Type t = requiredCustomModifiers[i]; 321private void AddOneArgTypeHelper(Type clsArgument) { AddOneArgTypeHelperWorker(clsArgument, false); } 322private void AddOneArgTypeHelperWorker(Type clsArgument, bool lastWasGenericInst) 339Type[] args = clsArgument.GetGenericArguments(); 343foreach (Type t in args) 539private unsafe void InternalAddRuntimeType(Type type) 730internal void AddDynamicArgument(DynamicScope dynamicScope, Type clsArgument, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers) 740Type t = optionalCustomModifiers[i]; 763Type t = requiredCustomModifiers[i]; 788public void AddArgument(Type clsArgument) 793public void AddArgument(Type argument, bool pinned) 801public void AddArguments(Type[]? arguments, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers) 818public void AddArgument(Type argument, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers)
src\System\Reflection\Emit\SymbolMethod.cs (14)
12private readonly Type m_containingType; 15private readonly Type m_returnType; 17private readonly Type[] m_parameterTypes; 21internal SymbolMethod(ModuleBuilder mod, int token, Type arrayClass, string methodName, 22CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes) 37m_parameterTypes = new Type[parameterTypes.Length]; 42m_parameterTypes = Type.EmptyTypes; 57internal override Type[] GetParameterTypes() 74public override Type? ReflectedType => m_containingType; 78public override Type? DeclaringType => m_containingType; 101public override Type ReturnType => m_returnType; 122public override object[] GetCustomAttributes(Type attributeType, bool inherit) 127public override bool IsDefined(Type attributeType, bool inherit)
src\System\Reflection\FieldInfo.CoreCLR.cs (1)
15Type? declaringType = f.DeclaringType;
src\System\Reflection\MdFieldInfo.cs (5)
109public override Type FieldType 125public override Type[] GetRequiredCustomModifiers() 127return Type.EmptyTypes; 130public override Type[] GetOptionalCustomModifiers() 132return Type.EmptyTypes;
src\System\Reflection\Metadata\RuntimeTypeMetadataUpdateHandler.cs (6)
17public static void ClearCache(Type[]? types) 33foreach (Type type in assembly.GetTypes()) 45foreach (Type type in types) 59private static void ClearCache(Type type) => (type as RuntimeType)?.ClearCache(); 64private static bool RequiresClearingAllTypes([NotNullWhen(false)] Type[]? types) 74foreach (Type type in types)
src\System\Reflection\MethodBase.CoreCLR.cs (1)
22Type? declaringType = m?.DeclaringType;
src\System\Reflection\ModifiedType.CoreCLR.cs (5)
14internal Type GetTypeParameter(Type unmodifiedType, int index) => 24internal static Type Create(Type unmodifiedType, Signature? signature, int parameterIndex = 0) => 31private Type[] GetCustomModifiers(bool required) =>
src\System\Reflection\RtFieldInfo.cs (4)
124public override Type FieldType 136public override Type[] GetRequiredCustomModifiers() 141public override Type[] GetOptionalCustomModifiers() 148public override Type GetModifiedFieldType() =>
src\System\Reflection\RuntimeAssembly.cs (18)
203internal Type? GetTypeCore(string typeName, ReadOnlySpan<string> nestedTypeNames, bool throwOnError, bool ignoreCase) 206Type? type = null; 239public override Type? GetType( 253public override Type[] GetExportedTypes() 255Type[]? types = null; 286public override Stream? GetManifestResourceStream(Type type, string name) 293char c = Type.Delimiter; 332public override object[] GetCustomAttributes(Type attributeType, bool inherit) 342public override bool IsDefined(Type attributeType, bool inherit) 742public sealed override Type[] GetForwardedTypes() 744List<Type> types = new List<Type>(); 754Type? type = null; 786types.AddRange(new Type[numExceptions]); // add one null Type for each exception. 795private static void AddPublicNestedTypes(Type type, List<Type> types, List<Exception> exceptions) 797Type[] nestedTypes; 807foreach (Type nestedType in nestedTypes)
src\System\Reflection\RuntimeConstructorInfo.CoreCLR.cs (6)
134public override object[] GetCustomAttributes(Type attributeType, bool inherit) 144public override bool IsDefined(Type attributeType, bool inherit) 164public override Type? DeclaringType => m_reflectedTypeCache.IsGlobal ? null : m_declaringType; 168public override Type? ReflectedType => m_reflectedTypeCache.IsGlobal ? null : ReflectedTypeInternal; 181internal override Type GetReturnType() { return Signature.ReturnType; } 207var declaringType = DeclaringType;
src\System\Reflection\RuntimeCustomAttributeData.cs (15)
124if (type == typeof(Type)) 223internal static CustomAttributeTypedArgument Filter(IList<CustomAttributeData> attrs, Type? caType, int parameter) 259Type attributeType = m_scope.ResolveType(metadataScope.GetParentToken(caCtorToken), null, null)!; 318Type type = typeof(DllImportAttribute); 347Type type = typeof(MarshalAsAttribute); 384Type type = typeof(TypeForwardedToAttribute); 386Type[] sig = [typeof(Type)]; 389CustomAttributeTypedArgument[] typedArgs = [new CustomAttributeTypedArgument(typeof(Type), forwardedTo.Destination)]; 399Type type = pca.GetType(); 499private static Type CustomAttributeEncodingToType(CustomAttributeEncoding encodedType) 506CustomAttributeEncoding.Type => typeof(Type), 570_argumentType = typeof(Type); 580Type elementType; 881Type? enumType = null;
src\System\Reflection\RuntimeEventInfo.cs (4)
94public override object[] GetCustomAttributes(Type attributeType, bool inherit) 104public override bool IsDefined(Type attributeType, bool inherit) 123public override Type? DeclaringType => m_declaringType; 125public override Type? ReflectedType => ReflectedTypeInternal;
src\System\Reflection\RuntimeExceptionHandlingClause.cs (3)
40public override Type? CatchType 52Type? type = null; 56Type? declaringType = _methodBody._methodBase.DeclaringType;
src\System\Reflection\RuntimeFieldInfo.cs (4)
41public override Type? ReflectedType => m_reflectedTypeCache.IsGlobal ? null : ReflectedTypeInternal; 43public override Type? DeclaringType => m_reflectedTypeCache.IsGlobal ? null : m_declaringType; 65public override object[] GetCustomAttributes(Type attributeType, bool inherit) 75public override bool IsDefined(Type attributeType, bool inherit)
src\System\Reflection\RuntimeLocalVariableInfo.cs (1)
16public override Type LocalType { get { Debug.Assert(_type != null, "type must be set!"); return _type; } }
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (15)
177public override object[] GetCustomAttributes(Type attributeType, bool inherit) 187public override bool IsDefined(Type attributeType, bool inherit) 206public override Type? DeclaringType 219public override Type? ReflectedType 316public override Type ReturnType => Signature.ReturnType; 350public override Delegate CreateDelegate(Type delegateType) 366public override Delegate CreateDelegate(Type delegateType, object? target) 379private Delegate CreateDelegateInternal(Type delegateType, object? firstArgument, DelegateBindingFlags bindingFlags) 397public override MethodInfo MakeGenericMethod(params Type[] methodInstantiation) 409Type methodInstantiationElem = methodInstantiation[i]; 416Type[] methodInstantiationCopy = new Type[methodInstantiation.Length]; 449public override Type[] GetGenericArguments() => 450RuntimeMethodHandle.GetMethodInstantiationPublic(this) ?? Type.EmptyTypes; 474Type[] pis = GetGenericArguments();
src\System\Reflection\RuntimeModule.cs (21)
27private static RuntimeTypeHandle[]? ConvertToTypeHandleArray(Type[]? genericArguments) 36Type? typeArg = genericArguments[i]?.UnderlyingSystemType; 74public override MethodBase? ResolveMethod(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 109Type declaringType = RuntimeMethodHandle.GetDeclaringType(methodHandle); 130private FieldInfo? ResolveLiteralField(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 142Type declaringType = ResolveType(tkDeclaringType, genericTypeArguments, genericMethodArguments); 158public override FieldInfo? ResolveField(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 219public override Type ResolveType(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 251public override MemberInfo? ResolveMember(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 323CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 330CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 358public override object[] GetCustomAttributes(Type attributeType, bool inherit) 368public override bool IsDefined(Type attributeType, bool inherit) 393public override Type? GetType( 430public override Type[] GetTypes() => GetDefinedTypes();
src\System\Reflection\RuntimeParameterInfo.cs (11)
199internal RuntimeParameterInfo(MethodInfo owner, string? name, Type parameterType, int position) 214public override Type ParameterType 290defaultValue = Type.Missing; 302Type attributeType = attributeData.AttributeType; 435public override Type[] GetRequiredCustomModifiers() 438Type.EmptyTypes : 442public override Type[] GetOptionalCustomModifiers() 445Type.EmptyTypes : 449public override Type GetModifiedParameterType() => 463public override object[] GetCustomAttributes(Type attributeType, bool inherit) 476public override bool IsDefined(Type attributeType, bool inherit)
src\System\Reflection\RuntimePropertyInfo.cs (8)
142public override object[] GetCustomAttributes(Type attributeType, bool inherit) 152public override bool IsDefined(Type attributeType, bool inherit) 171public override Type? DeclaringType => m_declaringType; 175public override Type? ReflectedType => ReflectedTypeInternal; 200public override Type[] GetRequiredCustomModifiers() 205public override Type[] GetOptionalCustomModifiers() 210public override Type GetModifiedPropertyType() => ModifiedType.Create(PropertyType, Signature); 249public override Type PropertyType => Signature.ReturnType;
src\System\Reflection\TypeNameResolver.CoreCLR.cs (11)
18private Func<Assembly?, string, bool, Type?>? _typeResolver; 28internal static Type? GetType( 39internal static Type? GetType( 42Func<Assembly?, string, bool, Type?>? typeResolver, 77internal static Type? GetType( 188private Type? GetType(string escapedTypeName, ReadOnlySpan<string> nestedTypeNames, TypeName parsedName) 203Type? type; 280private Type? GetTypeFromDefaultAssemblies(string typeName, ReadOnlySpan<string> nestedTypeNames, TypeName parsedName) 285Type? type = requestingAssembly.GetTypeCore(typeName, nestedTypeNames, throwOnError: false, ignoreCase: _ignoreCase); 293Type? type = coreLib.GetTypeCore(typeName, nestedTypeNames, throwOnError: false, ignoreCase: _ignoreCase); 301Type? type = resolvedAssembly.GetTypeCore(typeName, nestedTypeNames, throwOnError: false, ignoreCase: _ignoreCase);
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (3)
337Type type) 471/// will be freed if and when the <see cref="Type"/> is unloaded. 476public static IntPtr AllocateTypeAssociatedMemory(Type type, int size)
src\System\Runtime\InteropServices\Marshal.CoreCLR.cs (2)
41public static IntPtr OffsetOf(Type t, string fieldName) 305public static unsafe void DestroyStructure(IntPtr ptr, Type structuretype)
src\System\RuntimeHandles.cs (16)
194internal static IntPtr[]? CopyRuntimeTypeHandles(Type[]? inHandles, out int length) 218Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic, 242Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic, 458internal static Type[] GetArgumentTypesFromFunctionPointer(RuntimeType type) 461Type[]? argTypes = null; 541internal static Type[] GetInterfaces(RuntimeType type) 551Type[] result = []; 560internal Type[] GetConstraints() 562Type[]? types = null; 726internal Type[] GetInstantiationPublic() 728Type[]? types = null; 748internal RuntimeType Instantiate(Type[]? inst) 1207internal static Type[] GetMethodInstantiationPublic(IRuntimeMethodInfo method) 2099internal Type[] GetCustomModifiers(int parameterIndex, bool required) => 2109internal Type[] GetCustomModifiersAtOffset(int offset, bool required) 2112Type[]? result = null;
src\System\RuntimeType.CoreCLR.cs (63)
829Type[] interfaces; 839foreach (Type iface in interfaces) 985Type[] iFaces = iList.GetInterfaces(); 1008Type[] ifaces = RuntimeTypeHandle.GetInterfaces(declaringType); 1009foreach (Type iface in ifaces) 1043Type[] constraints = declaringType.GetGenericParameterConstraints(); 1052Type[] temp = constraint.GetInterfaces(); 1492public Type[] FunctionPointerReturnAndParameterTypes { get; } 1494private FunctionPointerCache(Type[] functionPointerReturnAndParameterTypes) 1508internal Type[] FunctionPointerReturnAndParameterTypes 1555Type type = m_runtimeType; 1603Type DefaultMemberAttrType = typeof(DefaultMemberAttribute); 2018if (definition is Type) 2033Type genericArgument = genericArguments[i]; 2034Type genericParameter = genericParameters[i]; 2240Type type, BindingFlags bindingFlags, string name, bool prefixLookup, string? ns) 2257RuntimeMethodInfo method, BindingFlags bindingFlags, CallingConventions callConv, Type[]? argumentTypes) 2264RuntimeConstructorInfo constructor, BindingFlags bindingFlags, CallingConventions callConv, Type[]? argumentTypes) 2273MethodBase methodBase, BindingFlags methodFlags, BindingFlags bindingFlags, CallingConventions callConv, Type[]? argumentTypes) 2380if (argumentTypes[i] is Type t && !t.MatchesParameterTypeExactly(parameterInfos[i])) 2519Type[]? types, bool allowPrefixLookup) 2544Type[]? types, bool allowPrefixLookup) 2565string? name, BindingFlags bindingAttr, Type[]? types, bool allowPrefixLookup) 2632private ListBuilder<Type> GetNestedTypeCandidates(string? fullname, BindingFlags bindingAttr, bool allowPrefixLookup) 2640ListBuilder<Type> candidates = new ListBuilder<Type>(cache.Length); 2686public override Type[] GetInterfaces() 2689return new ReadOnlySpan<Type>(candidates).ToArray(); 2693public override Type[] GetNestedTypes(BindingFlags bindingAttr) 2706ListBuilder<Type> nestedTypes = GetNestedTypeCandidates(null, bindingAttr, false); 2729public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) 2799Type[]? types, ParameterModifier[]? modifiers) 2807Type[]? types, ParameterModifier[]? modifiers) 2814Type[]? types, ParameterModifier[]? modifiers) 2850Type[] types, ParameterModifier[]? modifiers) 2876string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) 2983public override Type? GetInterface(string fullname, bool ignoreCase) 3018public override Type? GetNestedType(string fullname, BindingFlags bindingAttr) 3056ListBuilder<Type> nestedTypes = default; 3284public override bool IsSubclassOf(Type type) 3543public override Type GetGenericTypeDefinition() 3582public override Type[] GetGenericArguments() 3584Type[] types = GetRootElementType().TypeHandle.GetInstantiationPublic(); 3589public override Type MakeGenericType(Type[] instantiation) 3620Type instantiationElem = instantiation[i] ?? throw new ArgumentNullException(); 3640return Reflection.Emit.TypeBuilderInstantiation.MakeGenericType(this, (Type[])(instantiation.Clone())); 3645Type ret; 3673public override Type[] GetGenericParameterConstraints() 3678Type[] constraints = new RuntimeTypeHandle(this).GetConstraints(); 3705public override Type MakePointerType() => new RuntimeTypeHandle(this).MakePointer(); 3707public override Type MakeByRefType() => new RuntimeTypeHandle(this).MakeByRef(); 3709public override Type MakeArrayType() => new RuntimeTypeHandle(this).MakeSZArray(); 3711public override Type MakeArrayType(int rank) 3790public override Type[] GetFunctionPointerCallingConventions() 3801public override Type[] GetFunctionPointerParameterTypes() 3808Type[] parameters = Cache.FunctionPointerReturnAndParameterTypes; 3819public override Type GetFunctionPointerReturnType() 3844public override Type? DeclaringType => Cache.GetEnclosingType(); 3855Type elementType = GetRootElementType(); 3892Type[] argsType = args.Length != 0 ? new Type[args.Length] : EmptyTypes;
src\System\RuntimeType.CreateUninitializedCache.CoreCLR.cs (1)
13/// A cache which allows optimizing <see cref="RuntimeHelpers.GetUninitializedObject(Type)"/>.
src\System\StubHelpers.cs (3)
877private Type? layoutType; 913Type elementType = pManagedHome.GetType().GetElementType()!; 916switch (Type.GetTypeCode(elementType))
src\System\Type.CoreCLR.cs (10)
16public static Type? GetType(string typeName, bool throwOnError, bool ignoreCase) 25public static Type? GetType(string typeName, bool throwOnError) 34public static Type? GetType(string typeName) 42public static Type? GetType( 45Func<Assembly?, string, bool, Type?>? typeResolver) 54public static Type? GetType( 57Func<Assembly?, string, bool, Type?>? typeResolver, 68public static Type? GetType( 71Func<Assembly?, string, bool, Type?>? typeResolver, 82public static Type? GetTypeFromHandle(RuntimeTypeHandle handle)
System.Private.DataContractSerialization (988)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (5)
43public CodeTypeReference(Type type) 70public CodeTypeReference(Type type, CodeTypeReferenceOptions codeTypeReferenceOption) : this(type) 85private void InitializeFromType(Type type) 90Type currentType = type; 106Type[] genericArgs = type.GetGenericArguments();
src\libraries\Common\src\System\CodeDom\CodeTypeReferenceCollection.cs (1)
40public void Add(Type value) => Add(new CodeTypeReference(value));
System\Runtime\Serialization\AccessorBuilder.cs (5)
34Type type) 46Type declaringType = propInfo.DeclaringType!; 47Type propertyType = propInfo.PropertyType!; 103Type declaringType = propInfo.DeclaringType!; 104Type propertyType = propInfo.PropertyType!;
System\Runtime\Serialization\ClassDataContract.cs (33)
36internal ClassDataContract(Type type) : base(new ClassDataContractCriticalHelper(type)) 43private ClassDataContract(Type type, XmlDictionaryString ns, string[] memberNames) : base(new ClassDataContractCriticalHelper(type, ns, memberNames)) 251internal static ClassDataContract CreateClassDataContractForKeyValue(Type type, XmlDictionaryString ns, string[] memberNames) 260Type declaringType = memberContract.MemberInfo.DeclaringType!; 275internal static XmlDictionaryString? GetChildNamespaceToDeclare(DataContract dataContract, Type childType, XmlDictionary dictionary) 288private static bool IsArraySegment(Type t) 302Type type) 324foreach (Type interfaceType in type.GetInterfaces()) 349type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Type.EmptyTypes) != null); 589private static Type[]? s_serInfoCtorArgs; 619Type type) : base(type) 633Type? baseType = type.BaseType; 725Type type, XmlDictionaryString ns, string[] memberNames) : base(type) 744private void EnsureIsReferenceImported(Type type) 801Type type = UnderlyingType; 1037private XmlQualifiedName GetXmlNameAndSetHasDataContract(Type type) 1051Type type) 1071Type type = UnderlyingType; 1076Type? prevAttributeType = null; 1118private static bool IsValidCallback(MethodInfo method, ParameterInfo[] parameters, Type attributeType, MethodInfo? currentCallback, ref Type? prevAttributeType) 1260Type type = UnderlyingType; 1265ConstructorInfo? ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Type.EmptyTypes); 1278private static Type[] SerInfoCtorArgs => s_serInfoCtorArgs ??= new Type[] { typeof(SerializationInfo), typeof(StreamingContext) }; 1316Type type = UnderlyingType; 1327Type boundType; 1336Type[] underlyingParamTypes = new Type[paramContracts.Length]; 1345Type[] paramTypes = type.GetGenericArguments(); 1349Type paramType = paramTypes[i]; 1500internal Type ObjectType 1504Type type = UnderlyingType;
System\Runtime\Serialization\CodeGenerator.cs (56)
24s_getTypeFromHandle = typeof(Type).GetMethod("GetTypeFromHandle"); 52s_arraySetValue = typeof(Array).GetMethod("SetValue", new Type[] { typeof(object), typeof(int) }); 66s_objectToString = typeof(object).GetMethod("ToString", Type.EmptyTypes); 80s_stringFormat = typeof(string).GetMethod("Format", new Type[] { typeof(string), typeof(object[]) }); 89internal static MethodInfo GetInvokeMethod(Type delegateType) 95private Type _delegateType = null!; // initialized in BeginMethod 111internal void BeginMethod(DynamicMethod dynamicMethod, Type delegateType, Type[] argTypes) 121internal void BeginMethod(string methodName, Type delegateType, bool allowPrivateMemberAccess) 125Type[] paramTypes = new Type[parameters.Length]; 133private void BeginMethod(Type returnType, string methodName, Type[] argTypes, bool allowPrivateMemberAccess) 142private void InitILGeneration(Type[] argTypes) 180internal static Type GetVariableType(object var) 190internal LocalBuilder DeclareLocal(Type type, object initialValue) 198internal LocalBuilder DeclareLocal(Type type) 203internal LocalBuilder DeclareLocal(Type type, bool isPinned) 282internal void ForEach(LocalBuilder local, Type elementType, 317Type type = GetVariableType(value); 318TypeCode typeCode = Type.GetTypeCode(type); 518internal void InitObj(Type valueType) 523internal void NewArray(Type elementType, object len) 531Type objType = GetVariableType(obj).GetElementType()!; 545Type arrayType = GetVariableType(obj); 552Type objType = arrayType.GetElementType()!; 566private static bool IsStruct(Type objType) 571internal Type LoadMember(MemberInfo memberInfo) 573Type? memberType; 631internal void LoadDefaultValue(Type type) 635switch (Type.GetTypeCode(type)) 719internal void ConvertAddress(Type source, Type target) 724internal void ConvertValue(Type source, Type target) 730internal void Castclass(Type target) 735internal void Box(Type type) 740internal void Unbox(Type type) 764internal void Ldobj(Type type) 766OpCode opCode = GetLdindOpCode(Type.GetTypeCode(type)); 777internal void Stobj(Type type) 793internal void Ldtoken(Type t) 800Type valueType = o.GetType(); 801if (o is Type t) 812switch (Type.GetTypeCode(valueType)) 982internal void Ldelem(Type arrayElementType) 990OpCode opCode = GetLdelemOpCode(Type.GetTypeCode(arrayElementType)); 996internal void Ldelema(Type arrayElementType) 1022internal void Stelem(Type arrayElementType) 1028OpCode opCode = GetStelemOpCode(Type.GetTypeCode(arrayElementType)); 1150private void InternalConvert(Type source, Type target, bool isAddress) 1158OpCode opCode = GetConvOpCode(Type.GetTypeCode(target)); 1305internal void ToString(Type type) 1321internal Type ArgType; 1322internal ArgBuilder(int index, Type argType)
System\Runtime\Serialization\CollectionDataContract.cs (93)
85internal CollectionDataContract(Type type) : base(new CollectionDataContractCriticalHelper(type)) 92internal CollectionDataContract(Type type, DataContract itemContract) : base(new CollectionDataContractCriticalHelper(type, itemContract)) 99internal CollectionDataContract(Type type, CollectionKind kind) : base(new CollectionDataContractCriticalHelper(type, kind)) 106private CollectionDataContract(Type type, CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, string? serializationExceptionMessage, string? deserializationExceptionMessage) 114private CollectionDataContract(Type type, CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, MethodInfo? addMethod, ConstructorInfo? constructor) 122private CollectionDataContract(Type type, CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, MethodInfo? addMethod, ConstructorInfo? constructor, bool isConstructorCheckRequired) 130private CollectionDataContract(Type type, string invalidCollectionInSharedContractMessage) : base(new CollectionDataContractCriticalHelper(type, invalidCollectionInSharedContractMessage)) 150private static Type[] KnownInterfaces => CollectionDataContractCriticalHelper.KnownInterfaces; 154internal Type ItemType => _helper.ItemType; 395internal Type GetCollectionElementType() 402private static Type[]? s_knownInterfaces; 404private Type _itemType = null!; // _itemType is always set except for the "invalid" CollectionDataContract 428internal static Type[] KnownInterfaces => 430s_knownInterfaces ??= new Type[] 444private void Init(CollectionKind kind, Type? itemType, CollectionDataContractAttribute? collectionContractAttribute) 502Type type) : base(type) 516Type type, 528Type type, 543Type type, 544CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, string? serializationExceptionMessage, string? deserializationExceptionMessage) 566Type type, 567CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, MethodInfo? addMethod, ConstructorInfo? constructor) 580internal CollectionDataContractCriticalHelper(Type type, CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, MethodInfo? addMethod, ConstructorInfo? constructor, bool isConstructorCheckRequired) 590Type type, 599internal Type ItemType => _itemType; 787static MethodInfo GetBuildIncrementCollectionCountGenericDelegate(Type type) => BuildIncrementCollectionCountDelegateMethod.MakeGenericMethod(type); 793private static MethodInfo GetBuildIncrementCollectionCountGenericDelegate(Type type) => BuildIncrementCollectionCountDelegateMethod.MakeGenericMethod(type); 820Type[]? keyValueTypes = ItemType.GetGenericArguments(); 836static MethodInfo GetBuildCreateGenericDictionaryEnumeratorGenericMethod(Type[] keyValueTypes) => GetBuildCreateGenericDictionaryEnumeratorMethodInfo.MakeGenericMethod(keyValueTypes[0], keyValueTypes[1]); 841internal Type GetCollectionElementType() 846Type? enumeratorType; 849Type[] keyValueTypes = ItemType.GetGenericArguments(); 861MethodInfo? getCurrentMethod = enumeratorType.GetMethod(Globals.GetCurrentMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes); 870Type ienumeratorInterface = Globals.TypeOfIEnumerator; 873Type[] interfaceTypes = enumeratorType.GetInterfaces(); 874foreach (Type interfaceType in interfaceTypes) 890Type elementType = getCurrentMethod.ReturnType; 910private DataContract? GetSharedTypeContract(Type type) 925internal static bool IsCollectionInterface(Type type) 929return ((IList<Type>)KnownInterfaces).Contains(type); 934internal static bool IsCollection(Type type) 941internal static bool IsCollection(Type type, [NotNullWhen(true)] out Type? itemType) 948internal static bool IsCollection(Type type, bool constructorRequired, bool skipIfReadOnlyContract) 955private static bool IsCollectionHelper(Type type, [NotNullWhen(true)] out Type? itemType, bool constructorRequired, bool skipIfReadOnlyContract = false) 967internal static bool TryCreate(Type type, [NotNullWhen(true)] out DataContract? dataContract) 974internal static bool TryCreateGetOnlyCollectionDataContract(Type type, [NotNullWhen(true)] out DataContract? dataContract) 992Type type, 994Type interfaceType) 996Type? t = type.GetInterfaces().Where(it => it.Equals(interfaceType)).FirstOrDefault(); 1000private static bool IsArraySegment(Type t) 1007private static bool IsCollectionOrTryCreate(Type type, bool tryCreate, out DataContract? dataContract, out Type itemType, bool constructorRequired, bool skipIfReadOnlyContract = false) 1023Type? baseType = type.BaseType; 1051Type interfaceTypeToCheck = type.IsGenericType ? type.GetGenericTypeDefinition() : type; 1052Type[] knownInterfaces = KnownInterfaces; 1060Type[] genericArgs = type.GetGenericArguments(); 1106defaultCtor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, Type.EmptyTypes); 1127Type? knownInterfaceType = null; 1130Type[] interfaceTypes = type.GetInterfaces(); 1131foreach (Type interfaceType in interfaceTypes) 1133Type interfaceTypeToCheck = interfaceType.IsGenericType ? interfaceType.GetGenericTypeDefinition() : interfaceType; 1134Type[] knownInterfaces = KnownInterfaces; 1165GetCollectionMethods(type, knownInterfaceType, new Type[] { itemType }, 1204Type[]? addMethodTypeArray = null; 1214addMethodTypeArray = new Type[] { Globals.TypeOfObject, Globals.TypeOfObject }; 1224addMethodTypeArray = new Type[] { itemType }; 1246internal static bool IsCollectionDataContract(Type type) 1253private static bool HandleIfInvalidCollection(Type type, bool tryCreate, bool hasCollectionDataContract, bool createContractWithException, string message, string? param, ref DataContract? dataContract) 1272private static void GetReadOnlyCollectionExceptionMessages(Type type, bool hasCollectionDataContract, string message, string? param, out string serializationExceptionMessage, out string deserializationExceptionMessage) 1288Type type, 1290Type interfaceType, 1293Type? t = type.GetInterfaces().Where(it => it.Equals(interfaceType)).FirstOrDefault(); 1304Type type, 1306Type interfaceType, 1307Type[] addMethodTypeArray, bool addMethodOnInterface, out MethodInfo? getEnumeratorMethod, out MethodInfo? addMethod) 1319Type[] parentInterfaceTypes = interfaceType.GetInterfaces(); 1324foreach (Type parentInterfaceType in parentInterfaceTypes) 1346getEnumeratorMethod = type.GetMethod(Globals.GetEnumeratorMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes); 1349Type? ienumerableInterface = 1359Type type, 1361Type ienumerableInterface) 1364private static bool IsKnownInterface(Type type) 1366Type typeToCheck = type.IsGenericType ? type.GetGenericTypeDefinition() : type; 1367foreach (Type knownInterfaceType in KnownInterfaces) 1388Type type = UnderlyingType; 1389Type[] paramTypes = type.GetGenericArguments(); 1395Type boundType = type.MakeGenericType(paramTypes);
System\Runtime\Serialization\ContextAware.cs (3)
17private ConditionalWeakTable<Type, DataContract> _keepAlive; 24_keepAlive = new ConditionalWeakTable<Type, DataContract>(); 51where TKey : Type
System\Runtime\Serialization\DataContract.cs (106)
55internal static DataContract GetDataContract(Type type) 79internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 86internal static DataContract GetGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 99internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 121internal static DataContract? GetBuiltInDataContract(Type type) 151internal static void ThrowInvalidDataContractException(string? message, Type? type) 159public virtual Type UnderlyingType => _helper.UnderlyingType; 161public virtual Type OriginalUnderlyingType => _helper.OriginalUnderlyingType; 165internal Type TypeForInitialization => _helper.TypeForInitialization; 304private static readonly ContextAwareDictionary<Type, DataContract?> s_typeToBuiltInContract = new(); 318private readonly Type _underlyingType; 319private Type? _originalUnderlyingType; 332private Type _typeForInitialization; 336internal static DataContract GetDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 352internal static DataContract GetGetOnlyCollectionDataContractSkipValidation(int id, RuntimeTypeHandle typeHandle, Type? type) 428private static DataContract CreateDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 438type ??= Type.GetTypeFromHandle(typeHandle)!; 450private static DataContract CreateDataContract(Type type) 453Type originalType = type; 508private static DataContract CreateGetOnlyCollectionDataContract(int id, RuntimeTypeHandle typeHandle, Type? type) 516type ??= Type.GetTypeFromHandle(typeHandle)!; 533internal static Type GetDataContractAdapterType(Type type) 551internal static Type GetDataContractOriginalType(Type type) 578internal static DataContract? GetBuiltInDataContract(Type type) 583return s_typeToBuiltInContract.GetOrAdd(type, static (Type key) => 623Type? type = typeName.AsSpan(7) switch 665internal static bool TryCreateBuiltInDataContract(Type type, [NotNullWhen(true)] out DataContract? dataContract) 673switch (Type.GetTypeCode(type)) 929internal static void ThrowInvalidDataContractException(string? message, Type? type) 942Type type) 950internal Type UnderlyingType => _underlyingType; 952internal Type OriginalUnderlyingType => _originalUnderlyingType ??= GetDataContractOriginalType(_underlyingType); 956internal Type TypeForInitialization => _typeForInitialization; 959private void SetTypeForInitialization(Type classType) 1050MethodInfo? method = UnderlyingType.GetMethod(Globals.ParseMethodName, BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(string) }); 1087internal static bool IsTypeSerializable(Type type) 1094private static bool IsTypeSerializable(Type type, HashSet<Type>? previousCollectionTypes) 1110if (CollectionDataContract.IsCollection(type, out Type? itemType)) 1112previousCollectionTypes ??= new HashSet<Type>(); 1123private static void ValidatePreviousCollectionTypes(Type collectionType, Type itemType, HashSet<Type> previousCollectionTypes) 1134List<Type> itemTypeClosure = new List<Type>(); 1135Queue<Type> itemTypeQueue = new Queue<Type>(); 1149foreach (Type argType in itemType.GetGenericArguments()) 1161internal static Type UnwrapRedundantNullableType(Type type) 1163Type nullableType = type; 1172internal static Type UnwrapNullableType(Type type) 1220public static XmlQualifiedName GetXmlName(Type type) 1227internal static XmlQualifiedName GetXmlName(Type type, out bool hasDataContract) 1229return GetXmlName(type, new HashSet<Type>(), out hasDataContract); 1234internal static XmlQualifiedName GetXmlName(Type type, HashSet<Type> previousCollectionTypes, out bool hasDataContract) 1260private static XmlQualifiedName GetDCTypeXmlName(Type type, DataContractAttribute dataContractAttribute) 1290private static XmlQualifiedName GetNonDCTypeXmlName(Type type, HashSet<Type> previousCollectionTypes) 1294if (CollectionDataContract.IsCollection(type, out Type? itemType)) 1315private static bool TryGetBuiltInXmlAndArrayTypeXmlName(Type type, HashSet<Type> previousCollectionTypes, [NotNullWhen(true)] out XmlQualifiedName? xmlName) 1331Type itemType = type.GetElementType()!; 1338internal static bool TryGetDCAttribute(Type type, [NotNullWhen(true)] out DataContractAttribute? dataContractAttribute) 1357internal static XmlQualifiedName GetCollectionXmlName(Type type, Type itemType, out CollectionDataContractAttribute? collectionContractAttribute) 1359return GetCollectionXmlName(type, itemType, new HashSet<Type>(), out collectionContractAttribute); 1364internal static XmlQualifiedName GetCollectionXmlName(Type type, Type itemType, HashSet<Type> previousCollectionTypes, out CollectionDataContractAttribute? collectionContractAttribute) 1410private static string GetArrayPrefix(ref Type itemType) 1451internal static XmlQualifiedName GetDefaultXmlName(Type type) 1458private static string GetDefaultXmlLocalName(Type type) 1487Type[] genParams = type.GetGenericArguments(); 1490Type genParam = genParams[i]; 1515private static string GetDefaultDataContractNamespace(Type type) 1571internal static string GetDefaultXmlNamespace(Type type) 1644private static void CheckExplicitDataContractNamespaceUri(string dataContractNs, Type type) 1673internal static string GetClrTypeFullName(Type type) 1871private static string ExpandGenericParameters(string format, Type type) 1923internal static bool IsTypeNullable(Type type) 1932internal static DataContractDictionary? ImportKnownTypeAttributes(Type type) 1935Dictionary<Type, Type> typesChecked = new Dictionary<Type, Type>(); 1942private static void ImportKnownTypeAttributes(Type? type, Dictionary<Type, Type> typesChecked, ref DataContractDictionary? knownDataContracts) 1984MethodInfo? method = type.GetMethod(methodName, BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public, Type.EmptyTypes); 1997foreach (Type ty in (IEnumerable<Type>)types) 2048internal static void CheckAndAdd(Type type, Dictionary<Type, Type> typesChecked, [NotNullIfNotNull(nameof(nameToDataContractTable))] ref DataContractDictionary? nameToDataContractTable) 2113internal static bool IsTypeVisible(Type t) 2128foreach (Type genericType in t.GetGenericArguments()) 2137internal static bool IsTypeAndDeclaringTypeVisible(Type t) 2193private static bool IsTypeVisibleInSerializationModule(Type type) 2275internal GenericNameProvider(Type type) 2348Type? paramType = o as Type;
System\Runtime\Serialization\DataContractResolver.cs (4)
15public abstract bool TryResolveType(Type type, Type? declaredType, DataContractResolver knownTypeResolver, out XmlDictionaryString? typeName, out XmlDictionaryString? typeNamespace); 18public abstract Type? ResolveName(string typeName, string? typeNamespace, Type? declaredType, DataContractResolver knownTypeResolver);
System\Runtime\Serialization\DataContractSerializer.cs (37)
18private Type _rootType; 26private ReadOnlyCollection<Type>? _knownTypeCollection; 27internal IList<Type>? _knownTypeList; 66public DataContractSerializer(Type type) 67: this(type, (IEnumerable<Type>?)null) 71public DataContractSerializer(Type type, IEnumerable<Type>? knownTypes) 76public DataContractSerializer(Type type, string rootName, string rootNamespace) 81public DataContractSerializer(Type type, string rootName, string rootNamespace, IEnumerable<Type>? knownTypes) 86internal DataContractSerializer(Type type, string rootName, string rootNamespace, IEnumerable<Type>? knownTypes, 93public DataContractSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace) 98public DataContractSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace, IEnumerable<Type>? knownTypes) 103internal DataContractSerializer(Type type, IEnumerable<Type>? knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences) 108public DataContractSerializer(Type type, DataContractSerializerSettings? settings) 116private void Initialize(Type type, 117IEnumerable<Type>? knownTypes, 130_knownTypeList = new List<Type>(); 131foreach (Type knownType in knownTypes) 147private void Initialize(Type type, XmlDictionaryString? rootName, XmlDictionaryString? rootNamespace, 148IEnumerable<Type>? knownTypes, 162public ReadOnlyCollection<Type> KnownTypes 168new ReadOnlyCollection<Type>(_knownTypeList) : 169ReadOnlyCollection<Type>.Empty; 373Type declaredType = contract.UnderlyingType; 374Type graphType = (graph == null) ? declaredType : graph.GetType(); 424internal static DataContract GetDataContract(DataContract declaredTypeContract, Type declaredType, Type objectType) 513internal override Type? GetSerializeType(object? graph) 518internal override Type? GetDeserializeType() 526internal static object? SurrogateToDataContractType(ISerializationSurrogateProvider serializationSurrogateProvider, object? oldObj, Type surrogatedDeclaredType, ref Type objType) 538internal static Type GetSurrogatedType(ISerializationSurrogateProvider serializationSurrogateProvider, Type type)
System\Runtime\Serialization\DataContractSerializerSettings.cs (1)
30public IEnumerable<Type>? KnownTypes { get; set; }
System\Runtime\Serialization\DataContractSet.cs (39)
23private readonly List<Type>? _referencedTypes; 24private readonly List<Type>? _referencedCollectionTypes; 26public DataContractSet(ISerializationSurrogateProvider? dataContractSurrogate, IEnumerable<Type>? referencedTypes, IEnumerable<Type>? referencedCollectionTypes) 30_referencedTypes = referencedTypes != null ? new List<Type>(referencedTypes) : null; 31_referencedCollectionTypes = referencedCollectionTypes != null ? new List<Type>(referencedCollectionTypes) : null; 72internal static void EnsureTypeNotGeneric(Type type) 80internal void Add(Type type) 216internal XmlQualifiedName GetXmlName(Type clrType) 220Type dcType = DataContractSurrogateCaller.GetDataContractType(_surrogateProvider, clrType); 228public DataContract GetDataContract(Type type) 237Type dcType = DataContractSurrogateCaller.GetDataContractType(_surrogateProvider, type); 265if (dataMember.MemberInfo is not Type) 267Type dataMemberType = dataMember.MemberType; 272Type dcType = DataContractSurrogateCaller.GetDataContractType(_surrogateProvider, dataMemberType); 324foreach (Type type in _referencedTypes) 345foreach (Type type in _referencedCollectionTypes) 361private void AddReferencedType(Dictionary<XmlQualifiedName, object> referencedTypes, Type type) 383if (value is Type referencedType) 388List<Type> types = new List<Type>(); 396List<Type> types = (List<Type>)value; 408private static bool IsTypeReferenceable(Type type) 434public Type? GetReferencedType(XmlQualifiedName xmlName, DataContract dataContract, out DataContract? referencedContract, out object[]? genericParameters, bool? supportGenericTypes = null) 436Type? type = GetReferencedTypeInternal(xmlName, dataContract); 463private Type? GetReferencedGenericTypeInternal(GenericInfo genInfo, out DataContract? referencedContract, out object[]? genericParameters) 468Type? type = GetReferencedTypeInternal(genInfo.XmlName, null); 501Type? paramType = GetReferencedGenericTypeInternal(paramInfo, out paramContract, out object[]? paramParameters); 504genericParameters[i] = new Tuple<Type, object[]?>(paramType, paramParameters); 525private Type? GetReferencedTypeInternal(XmlQualifiedName xmlName, DataContract? dataContract) 527Type? type; 560internal bool TryGetReferencedType(XmlQualifiedName xmlName, DataContract? dataContract, [NotNullWhen(true)] out Type? type) 567internal bool TryGetReferencedCollectionType(XmlQualifiedName xmlName, DataContract? dataContract, [NotNullWhen(true)] out Type? type) 574private bool TryGetReferencedType(XmlQualifiedName xmlName, DataContract? dataContract, bool useReferencedCollectionTypes, [NotNullWhen(true)] out Type? type) 579type = value as Type; 587List<Type> types = (List<Type>)value; 592Type conflictingType = types[i];
System\Runtime\Serialization\DataContractSurrogateCaller.cs (11)
16internal static Type GetDataContractType(ISerializationSurrogateProvider surrogateProvider, Type type) 26internal static object? GetObjectToSerialize(ISerializationSurrogateProvider surrogateProvider, object? obj, Type objType, Type membertype) 38internal static object? GetDeserializedObject(ISerializationSurrogateProvider surrogateProvider, object? obj, Type objType, Type memberType) 47internal static object? GetCustomDataToExport(ISerializationSurrogateProvider2 surrogateProvider, MemberInfo memberInfo, Type dataContractType) 54internal static object? GetCustomDataToExport(ISerializationSurrogateProvider2 surrogateProvider, Type clrType, Type dataContractType) 61internal static void GetKnownCustomDataTypes(ISerializationSurrogateProvider2 surrogateProvider, Collection<Type> customDataTypes) 68internal static Type? GetReferencedTypeOnImport(ISerializationSurrogateProvider2 surrogateProvider, string typeName, string typeNamespace, object? customData)
System\Runtime\Serialization\DataMember.cs (4)
63internal Type MemberType => _helper.MemberType; 107private Type? _memberType; 167internal Type MemberType 178_memberType = (Type)MemberInfo!;
System\Runtime\Serialization\EnumDataContract.cs (15)
25internal EnumDataContract(Type type) : base(new EnumDataContractCriticalHelper(type)) 30internal static Type? GetBaseType(XmlQualifiedName baseContractName) 78private static readonly Dictionary<Type, XmlQualifiedName> s_typeToName = new Dictionary<Type, XmlQualifiedName>(); 79private static readonly Dictionary<XmlQualifiedName, Type> s_nameToType = new Dictionary<XmlQualifiedName, Type>(); 101internal static void Add(Type type, string localName) 108internal static XmlQualifiedName GetBaseContractName(Type type) 116internal static Type? GetBaseType(XmlQualifiedName baseContractName) 118s_nameToType.TryGetValue(baseContractName, out Type? retVal); 126Type type) : base(type) 129Type baseType = Enum.GetUnderlyingType(type); 168Type? baseType = GetBaseType(value); 209private void ImportBaseType(Type baseType) 217Type type = UnderlyingType;
System\Runtime\Serialization\ExportOptions.cs (3)
18private Collection<Type>? _knownTypes; 28public Collection<Type> KnownTypes => _knownTypes ??= new Collection<Type>();
System\Runtime\Serialization\ExtensionDataObject.cs (3)
56Type DataType { get; } 73protected Type dataType; 94public Type DataType
System\Runtime\Serialization\ExtensionDataReader.cs (4)
461Type? dataNodeType = dataNode?.DataType; 631Type type = dataNode.DataType; 657private bool MoveToText(Type type, IDataNode dataNode, bool isTypedNode) 662switch (Type.GetTypeCode(type))
System\Runtime\Serialization\GenericParameterDataContract.cs (2)
16internal GenericParameterDataContract(Type type) 34Type type)
System\Runtime\Serialization\Globals.cs (145)
34private static Type? s_typeOfObject; 35internal static Type TypeOfObject => 38private static Type? s_typeOfValueType; 39internal static Type TypeOfValueType => 42private static Type? s_typeOfArray; 43internal static Type TypeOfArray => 46private static Type? s_typeOfString; 47internal static Type TypeOfString => 50private static Type? s_typeOfInt; 51internal static Type TypeOfInt => 54private static Type? s_typeOfULong; 55internal static Type TypeOfULong => 58private static Type? s_typeOfVoid; 59internal static Type TypeOfVoid => 62private static Type? s_typeOfByteArray; 63internal static Type TypeOfByteArray => 66private static Type? s_typeOfTimeSpan; 67internal static Type TypeOfTimeSpan => 70private static Type? s_typeOfGuid; 71internal static Type TypeOfGuid => 74private static Type? s_typeOfDateTimeOffset; 75internal static Type TypeOfDateTimeOffset => 78private static Type? s_typeOfDateTimeOffsetAdapter; 79internal static Type TypeOfDateTimeOffsetAdapter => 82private static Type? s_typeOfMemoryStream; 83internal static Type TypeOfMemoryStream => 86private static Type? s_typeOfMemoryStreamAdapter; 87internal static Type TypeOfMemoryStreamAdapter => 90private static Type? s_typeOfUri; 91internal static Type TypeOfUri => 94private static Type? s_typeOfTypeEnumerable; 95internal static Type TypeOfTypeEnumerable => 96s_typeOfTypeEnumerable ??= typeof(IEnumerable<Type>); 98private static Type? s_typeOfStreamingContext; 99internal static Type TypeOfStreamingContext => 102private static Type? s_typeOfISerializable; 103internal static Type TypeOfISerializable => 106private static Type? s_typeOfIDeserializationCallback; 107internal static Type TypeOfIDeserializationCallback => 111private static Type? s_typeOfIObjectReference; 112internal static Type TypeOfIObjectReference => 116private static Type? s_typeOfXmlFormatClassWriterDelegate; 117internal static Type TypeOfXmlFormatClassWriterDelegate => 120private static Type? s_typeOfXmlFormatCollectionWriterDelegate; 121internal static Type TypeOfXmlFormatCollectionWriterDelegate => 124private static Type? s_typeOfXmlFormatClassReaderDelegate; 125internal static Type TypeOfXmlFormatClassReaderDelegate => 128private static Type? s_typeOfXmlFormatCollectionReaderDelegate; 129internal static Type TypeOfXmlFormatCollectionReaderDelegate => 132private static Type? s_typeOfXmlFormatGetOnlyCollectionReaderDelegate; 133internal static Type TypeOfXmlFormatGetOnlyCollectionReaderDelegate => 136private static Type? s_typeOfKnownTypeAttribute; 137internal static Type TypeOfKnownTypeAttribute => 140private static Type? s_typeOfDataContractAttribute; 141internal static Type TypeOfDataContractAttribute => 144private static Type? s_typeOfDataMemberAttribute; 145internal static Type TypeOfDataMemberAttribute => 148private static Type? s_typeOfEnumMemberAttribute; 149internal static Type TypeOfEnumMemberAttribute => 152private static Type? s_typeOfCollectionDataContractAttribute; 153internal static Type TypeOfCollectionDataContractAttribute => 156private static Type? s_typeOfOptionalFieldAttribute; 157internal static Type TypeOfOptionalFieldAttribute => 160private static Type? s_typeOfObjectArray; 161internal static Type TypeOfObjectArray => 164private static Type? s_typeOfOnSerializingAttribute; 165internal static Type TypeOfOnSerializingAttribute => 168private static Type? s_typeOfOnSerializedAttribute; 169internal static Type TypeOfOnSerializedAttribute => 172private static Type? s_typeOfOnDeserializingAttribute; 173internal static Type TypeOfOnDeserializingAttribute => 176private static Type? s_typeOfOnDeserializedAttribute; 177internal static Type TypeOfOnDeserializedAttribute => 180private static Type? s_typeOfFlagsAttribute; 181internal static Type TypeOfFlagsAttribute => 184private static Type? s_typeOfIXmlSerializable; 185internal static Type TypeOfIXmlSerializable => 188private static Type? s_typeOfXmlSchemaProviderAttribute; 189internal static Type TypeOfXmlSchemaProviderAttribute => 192private static Type? s_typeOfXmlRootAttribute; 193internal static Type TypeOfXmlRootAttribute => 196private static Type? s_typeOfXmlQualifiedName; 197internal static Type TypeOfXmlQualifiedName => 200private static Type? s_typeOfXmlSchemaType; 201internal static Type TypeOfXmlSchemaType => 204private static Type? s_typeOfIExtensibleDataObject; 205internal static Type TypeOfIExtensibleDataObject => 208private static Type? s_typeOfExtensionDataObject; 209internal static Type TypeOfExtensionDataObject => 212private static Type? s_typeOfISerializableDataNode; 213internal static Type TypeOfISerializableDataNode => 216private static Type? s_typeOfClassDataNode; 217internal static Type TypeOfClassDataNode => 220private static Type? s_typeOfCollectionDataNode; 221internal static Type TypeOfCollectionDataNode => 224private static Type? s_typeOfXmlDataNode; 225internal static Type TypeOfXmlDataNode => 228private static Type? s_typeOfNullable; 229internal static Type TypeOfNullable => 232private static Type? s_typeOfReflectionPointer; 233internal static Type TypeOfReflectionPointer => 236private static Type? s_typeOfIDictionaryGeneric; 237internal static Type TypeOfIDictionaryGeneric => 240private static Type? s_typeOfIDictionary; 241internal static Type TypeOfIDictionary => 244private static Type? s_typeOfIListGeneric; 245internal static Type TypeOfIListGeneric => 248private static Type? s_typeOfIList; 249internal static Type TypeOfIList => 252private static Type? s_typeOfICollectionGeneric; 253internal static Type TypeOfICollectionGeneric => 256private static Type? s_typeOfICollection; 257internal static Type TypeOfICollection => 260private static Type? s_typeOfIEnumerableGeneric; 261internal static Type TypeOfIEnumerableGeneric => 264private static Type? s_typeOfIEnumerable; 265internal static Type TypeOfIEnumerable => 268private static Type? s_typeOfIEnumeratorGeneric; 269internal static Type TypeOfIEnumeratorGeneric => 272private static Type? s_typeOfIEnumerator; 273internal static Type TypeOfIEnumerator => 276private static Type? s_typeOfKeyValuePair; 277internal static Type TypeOfKeyValuePair => 280private static Type? s_typeOfKeyValue; 281internal static Type TypeOfKeyValue => 284private static Type? s_typeOfIDictionaryEnumerator; 285internal static Type TypeOfIDictionaryEnumerator => 288private static Type? s_typeOfDictionaryEnumerator; 289internal static Type TypeOfDictionaryEnumerator => 292private static Type? s_typeOfGenericDictionaryEnumerator; 293internal static Type TypeOfGenericDictionaryEnumerator => 296private static Type? s_typeOfDictionaryGeneric; 297internal static Type TypeOfDictionaryGeneric => 300private static Type? s_typeOfHashtable; 301internal static Type TypeOfHashtable 308private static Type? s_typeOfXmlElement; 309internal static Type TypeOfXmlElement => 312private static Type? s_typeOfXmlNodeArray; 313internal static Type TypeOfXmlNodeArray => 316private static Type? s_typeOfDBNull; 317internal static Type TypeOfDBNull => 321private static Type? s_typeOfSchemaDefinedType; 323internal static Type TypeOfSchemaDefinedType => 327private static Type? s_typeOfSchemaDefinedEnum; 329internal static Type TypeOfSchemaDefinedEnum =>
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (34)
24internal IList<Type>? knownTypeList; 27private ReadOnlyCollection<Type>? _knownTypeCollection; 36private Type _rootType; 41public DataContractJsonSerializer(Type type) 42: this(type, (IEnumerable<Type>?)null) 48public DataContractJsonSerializer(Type type, string? rootName) 55public DataContractJsonSerializer(Type type, XmlDictionaryString? rootName) 62public DataContractJsonSerializer(Type type, IEnumerable<Type>? knownTypes) 69public DataContractJsonSerializer(Type type, string? rootName, IEnumerable<Type>? knownTypes) 76public DataContractJsonSerializer(Type type, XmlDictionaryString? rootName, IEnumerable<Type>? knownTypes) 83public DataContractJsonSerializer(Type type, DataContractJsonSerializerSettings? settings) 94internal DataContractJsonSerializer(Type type, 96IEnumerable<Type>? knownTypes, 116public ReadOnlyCollection<Type> KnownTypes 122new ReadOnlyCollection<Type>(knownTypeList) : 123ReadOnlyCollection<Type>.Empty; 418internal override Type? GetDeserializeType() 423internal override Type? GetSerializeType(object? graph) 497Type declaredType = contract.UnderlyingType; 498Type graphType = (graph == null) ? declaredType : graph.GetType(); 558private void AddCollectionItemTypeToKnownTypes(Type knownType) 560Type? itemType; 561Type typeToCheck = knownType; 576private void Initialize(Type type, 577IEnumerable<Type>? knownTypes, 591this.knownTypeList = new List<Type>(); 592foreach (Type knownType in knownTypes) 614private void Initialize(Type type, 616IEnumerable<Type>? knownTypes, 642internal static DataContract GetDataContract(DataContract declaredTypeContract, Type declaredType, Type objectType)
System\Runtime\Serialization\Json\DataContractJsonSerializerSettings.cs (1)
25public IEnumerable<Type>? KnownTypes { get; set; }
System\Runtime\Serialization\Json\JsonDataContract.cs (1)
223Type traditionalDataContractType = traditionalDataContract.GetType();
System\Runtime\Serialization\Json\JsonFormatGeneratorStatics.cs (17)
57private static Type[]? s_serInfoCtorArgs; 118typeof(ExtensionDataObject).GetConstructor(Globals.ScanAllMembers, Type.EmptyTypes))!; 193s_getUninitializedObjectMethod = typeof(XmlFormatReaderGenerator).GetMethod("UnsafeGetUninitializedObject", Globals.ScanAllMembers, new Type[] { typeof(Type) }); 206s_isStartElementMethod0 = typeof(XmlReaderDelegator).GetMethod("IsStartElement", Globals.ScanAllMembers, Type.EmptyTypes); 218s_isStartElementMethod2 = typeof(XmlReaderDelegator).GetMethod("IsStartElement", Globals.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) }); 316s_serializationExceptionCtor = typeof(SerializationException).GetConstructor(new Type[] { typeof(string) }); 322public static Type[] SerInfoCtorArgs => s_serInfoCtorArgs ??= new Type[] { typeof(SerializationInfo), typeof(StreamingContext) }; 353s_typeHandleProperty = typeof(Type).GetProperty("TypeHandle"); 401s_writeAttributeStringMethod = typeof(XmlWriterDelegator).GetMethod("WriteAttributeString", Globals.ScanAllMembers, new Type[] { typeof(string), typeof(string), typeof(string), typeof(string) }); 413s_writeEndElementMethod = typeof(XmlWriterDelegator).GetMethod("WriteEndElement", Globals.ScanAllMembers, Type.EmptyTypes); 463s_writeStartElementMethod = typeof(XmlWriterDelegator).GetMethod("WriteStartElement", Globals.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) }); 476s_writeStartElementStringMethod = typeof(XmlWriterDelegator).GetMethod("WriteStartElement", Globals.ScanAllMembers, new Type[] { typeof(string), typeof(string) }); 489s_parseEnumMethod = typeof(Enum).GetMethod("Parse", BindingFlags.Static | BindingFlags.Public, new Type[] { typeof(Type), typeof(string) }); 502s_getJsonMemberNameMethod = typeof(XmlObjectSerializerReadContextComplexJson).GetMethod("GetJsonMemberName", Globals.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator) });
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (27)
55private Type? _objectType; 178private static void BeginMethod(CodeGenerator ilg, string methodName, Type delegateType, bool allowPrivateMemberAccess) 182Type[] paramTypes = new Type[parameters.Length]; 202Type type = classContract.ObjectType; 367Type memberType = dataMember.MemberType; 467private LocalBuilder ReadValue(Type type, string name) 558private void InternalDeserialize(LocalBuilder value, Type type, string name) 562Type declaredType = type; 585Type innerType = innerValue.LocalType, outerType = outerValue.LocalType; 590Type type = Globals.TypeOfNullable.MakeGenericType(innerType); 591_ilg.New(type.GetConstructor(new Type[] { innerType })!); 594_ilg.Call(outerType.GetConstructor(new Type[] { innerType })!); 601Type type = collectionContract.UnderlyingType; 602Type itemType = collectionContract.ItemType; 611constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, Type.EmptyTypes)!; 615constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, Type.EmptyTypes)!; 726private void ReadSimpleDictionary(CollectionDataContract collectionContract, Type keyValueType) 728Type[] keyValueTypes = keyValueType.GetGenericArguments(); 729Type keyType = keyValueTypes[0]; 730Type valueType = keyValueTypes[1]; 733Type keyTypeOriginal = keyType; 822Type type = collectionContract.UnderlyingType; 823Type itemType = collectionContract.ItemType; 910private bool TryReadPrimitiveArray(Type itemType) 917switch (Type.GetTypeCode(itemType)) 962private LocalBuilder ReadCollectionItem(CollectionDataContract collectionContract, Type itemType)
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (29)
113private static void BeginMethod(CodeGenerator ilg, string methodName, Type delegateType, bool allowPrivateMemberAccess) 117Type[] paramTypes = new Type[parameters.Length]; 126private void InitArgs(Type objType) 243Type memberType = member.MemberType; 316Type itemType = collectionContract.ItemType; 363Type? enumeratorType; 364Type[]? keyValueTypes = null; 374keyValueTypes = new Type[] { Globals.TypeOfObject, Globals.TypeOfObject }; 381MethodInfo? moveNextMethod = enumeratorType.GetMethod(Globals.MoveNextMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes); 382MethodInfo? getCurrentMethod = enumeratorType.GetMethod(Globals.GetCurrentMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes); 392Type ienumeratorInterface = Globals.TypeOfIEnumerator; 396Type[] interfaceTypes = enumeratorType.GetInterfaces(); 397foreach (Type interfaceType in interfaceTypes) 413Type elementType = getCurrentMethod.ReturnType; 420ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(Globals.ScanAllMembers, new Type[] { Globals.TypeOfIDictionaryEnumerator })!; 427Type ctorParam = Globals.TypeOfIEnumeratorGeneric.MakeGenericType(Globals.TypeOfKeyValuePair.MakeGenericType(keyValueTypes)); 428ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(Globals.ScanAllMembers, new Type[] { ctorParam })!; 438Type genericDictionaryKeyValueType = Globals.TypeOfKeyValue.MakeGenericType(keyValueTypes); 508private bool TryWritePrimitive(Type type, LocalBuilder? value, MemberInfo? memberInfo, LocalBuilder? arrayItemIndex, LocalBuilder? name, int nameIndex) 556private bool TryWritePrimitiveArray(Type type, Type itemType, LocalBuilder value, LocalBuilder itemName) 563switch (Type.GetTypeCode(itemType)) 596new Type[] { type, typeof(XmlDictionaryString), typeof(XmlDictionaryString) })!; 625Type memberType = memberValue.LocalType; 698private void InternalSerialize(MethodInfo methodInfo, LocalBuilder memberValue, Type memberType, bool writeXsiType) 710_ilg.Call(typeof(RuntimeTypeHandle).GetMethod("Equals", new Type[] { typeof(RuntimeTypeHandle) })!); 721Type memberType = memberValue.LocalType; 727Type innerType = memberType.GetGenericArguments()[0];
System\Runtime\Serialization\Json\JsonXmlDataContract.cs (5)
52DataContractSerializer dataContractSerializer = new DataContractSerializer(Type.GetTypeFromHandle(declaredTypeHandle)!, 62private static List<Type> GetKnownTypesFromContext(XmlObjectSerializerContext? context, IList<Type>? serializerKnownTypeList) 64List<Type> knownTypesList = new List<Type>();
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (5)
147private void ReadSimpleDictionary(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract, Type keyValueType, object? dictionary) 149Type[] keyValueTypes = keyValueType.GetGenericArguments(); 150Type keyType = keyValueTypes[0]; 151Type valueType = keyValueTypes[1]; 209TypeCode typeCode = Type.GetTypeCode(keyDataContract.UnderlyingType);
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (7)
43Type itemType = collectionContract.ItemType; 72Type[] itemTypeGenericArguments = collectionContract.ItemType.GetGenericArguments(); 73Type? dictionaryValueType = itemTypeGenericArguments.Length == 2 ? itemTypeGenericArguments[1] : null; 101Type elementType = collectionContract.GetCollectionElementType(); 144private static bool ReflectionTryWritePrimitiveArray(JsonWriterDelegator jsonWriter, object obj, Type itemType, XmlDictionaryString collectionItemName) 152switch (Type.GetTypeCode(itemType)) 215Type memberType = member.MemberType;
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (3)
74internal IList<Type>? SerializerKnownTypeList 264internal override DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type? type) 273internal override DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type? type)
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (13)
39internal IList<Type>? SerializerKnownTypeList 173protected override void SerializeWithXsiType(XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle objectTypeHandle, Type? objectType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 206private void HandleCollectionAssignedToObject(Type declaredType, ref DataContract dataContract, ref object obj, ref bool verifyKnownType) 242internal override void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 245Type declaredType = rootTypeDataContract!.UnderlyingType; 264private void VerifyType(DataContract dataContract, Type declaredType) 294Type dataType = dataNode.DataType; 320internal static void VerifyObjectCompatibilityWithInterface(DataContract contract, object graph, Type declaredType) 322Type contractType = contract.GetType(); 339Type objType = obj.GetType(); 369internal override DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type? type) 378internal override DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type? type)
System\Runtime\Serialization\KnownTypeDataContractResolver.cs (4)
23public override bool TryResolveType(Type type, Type? declaredType, DataContractResolver knownTypeResolver, out XmlDictionaryString? typeName, out XmlDictionaryString? typeNamespace) 55public override Type? ResolveName(string typeName, string? typeNamespace, Type? declaredType, DataContractResolver knownTypeResolver)
System\Runtime\Serialization\PrimitiveDataContract.cs (9)
25Type type, XmlDictionaryString name, XmlDictionaryString ns) : base(new PrimitiveDataContractCriticalHelper(type, name, ns)) 32internal static PrimitiveDataContract? GetPrimitiveDataContract(Type type) 70_helper.XmlFormatWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) })!; 72_helper.XmlFormatWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) })!; 86_helper.XmlFormatContentWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { UnderlyingType })!; 88_helper.XmlFormatContentWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName, Globals.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), UnderlyingType })!; 128Type thisType = GetType(); 129Type otherType = other.GetType(); 143Type type,
System\Runtime\Serialization\ReflectionClassWriter.cs (5)
46public static void ReflectionWriteValue(XmlWriterDelegator xmlWriter, XmlObjectSerializerWriteContext context, Type type, object? value, bool writeXsiType, PrimitiveDataContract? primitiveContractForParamType) 48Type memberType = type; 75MethodInfo getValue = memberType.GetMethod("get_Value", Type.EmptyTypes)!; 154Type type = obj.GetType(); 168private static void ReflectionInternalSerialize(XmlWriterDelegator xmlWriter, XmlObjectSerializerWriteContext context, object obj, bool isDeclaredType, bool writeXsiType, Type memberType, bool isNullableOfT = false)
System\Runtime\Serialization\ReflectionReader.cs (25)
20private delegate object? CollectionReadItemDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract, Type itemType, string itemName, string itemNs); 27private static readonly Type[] s_arrayConstructorParameters = new Type[] { Globals.TypeOfInt }; 140object? GetReadDictionaryItemDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract, Type itemType, string itemName, string itemNs) 152Type itemType = collectionContract.ItemType; 249protected object? ReflectionReadValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, Type type, string name, string ns, PrimitiveDataContract? primitiveContractForOriginalType = null) 277private object? ReadItemOfPrimitiveType(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, Type type, string name, string ns, PrimitiveDataContract? primitiveContract, int nullables) 345private CollectionReadItemDelegate GetReflectionReadValueDelegate(Type type) 365object? GetReadItemOfPrimitiveTypeDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract, Type itemType, string itemName, string itemNs) 385Type type = dataMember.MemberType; 393private object? ReflectionInternalDeserialize(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract? collectionContract, Type type, string name, string ns) 432Type classType = classContract.UnderlyingType; 441Type objType = obj.GetType(); 482Type arrayType = collectionContract.ItemType.MakeArrayType(); 489Type type = Globals.TypeOfDictionaryGeneric.MakeGenericType(collectionContract.ItemType.GetGenericArguments()); 490ConstructorInfo ci = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes)!; 553Type keyType = collectionContract.ItemType.GenericTypeArguments[0]; 554Type valueType = collectionContract.ItemType.GenericTypeArguments[1]; 584Type collectionType = resultCollectionObject.GetType(); 585Type genericCollectionType = typeof(ICollection<T>); 586Type typeIList = Globals.TypeOfIList; 621static MethodInfo MakeGenericMethod(MethodInfo method, Type keyType, Type valueType) => method.MakeGenericMethod(keyType, valueType); 626private static bool ReflectionTryReadPrimitiveArray(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString collectionItemName, XmlDictionaryString collectionItemNamespace, Type itemType, int arraySize, [NotNullWhen(true)] out object? resultArray) 634switch (Type.GetTypeCode(itemType))
System\Runtime\Serialization\ReflectionXmlFormatWriter.cs (7)
41Type itemType = collectionDataContract.ItemType; 72Type elementType = collectionDataContract.GetCollectionElementType(); 96private static bool ReflectionTryWritePrimitiveArray(XmlWriterDelegator xmlWriter, object obj, Type itemType, XmlDictionaryString collectionItemName, XmlDictionaryString itemNamespace) 102switch (Type.GetTypeCode(itemType)) 150Type memberType = member.MemberType; 206public static void ReflectionWriteStartElement(XmlWriterDelegator xmlWriter, Type type, XmlDictionaryString ns, string namespaceLocal, string nameLocal) 225private static bool NeedsPrefix(Type type, XmlDictionaryString? ns)
System\Runtime\Serialization\SchemaExporter.cs (11)
250private XmlElement ExportGenericInfo(Type clrType, string elementName, string elementNs) 252Type? itemType; 265Type[]? genericArguments = null; 347Collection<Type> knownTypes = new Collection<Type>(); 511Type clrType = dataContract.UnderlyingType; 593internal static void GetXmlTypeInfo(Type type, out XmlQualifiedName xmlName, out XmlSchemaType? xsdType, out bool hasRoot) 606private static bool InvokeSchemaProviderMethod(Type clrType, XmlSchemaSet schemas, out XmlQualifiedName xmlName, out XmlSchemaType? xsdType, out bool hasRoot) 632MethodInfo? getMethod = clrType.GetMethod(methodName, /*BindingFlags.DeclaredOnly |*/ BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public, new Type[] { typeof(XmlSchemaSet) }); 695Type clrType, 747internal static bool IsSpecialXmlType(Type type, [NotNullWhen(true)] out XmlQualifiedName? typeName, [NotNullWhen(true)] out XmlSchemaType? xsdType, out bool hasRoot)
System\Runtime\Serialization\SchemaImporter.cs (6)
187Dictionary<Type, object> previousCollectionTypes = new Dictionary<Type, object>(); 502Type? referencedType; 739Type? referencedType; 1336Collection<Type> knownTypes = new Collection<Type>();
System\Runtime\Serialization\SpecialTypeDataContract.cs (2)
15Type type, 27Type type,
System\Runtime\Serialization\XmlDataContract.cs (8)
30internal XmlDataContract(Type type) : base(new XmlDataContractCriticalHelper(type)) 138Type type) : base(type) 252ConstructorInfo? ctor = UnderlyingType.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Type.EmptyTypes); 273Type type = this.UnderlyingType; 305Type? xName = type.Assembly.GetType("System.Xml.Linq.XName"); 311new Type[] { typeof(string) } 315new Type[] { xName } 362internal IXmlSerializable ReflectionCreateXmlSerializable(Type type)
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (24)
22s_writeStartElementMethod2 = typeof(XmlWriterDelegator).GetMethod("WriteStartElement", Globals.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) }); 36s_writeStartElementMethod3 = typeof(XmlWriterDelegator).GetMethod("WriteStartElement", Globals.ScanAllMembers, new Type[] { typeof(string), typeof(XmlDictionaryString), typeof(XmlDictionaryString) }); 50s_writeEndElementMethod = typeof(XmlWriterDelegator).GetMethod("WriteEndElement", Globals.ScanAllMembers, Type.EmptyTypes); 64s_writeNamespaceDeclMethod = typeof(XmlWriterDelegator).GetMethod("WriteNamespaceDecl", Globals.ScanAllMembers, new Type[] { typeof(XmlDictionaryString) }); 84s_dictionaryEnumeratorCtor = typeof(CollectionDataContract.DictionaryEnumerator).GetConstructor(Globals.ScanAllMembers, new Type[] { Globals.TypeOfIDictionaryEnumerator }); 141s_isStartElementMethod2 = typeof(XmlReaderDelegator).GetMethod("IsStartElement", Globals.ScanAllMembers, new Type[] { typeof(XmlDictionaryString), typeof(XmlDictionaryString) }); 155s_isStartElementMethod0 = typeof(XmlReaderDelegator).GetMethod("IsStartElement", Globals.ScanAllMembers, Type.EmptyTypes); 170s_getUninitializedObjectMethod = typeof(XmlFormatReaderGenerator).GetMethod("UnsafeGetUninitializedObject", Globals.ScanAllMembers, new Type[] { typeof(int) })!; 209internal static ConstructorInfo SerializationExceptionCtor => s_serializationExceptionCtor ??= typeof(SerializationException).GetConstructor(new Type[] { typeof(string) })!; 212internal static ConstructorInfo ExtensionDataObjectCtor => s_extensionDataObjectCtor ??= typeof(ExtensionDataObject).GetConstructor(Globals.ScanAllMembers, Type.EmptyTypes)!; 223s_hashtableCtor = Globals.TypeOfHashtable.GetConstructor(Globals.ScanAllMembers, Type.EmptyTypes); 265s_storeCollectionMemberInfoMethod = typeof(XmlObjectSerializerReadContext).GetMethod("StoreCollectionMemberInfo", Globals.ScanAllMembers, new Type[] { typeof(object) }); 279s_resetCollectionMemberInfoMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ResetCollectionMemberInfo", Globals.ScanAllMembers, Type.EmptyTypes); 364s_internalDeserializeMethod = typeof(XmlObjectSerializerReadContext).GetMethod("InternalDeserialize", Globals.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator), typeof(int), typeof(RuntimeTypeHandle), typeof(string), typeof(string) }); 451s_readIfNullOrRefMethod = typeof(XmlObjectSerializerReadContext).GetMethod("ReadIfNullOrRef", Globals.ScanAllMembers, new Type[] { typeof(XmlReaderDelegator), typeof(Type), typeof(bool) }); 663s_createUnexpectedStateExceptionMethod = typeof(XmlObjectSerializerReadContext).GetMethod("CreateUnexpectedStateException", Globals.ScanAllMembers, new Type[] { typeof(XmlNodeType), typeof(XmlReaderDelegator) }); 708s_writeNullMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("WriteNull", Globals.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), typeof(Type), typeof(bool) }); 736s_incrementCollectionCountMethod = typeof(XmlObjectSerializerWriteContext).GetMethod("IncrementCollectionCount", Globals.ScanAllMembers, new Type[] { typeof(XmlWriterDelegator), typeof(ICollection) }); 774internal static object? GetDefaultValue(Type type) 1025s_getTypeHandleMethod = typeof(Type).GetMethod("get_TypeHandle"); 1053s_throwInvalidDataContractExceptionMethod = typeof(DataContract).GetMethod("ThrowInvalidDataContractException", Globals.ScanAllMembers, new Type[] { typeof(string), typeof(Type) });
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (20)
64private Type? _objectType; 256Type type = _objectType = classContract.UnderlyingType; 426Type memberType = dataMember.MemberType; 504private LocalBuilder ReadValue(Type type, string name, string ns) 595private void InternalDeserialize(LocalBuilder value, Type type, string name, string ns) 599Type declaredType = type.IsPointer ? Globals.TypeOfReflectionPointer : type; 618Type innerType = innerValue.LocalType, outerType = outerValue.LocalType; 623Type type = Globals.TypeOfNullable.MakeGenericType(innerType); 624_ilg.New(type.GetConstructor(new Type[] { innerType })!); 627_ilg.Call(outerType.GetConstructor(new Type[] { innerType })!); 635Type type = collectionContract.UnderlyingType; 636Type itemType = collectionContract.ItemType; 647constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes)!; 777Type type = collectionContract.UnderlyingType; 778Type itemType = collectionContract.ItemType; 839private bool TryReadPrimitiveArray(Type itemType, LocalBuilder size) 848switch (Type.GetTypeCode(itemType)) 890private LocalBuilder ReadCollectionItem(CollectionDataContract collectionContract, Type itemType, string itemName, string itemNs) 997Type type) 1010var type = DataContract.GetDataContractForInitialization(id).TypeForInitialization;
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (27)
154private void InitArgs(Type objType) 313Type memberType = member.MemberType; 396Type itemType = collectionContract.ItemType; 442Type? enumeratorType; 443Type[]? keyValueTypes = null; 453keyValueTypes = new Type[] { Globals.TypeOfObject, Globals.TypeOfObject }; 460MethodInfo? moveNextMethod = enumeratorType.GetMethod(Globals.MoveNextMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes); 461MethodInfo? getCurrentMethod = enumeratorType.GetMethod(Globals.GetCurrentMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes); 471Type ienumeratorInterface = Globals.TypeOfIEnumerator; 475Type[] interfaceTypes = enumeratorType.GetInterfaces(); 476foreach (Type interfaceType in interfaceTypes) 492Type elementType = getCurrentMethod.ReturnType; 504Type ctorParam = Globals.TypeOfIEnumeratorGeneric.MakeGenericType(Globals.TypeOfKeyValuePair.MakeGenericType(keyValueTypes!)); 505ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(Globals.ScanAllMembers, new Type[] { ctorParam })!; 541private bool TryWritePrimitive(Type type, LocalBuilder? value, MemberInfo? memberInfo, LocalBuilder? arrayItemIndex, LocalBuilder ns, LocalBuilder? name, int nameIndex) 589private bool TryWritePrimitiveArray(Type type, Type itemType, LocalBuilder value, LocalBuilder itemName, LocalBuilder itemNamespace) 596switch (Type.GetTypeCode(itemType)) 628_ilg.Call(typeof(XmlWriterDelegator).GetMethod(writeArrayMethod, Globals.ScanAllMembers, new Type[] { type, typeof(XmlDictionaryString), typeof(XmlDictionaryString) })!); 638Type memberType = memberValue.LocalType; 711private void InternalSerialize(MethodInfo methodInfo, LocalBuilder memberValue, Type memberType, bool writeXsiType) 718_ilg.Call(null, typeof(Type).GetMethod("GetTypeHandle")!, memberValue); 722_ilg.Call(typeof(RuntimeTypeHandle).GetMethod("Equals", new Type[] { typeof(RuntimeTypeHandle) })!); 734Type memberType = memberValue.LocalType; 740Type innerType = memberType.GetGenericArguments()[0]; 760private static bool NeedsPrefix(Type type, XmlDictionaryString ns) 765private void WriteStartElement(Type type, XmlDictionaryString ns, LocalBuilder namespaceLocal, LocalBuilder? nameLocal, int nameIndex)
System\Runtime\Serialization\XmlObjectSerializer.cs (3)
456internal static string GetTypeInfoError(string errorMessage, Type? type, Exception innerException) 463internal virtual Type? GetSerializeType(object? graph) 468internal virtual Type? GetDeserializeType()
System\Runtime\Serialization\XmlObjectSerializerContext.cs (18)
24protected IList<Type>? serializerKnownTypeList; 100internal DataContract GetDataContract(Type type) 107internal virtual DataContract GetDataContract(RuntimeTypeHandle typeHandle, Type? type) 121internal virtual DataContract GetDataContractSkipValidation(int typeId, RuntimeTypeHandle typeHandle, Type? type) 149internal virtual void CheckIfTypeSerializable(Type memberType, bool isMemberTypeSerializable) 157internal virtual Type GetSurrogatedType(Type type) 190internal static DataContractDictionary? GetDataContractsForKnownTypes(IList<Type> knownTypeList) 194Dictionary<Type, Type> typesChecked = new Dictionary<Type, Type>(); 197Type knownType = knownTypeList[i]; 208internal bool IsKnownType(DataContract dataContract, DataContractDictionary? knownDataContracts, Type? declaredType) 228internal bool IsKnownType(DataContract dataContract, Type? declaredType) 236internal Type? ResolveNameFromKnownTypes(XmlQualifiedName typeName) 251protected DataContract? ResolveDataContractFromKnownTypes(string typeName, string? typeNs, DataContract? memberTypeContract, Type? declaredType) 261Type? dataContractType = _dataContractResolver.ResolveName(typeName, typeNs, declaredType, KnownTypeResolver);
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (13)
58internal static void ThrowNullValueReturnedForGetOnlyCollectionException(Type type) 64internal static void ThrowArrayExceededSizeException(int arraySize, Type type) 92return InternalDeserialize(xmlReader, name, ns, Type.GetTypeFromHandle(declaredTypeHandle)!, ref dataContract); 97internal virtual object? InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, string? name, string? ns) 105internal virtual object? InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract? dataContract, string? name, string? ns) 113protected bool TryHandleNullOrRef(XmlReaderDelegator reader, string? name, string? ns, Type declaredType, ref object? retObj) 140protected object? InternalDeserialize(XmlReaderDelegator reader, string? name, string? ns, Type declaredType, ref DataContract dataContract) 294internal string ReadIfNullOrRef(XmlReaderDelegator xmlReader, Type memberType, bool isMemberTypeSerializable) 380internal object? GetExistingObject(string id, Type? type, string? name, string? ns) 424private object? DeserializeFromExtensionData(IDataNode dataNode, Type type, string? name, string? ns) 543public SerializationInfo ReadSerializationInfo(XmlReaderDelegator xmlReader, Type type) 749Type valueType = xmlReader.ValueType; 777private IDataNode ReadUnknownPrimitiveData(XmlReaderDelegator xmlReader, Type type, string? dataContractName, string? dataContractNamespace)
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (8)
36return InternalDeserializeWithSurrogate(xmlReader, Type.GetTypeFromHandle(declaredTypeHandle)!, null /*surrogateDataContract*/, name, ns); 41internal override object? InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, string? name, string? ns) 51internal override object? InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract? dataContract, string? name, string? ns) 61private object? InternalDeserializeWithSurrogate(XmlReaderDelegator xmlReader, Type declaredType, DataContract? surrogateDataContract, string? name, string? ns) 82internal override void CheckIfTypeSerializable(Type memberType, bool isMemberTypeSerializable) 99internal override Type GetSurrogatedType(Type type) 108Type surrogateType = DataContractSerializer.GetSurrogatedType(_serializationSurrogateProvider, type);
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (22)
99Type declaredType = Globals.TypeOfObject; 119SerializeWithXsiType(xmlWriter, obj, objTypeHandle, null /*type*/, declaredTypeID, declaredTypeHandle, Type.GetTypeFromHandle(declaredTypeHandle)!); 144internal virtual void SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) 149Type declaredType = rootTypeDataContract.OriginalUnderlyingType; 167protected virtual void SerializeWithXsiType(XmlWriterDelegator xmlWriter, object obj, RuntimeTypeHandle objectTypeHandle, Type? objectType, int declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 179objectType ??= Type.GetTypeFromHandle(objectTypeHandle)!; 232protected void SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, object obj, bool verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType) 271internal virtual bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, Type dataContractType, string? clrTypeName, string? clrAssemblyName) 276internal virtual bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, Type dataContractType, SerializationInfo serInfo) 401internal void WriteNull(XmlWriterDelegator xmlWriter, Type memberType, bool isMemberTypeSerializable) 409internal void WriteNull(XmlWriterDelegator xmlWriter, Type memberType, bool isMemberTypeSerializable, XmlDictionaryString name, XmlDictionaryString? ns) 441internal static bool IsMemberTypeSameAsMemberValue(object obj, Type memberType) 460internal static void ThrowRequiredMemberMustBeEmitted(string memberName, Type type) 517Type objType = obj.GetType(); 535internal void WriteSerializationInfo(XmlWriterDelegator xmlWriter, Type objType, SerializationInfo serInfo) 589private void WriteResolvedTypeInfo(XmlWriterDelegator writer, Type objectType, Type declaredType) 600private bool ResolveType(Type objectType, Type declaredType, [NotNullWhen(true)] out XmlDictionaryString? typeName, [NotNullWhen(true)] out XmlDictionaryString? typeNamespace) 712Type dataType = dataNode.DataType; 748Type declaredType = (dataNode.DataContractName == null) ? o.GetType() : Globals.TypeOfObject;
System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (9)
41internal override bool WriteClrTypeInfo(XmlWriterDelegator xmlWriter, Type dataContractType, string? clrTypeName, string? clrAssemblyName) 180internal override void CheckIfTypeSerializable(Type memberType, bool isMemberTypeSerializable) 197internal override Type GetSurrogatedType(Type type) 206Type surrogateType = DataContractSerializer.GetSurrogatedType(_serializationSurrogateProvider, type); 226Type objType = Type.GetTypeFromHandle(objTypeHandle)!; 227Type declaredType = GetSurrogatedType(Type.GetTypeFromHandle(declaredTypeHandle)!);
System\Runtime\Serialization\XmlReaderDelegator.cs (7)
209private static InvalidDataContractException CreateInvalidPrimitiveTypeException(Type type) 216public object ReadElementContentAsAnyType(Type valueType) 224internal object ReadContentAsAnyType(Type valueType) 226switch (Type.GetTypeCode(valueType)) 280internal IDataNode ReadExtensionData(Type valueType) 282switch (Type.GetTypeCode(valueType)) 1096internal Type ValueType { get { return reader.ValueType; } }
System\Runtime\Serialization\XmlSerializableReader.cs (2)
86public override Type ValueType { get { return InnerReader.ValueType; } } 123public override object ReadContentAs(Type returnType, IXmlNamespaceResolver? namespaceResolver) { return InnerReader.ReadContentAs(returnType, namespaceResolver); }
System\Runtime\Serialization\XmlWriterDelegator.cs (5)
272private static InvalidDataContractException CreateInvalidPrimitiveTypeException(Type type) 282internal void WriteAnyType(object value, Type valueType) 285switch (Type.GetTypeCode(valueType)) 361Type valueType = dataNode.DataType; 362switch (Type.GetTypeCode(valueType))
System\Runtime\Serialization\XPathQueryGenerator.cs (2)
24public static string CreateFromDataContractSerializer(Type type, MemberInfo[] pathToMember, out XmlNamespaceManager namespaces) 32public static string CreateFromDataContractSerializer(Type type, MemberInfo[] pathToMember, StringBuilder? rootElementXpath, out XmlNamespaceManager namespaces)
System\Runtime\Serialization\XsdDataContractExporter.cs (25)
92private static void EnsureTypeNotGeneric(Type type) 116Type[] types = assembly.GetTypes(); 133/// <param name="types">A <see cref="ICollection{T}"/> (of <see cref="Type"/>) that contains the types to export.</param> 136public void Export(ICollection<Type> types) 143foreach (Type type in types) 162/// <param name="type">The <see cref="Type"/> to transform into an XML schema.</param> 165public void Export(Type type) 183/// Returns the contract name and contract namespace for the <see cref="Type"/>. 185/// <param name="type">The <see cref="Type"/> that was exported.</param> 189public XmlQualifiedName GetSchemaTypeName(Type type) 208public XmlSchemaType? GetSchemaType(Type type) 221/// Returns the top-level name and namespace for the <see cref="Type"/>. 223/// <param name="type">The <see cref="Type"/> to query.</param> 227public XmlQualifiedName? GetRootElementName(Type type) 246private Type GetSurrogatedType(Type type) 256private void CheckAndAddType(Type type) 265private void AddType(Type type) 285Collection<Type> knownTypes = Options.KnownTypes; 291Type type = knownTypes[i]; 319Type[] types = assembly.GetTypes(); 345public bool CanExport(ICollection<Type> types) 352foreach (Type type in types) 376/// <param name="type">The <see cref="Type"/> to export.</param> 380public bool CanExport(Type type)
System\Xml\ValueHandle.cs (1)
155public Type ToType()
System\Xml\XmlBaseReader.cs (3)
1676public override object ReadContentAs(Type type, IXmlNamespaceResolver? namespaceResolver) 1745public override Type ValueType 1751Type type = _node.Value.ToType();
System\Xml\XmlBinaryReader.cs (1)
1158public override bool IsStartArray([NotNullWhen(true)] out Type? type)
System\Xml\XmlBinaryWriter.cs (1)
1171Type type = reader.ValueType;
System\Xml\XmlDictionaryReader.cs (4)
588public override object ReadContentAs(Type type, IXmlNamespaceResolver? namespaceResolver) 1017public virtual bool IsStartArray([NotNullWhen(true)] out Type? type) 1647public override Type ValueType 1792public override object ReadContentAs(Type type, IXmlNamespaceResolver? namespaceResolver)
System\Xml\XmlDictionaryWriter.cs (4)
290private void WriteArrayNode(XmlDictionaryReader reader, string prefix, string localName, string namespaceUri, Type type) 319private void WriteArrayNode(XmlDictionaryReader reader, string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Type type) 348private void WriteArrayNode(XmlDictionaryReader reader, Type type) 391Type? type;
System.Private.Uri (1)
System\UriSyntax.cs (1)
232Type type = this.GetType();
System.Private.Windows.Core (62)
System\DisposalTracking.cs (1)
61private static string GetFriendlyTypeName(Type type)
System\Private\Windows\Core\BinaryFormat\BinaryFormatWriter.cs (3)
294Type type = primitive.GetType(); 403Type type = list.GetType(); 679Type type = value.GetType();
System\Private\Windows\Core\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (8)
11private readonly Type _elementType; 26Type expectedArrayType = arrayRecord.Rank switch 35Type elementType = _arrayOfClassRecords.GetType(); 123Type arrayRecordElementType = typeResolver.GetType(arrayRecord.TypeName.GetElementType()); 124Type elementType = arrayRecordElementType; 131|| (Nullable.GetUnderlyingType(elementType) is Type nullable && HasBuiltInSupport(nullable)))) 136Type expectedArrayType = arrayRecord.Rank switch 144static bool HasBuiltInSupport(Type elementType)
System\Private\Windows\Core\BinaryFormat\Deserializer\ClassRecordDeserializer.cs (2)
33Type type = deserializer.TypeResolver.GetType(classRecord.TypeName); 86Type type = value.GetType();
System\Private\Windows\Core\BinaryFormat\Deserializer\ClassRecordFieldInfoDeserializer.cs (1)
28Type type,
System\Private\Windows\Core\BinaryFormat\Deserializer\ClassRecordSerializationInfoDeserializer.cs (1)
30Type type,
System\Private\Windows\Core\BinaryFormat\Deserializer\DefaultTypeResolver.cs (8)
17private readonly Dictionary<string, Type> _types = []; 30Type ITypeResolver.GetType(TypeName typeName) 34if (_types.TryGetValue(typeName.AssemblyQualifiedName, out Type? cachedType)) 39if (_binder?.GetType(typeName) is Type binderType) 71Type? type = _simpleAssemblyMatching 82private static Type? GetSimplyNamedTypeFromAssembly(Assembly assembly, TypeName typeName) 97return Type.GetType(typeName.FullName, ResolveSimpleAssemblyName, new TopLevelAssemblyTypeResolver(assembly).ResolveType, throwOnError: false); 124public Type? ResolveType(Assembly? assembly, string simpleTypeName, bool ignoreCase)
System\Private\Windows\Core\BinaryFormat\Deserializer\Deserializer.cs (4)
48/// <see cref="SerializationInfo.SetType(Type)"/> will get that type info serialized into the stream. 65private readonly Dictionary<Type, ISerializationSurrogate?>? _surrogates; 253ISerializationSurrogate? IDeserializer.GetSurrogate(Type type) 338Type type = _typeResolver.GetType(classRecord.TypeName);
System\Private\Windows\Core\BinaryFormat\Deserializer\IDeserializer.cs (1)
70ISerializationSurrogate? GetSurrogate(Type type);
System\Private\Windows\Core\BinaryFormat\Deserializer\PendingSerializationInfo.cs (2)
33Type type = @object.GetType(); 66[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type)
System\Private\Windows\Core\BinaryFormat\ITypeResolver.cs (1)
18Type GetType(TypeName typeName);
System\Private\Windows\Core\BinaryFormat\SerializationEvents.cs (8)
12private static readonly ConcurrentDictionary<Type, SerializationEvents> s_cache = new(); 32[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type t) => 35private static SerializationEvents CreateSerializationEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 46Type attribute, 48[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? type) 53Type? baseType = type; 76[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 81[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type,
System\Private\Windows\Core\BinaryFormat\SerializationInfoExtensions.cs (3)
10private static readonly Action<SerializationInfo, string, object, Type> s_updateValue = 14.CreateDelegate<Action<SerializationInfo, string, object, Type>>(); 20internal static void UpdateValue(this SerializationInfo si, string name, object value, Type type) =>
System\Private\Windows\Core\BinaryFormat\Serializer\MemberTypeInfo.cs (1)
31Type type => type.Name,
System\Private\Windows\Core\BinaryFormat\Support\FormatterConverterStub.cs (1)
25public object Convert(object value, Type type) => default!;
System\Private\Windows\Core\BinaryFormat\Support\TypeInfo.cs (4)
52internal static PrimitiveType GetPrimitiveType(Type type) => type.IsEnum ? default : Type.GetTypeCode(type) switch 79internal static PrimitiveType GetPrimitiveArrayType(Type type) => type.IsSZArray 86internal static BinaryType GetBinaryType(Type type)
System\Value.cs (6)
35/// The <see cref="System.Type"/> of the value stored in this <see cref="Value"/>. 37public readonly Type? Type 41Type? type; 80private static void ThrowInvalidCast(Type? from, Type to) => 905else if (Nullable.GetUnderlyingType(typeof(T)) is Type underlyingType
System\Value.TypeFlag.cs (3)
11/// A flag that represents the <see cref="System.Type"/> of a <see cref="Union"/> in a <see cref="Value"/>. 17public abstract Type Type 34public sealed override Type Type
Windows\Win32\System\Variant\VARIANT.cs (4)
234private static Type GetRecordElementType(IRecordInfo* record) 239Type? t = global::System.Type.GetTypeFromCLSID(guid); 624Type elementType;
System.Private.Windows.Core.TestUtilities (40)
BinaryFormatterInClipboardDragDropScope.cs (1)
35var type = assembly.GetType("System.Windows.Forms.Primitives.LocalAppContextSwitches")
BinarySerialization.cs (1)
19foreach (Type type in assemblyUnderTest.GetTypes())
CommonTestHelper.cs (1)
116public static TheoryData<Type?, bool> GetConvertFromTheoryData()
CustomConverter.cs (5)
13public static RegistrationScope RegisterConverter(Type type, TypeConverter converter) 27/// <see cref="TypeDescriptor.RemoveProvider(TypeDescriptionProvider, Type)"/> is called when going out of scope with the using. 31private readonly Type _type; 34public RegistrationScope(Type type, TypeDescriptionProvider provider) 51[DynamicallyAccessedMembers((DynamicallyAccessedMemberTypes)(-1))] Type objectType,
DebuggerAttributes.cs (19)
38internal static DebuggerAttributeInfo ValidateDebuggerTypeProxyProperties(Type type, object obj) 43internal static DebuggerAttributeInfo ValidateDebuggerTypeProxyProperties(Type type, Type[] genericTypeArguments, object obj) 45Type proxyType = GetProxyType(type, genericTypeArguments); 66public static IEnumerable<FieldInfo> GetDebuggerVisibleFields(Type debuggerAttributeType) 74public static IEnumerable<PropertyInfo> GetDebuggerVisibleProperties(Type debuggerAttributeType) 84public static Type GetProxyType(object obj) => GetProxyType(obj.GetType()); 86public static Type GetProxyType(Type type) => GetProxyType(type, type.GenericTypeArguments); 88private static Type GetProxyType(Type type, Type[] genericTypeArguments) 102Type proxyType = cad.ConstructorArguments[0].ArgumentType == typeof(Type) ? 103(Type)cad.ConstructorArguments[0].Value : 104Type.GetType((string)cad.ConstructorArguments[0].Value); 116Type objType = obj.GetType(); 204for (Type t = obj.GetType(); t is not null; t = t.GetTypeInfo().BaseType) 217for (Type t = obj.GetType(); t is not null; t = t.GetTypeInfo().BaseType)
NrbfSerializerInClipboardDragDropScope.cs (1)
35var type = assembly.GetType("System.Windows.Forms.Primitives.LocalAppContextSwitches")
ReflectionHelper.cs (4)
10public static IEnumerable<Type> GetPublicNotAbstractClasses<T>() 13foreach (var type in types) 28public static T? InvokePublicConstructor<T>(Type type) 46private static bool IsPublicNonAbstract<T>(Type type)
TestAccessor.cs (5)
49private static readonly Type s_type = typeof(T); 64Type type = typeof(TDelegate); 66Type[] types = invokeMethodInfo is null ? [] : invokeMethodInfo.GetParameters().Select(pi => pi.ParameterType).ToArray(); 99Type? type = s_type; 164Type? type = s_type;
TestAccessors.cs (1)
52ITestAccessor? testAccessor = instanceOrType is Type type
XUnit\CommonMemberDataAttribute.cs (2)
16public CommonMemberDataAttribute(Type memberType, string memberName = "TheoryData") 19public CommonMemberDataAttribute(Type memberType, string memberName, params object[]? parameters)
System.Private.Xml (1223)
System\Xml\BinaryXml\XmlBinaryReader.cs (16)
19private static volatile Type?[] s_tokenTypeMap = null!; 298private System.Type _valueType; 613public override System.Type ValueType 1757public override object ReadContentAs(Type returnType, IXmlNamespaceResolver? namespaceResolver) 3266private static Type?[] GenerateTokenTypeMap() 3268Type?[] map = new Type[256]; 3280Type TypeOfInt32 = typeof(int); 3283Type TypeOfDecimal = typeof(decimal); 3289Type TypeOfDateTime = typeof(System.DateTime); 3298Type TypeOfDateTimeOffset = typeof(System.DateTimeOffset); 3302Type TypeOfByteArray = typeof(byte[]); 3309Type TypeOfString = typeof(string); 3320private System.Type GetValueType(BinXmlToken token) 3322Type? t = s_tokenTypeMap[(int)token]; 4182private object ValueAs(BinXmlToken token, Type returnType, IXmlNamespaceResolver? namespaceResolver)
System\Xml\Core\XmlAsyncCheckReader.cs (6)
217public override System.Type ValueType 280public override object ReadContentAs(Type returnType, IXmlNamespaceResolver? namespaceResolver) 400public override object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver) 406public override object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver, string localName, string namespaceURI) 803public override Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver? namespaceResolver) 827public override Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
System\Xml\Core\XmlReader.cs (4)
139public virtual Type ValueType => typeof(string); 318public virtual object ReadContentAs(Type returnType, IXmlNamespaceResolver? namespaceResolver) 530public virtual object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver) 544public virtual object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver, string localName, string namespaceURI)
System\Xml\Core\XmlReaderAsync.cs (2)
46public virtual async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver? namespaceResolver) 98public virtual async Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
System\Xml\Core\XmlSubtreeReader.cs (1)
801public override object ReadContentAs(Type returnType, IXmlNamespaceResolver? namespaceResolver)
System\Xml\Core\XmlSubtreeReaderAsync.cs (1)
215public override async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver? namespaceResolver)
System\Xml\Core\XmlWrappingReader.cs (1)
47public override System.Type ValueType { get { return reader.ValueType; } }
System\Xml\Core\XsdValidatingReader.cs (4)
123private static volatile Type s_typeOfString = null!; 415public override System.Type ValueType 730public override object ReadContentAs(Type returnType, IXmlNamespaceResolver? namespaceResolver) 1063public override object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver)
System\Xml\Core\XsdValidatingReaderAsync.cs (2)
75public override async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver? namespaceResolver) 174public override async Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
System\Xml\Resolvers\XmlPreloadedResolver.cs (4)
37internal virtual bool SupportsType(Type? type) 114internal override bool SupportsType(Type? type) 225public override object? GetEntity(Uri absoluteUri, string? role, Type? ofObjectToReturn) 265public override bool SupportsType(Uri absoluteUri, Type? type)
System\Xml\Resolvers\XmlPreloadedResolverAsync.cs (1)
19Type? ofObjectToReturn)
System\Xml\Schema\DataTypeImplementation.cs (54)
431Type derivedType = this.GetType(); 432Type baseType = datatype.GetType(); 480public override Type ValueType { get { return typeof(string); } } 989public override Type ValueType { get { return ListValueType; } } 993internal override Type ListValueType { get { return _itemType.ListValueType; } } 1100Type arrayType; 1189public override Type ValueType { get { return typeof(object); } } 1195internal override Type ListValueType { get { return typeof(object[]); } } 1357public override Type ValueType { get { return typeof(string); } } 1361internal override Type ListValueType { get { return typeof(string[]); } } 1507public override Type ValueType { get { return typeof(bool); } } 1509internal override Type ListValueType { get { return typeof(bool[]); } } 1584public override Type ValueType { get { return typeof(float); } } 1586internal override Type ListValueType { get { return typeof(float[]); } } 1670public override Type ValueType { get { return typeof(double); } } 1672internal override Type ListValueType { get { return typeof(double[]); } } 1760public override Type ValueType { get { return typeof(decimal); } } 1762internal override Type ListValueType { get { return typeof(decimal[]); } } 1849public override Type ValueType { get { return typeof(TimeSpan); } } 1851internal override Type ListValueType { get { return typeof(TimeSpan[]); } } 1998public override Type ValueType { get { return typeof(DateTime); } } 2000internal override Type ListValueType { get { return typeof(DateTime[]); } } 2388public override Type ValueType { get { return typeof(byte[]); } } 2390internal override Type ListValueType { get { return typeof(byte[][]); } } 2486public override Type ValueType { get { return typeof(byte[]); } } 2488internal override Type ListValueType { get { return typeof(byte[][]); } } 2583public override Type ValueType { get { return typeof(Uri); } } 2592internal override Type ListValueType { get { return typeof(Uri[]); } } 2693public override Type ValueType { get { return typeof(XmlQualifiedName); } } 2695internal override Type ListValueType { get { return typeof(XmlQualifiedName[]); } } 3026public override Type ValueType { get { return typeof(XmlQualifiedName); } } 3028internal override Type ListValueType { get { return typeof(XmlQualifiedName[]); } } 3224public override Type ValueType { get { return typeof(long); } } 3226internal override Type ListValueType { get { return typeof(long[]); } } 3278public override Type ValueType { get { return typeof(int); } } 3280internal override Type ListValueType { get { return typeof(int[]); } } 3333public override Type ValueType { get { return typeof(short); } } 3335internal override Type ListValueType { get { return typeof(short[]); } } 3387public override Type ValueType { get { return typeof(sbyte); } } 3389internal override Type ListValueType { get { return typeof(sbyte[]); } } 3473public override Type ValueType { get { return typeof(ulong); } } 3475internal override Type ListValueType { get { return typeof(ulong[]); } } 3527public override Type ValueType { get { return typeof(uint); } } 3529internal override Type ListValueType { get { return typeof(uint[]); } } 3581public override Type ValueType { get { return typeof(ushort); } } 3583internal override Type ListValueType { get { return typeof(ushort[]); } } 3634public override Type ValueType { get { return typeof(byte); } } 3636internal override Type ListValueType { get { return typeof(byte[]); } } 3757public override Type ValueType { get { return typeof(XmlQualifiedName); } } 3759internal override Type ListValueType { get { return typeof(XmlQualifiedName[]); } } 3769public override Type ValueType { get { return typeof(char); } } 3771internal override Type ListValueType { get { return typeof(char[]); } } 3866public override Type ValueType { get { return typeof(Guid); } } 3868internal override Type ListValueType { get { return typeof(Guid[]); } }
System\Xml\Schema\Preprocessor.cs (1)
350Type returnType = obj.GetType();
System\Xml\Schema\XmlAtomicValue.cs (2)
211public override Type ValueType 354public override object ValueAs(Type type, IXmlNamespaceResolver? nsResolver)
System\Xml\Schema\XmlSchemaDataType.cs (5)
16public abstract Type ValueType { get; } 24internal abstract Type ListValueType { get; } 28public virtual object ChangeType(object value, Type targetType) 36public virtual object ChangeType(object value, Type targetType, IXmlNamespaceResolver namespaceResolver) 174Type t = value.GetType();
System\Xml\Schema\XmlValueConverter.cs (160)
213public abstract object ChangeType(bool value, Type destinationType); 214public abstract object ChangeType(int value, Type destinationType); 215public abstract object ChangeType(long value, Type destinationType); 216public abstract object ChangeType(decimal value, Type destinationType); 217public abstract object ChangeType(double value, Type destinationType); 218public abstract object ChangeType(DateTime value, Type destinationType); 219public abstract object ChangeType(string value, Type destinationType, IXmlNamespaceResolver? nsResolver); 220public abstract object ChangeType(object value, Type destinationType); 221public abstract object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver); 228private readonly Type? _clrTypeDefault; 229private readonly Type? _clrListTypeDefault; 287protected XmlBaseConverter(XmlBaseConverter converterAtomic, Type clrTypeDefault, Type clrListTypeDefault) 295protected static readonly Type ICollectionType = typeof(ICollection); 296protected static readonly Type IEnumerableType = typeof(IEnumerable); 297protected static readonly Type IListType = typeof(IList); 298protected static readonly Type ObjectArrayType = typeof(object[]); 299protected static readonly Type StringArrayType = typeof(string[]); 300protected static readonly Type StringArrayArrayType = typeof(string[][]); 301protected static readonly Type XmlAtomicValueArrayType = typeof(XmlAtomicValue[]); 302protected static readonly Type XPathItemArrayType = typeof(XPathItem[]); 303protected static readonly Type XPathNavigatorArrayType = typeof(XPathNavigator[]); 306protected static readonly Type DecimalType = typeof(decimal); 307protected static readonly Type Int32Type = typeof(int); 308protected static readonly Type Int64Type = typeof(long); 309protected static readonly Type StringType = typeof(string); 310protected static readonly Type XmlAtomicValueType = typeof(XmlAtomicValue); 311protected static readonly Type ObjectType = typeof(object); 312protected static readonly Type ByteType = typeof(byte); 313protected static readonly Type Int16Type = typeof(short); 314protected static readonly Type SByteType = typeof(sbyte); 315protected static readonly Type UInt16Type = typeof(ushort); 316protected static readonly Type UInt32Type = typeof(uint); 317protected static readonly Type UInt64Type = typeof(ulong); 318protected static readonly Type XPathItemType = typeof(XPathItem); 319protected static readonly Type DoubleType = typeof(double); 320protected static readonly Type SingleType = typeof(float); 321protected static readonly Type DateTimeType = typeof(DateTime); 322protected static readonly Type DateTimeOffsetType = typeof(DateTimeOffset); 323protected static readonly Type BooleanType = typeof(bool); 324protected static readonly Type ByteArrayType = typeof(byte[]); 325protected static readonly Type XmlQualifiedNameType = typeof(XmlQualifiedName); 326protected static readonly Type UriType = typeof(Uri); 327protected static readonly Type TimeSpanType = typeof(TimeSpan); 328protected static readonly Type XPathNavigatorType = typeof(XPathNavigator); 384public override object ChangeType(bool value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 385public override object ChangeType(DateTime value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 386public override object ChangeType(decimal value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 387public override object ChangeType(double value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 388public override object ChangeType(int value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 389public override object ChangeType(long value, Type destinationType) { return (object)ChangeType((object)value, destinationType, null); } 390public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver? nsResolver) { return (object)ChangeType((object)value, destinationType, nsResolver); } 391public override object ChangeType(object value, Type destinationType) { return this.ChangeType(value, destinationType, null); } 443protected Type? DefaultClrType 451protected Type? DefaultClrListType 459protected static bool IsDerivedFrom(Type? derivedType, Type baseType) 475protected Exception CreateInvalidClrMappingException(Type sourceType, Type destinationType) 512protected virtual object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 906Type sourceType = value.GetType(); 931Type sourceType = value.GetType(); 956Type sourceType = value.GetType(); 996Type sourceType = value.GetType(); 1012public override object ChangeType(decimal value, Type destinationType) 1027public override object ChangeType(int value, Type destinationType) 1042public override object ChangeType(long value, Type destinationType) 1057public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1073public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1078Type sourceType = value.GetType(); 1122private object ChangeTypeWildcardDestination(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1124Type sourceType = value.GetType(); 1135private object ChangeTypeWildcardSource(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1172Type sourceType = value.GetType(); 1216Type sourceType = value.GetType(); 1245Type sourceType = value.GetType(); 1260public override object ChangeType(double value, Type destinationType) 1274public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1289public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1294Type sourceType = value.GetType(); 1358Type sourceType = value.GetType(); 1398Type sourceType = value.GetType(); 1477Type sourceType = value.GetType(); 1492public override object ChangeType(DateTime value, Type destinationType) 1506public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1521public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1526Type sourceType = value.GetType(); 1574Type sourceType = value.GetType(); 1638Type sourceType = value.GetType(); 1652public override object ChangeType(bool value, Type destinationType) 1665public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1679public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1684Type sourceType = value.GetType(); 1723Type sourceType = value.GetType(); 1761public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1799public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1804Type sourceType = value.GetType(); 1918private object ChangeTypeWildcardDestination(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1920Type sourceType = value.GetType(); 1927private object ChangeTypeWildcardSource(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1952Type sourceType = value.GetType(); 1965public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1978public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 1983Type sourceType = value.GetType(); 2036Type sourceType = value.GetType(); 2058Type sourceType = value.GetType(); 2080Type sourceType = value.GetType(); 2101Type sourceType = value.GetType(); 2123Type sourceType = value.GetType(); 2145Type sourceType = value.GetType(); 2167Type sourceType = value.GetType(); 2189Type sourceType = value.GetType(); 2237Type sourceType = value.GetType(); 2268public override object ChangeType(bool value, Type destinationType) 2278public override object ChangeType(DateTime value, Type destinationType) 2288public override object ChangeType(decimal value, Type destinationType) 2298public override object ChangeType(double value, Type destinationType) 2308public override object ChangeType(int value, Type destinationType) 2318public override object ChangeType(long value, Type destinationType) 2328public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2359public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2364Type sourceType = value.GetType(); 2462private object ChangeTypeWildcardDestination(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2464Type sourceType = value.GetType(); 2470private object ChangeTypeWildcardSource(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2484protected override object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2486Type sourceType = value.GetType(); 2504private static bool SupportsType(Type clrType) 2548Type sourceType = value.GetType(); 2564Type sourceType = value.GetType(); 2579Type sourceType = value.GetType(); 2595Type sourceType = value.GetType(); 2611Type sourceType = value.GetType(); 2627Type sourceType = value.GetType(); 2643Type sourceType = value.GetType(); 2659Type sourceType = value.GetType(); 2678public override object ChangeType(bool value, Type destinationType) 2688public override object ChangeType(DateTime value, Type destinationType) 2698public override object ChangeType(decimal value, Type destinationType) 2708public override object ChangeType(double value, Type destinationType) 2718public override object ChangeType(int value, Type destinationType) 2728public override object ChangeType(long value, Type destinationType) 2738public override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2749public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2754Type sourceType = value.GetType(); 2832private object ChangeTypeWildcardDestination(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2834Type sourceType = value.GetType(); 2840private object ChangeTypeWildcardSource(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2874public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2899protected XmlListConverter(XmlBaseConverter atomicConverter, Type clrTypeDefault, Type clrListTypeDefault) : base(atomicConverter, clrTypeDefault, clrListTypeDefault) 2930public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2943protected override object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 2945Type sourceType = value.GetType(); 2972Type? itemTypeDst = destinationType.GetElementType(); 3022private static bool IsListType(Type type) 3125private new InvalidCastException CreateInvalidClrMappingException(Type sourceType, Type destinationType) 3172public override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver? nsResolver) 3177Type sourceType = value.GetType();
System\Xml\Serialization\CodeGenerator.cs (83)
40private Dictionary<(Type, string), Queue<LocalBuilder>>? _freeLocals; 50internal static bool IsNullableGenericType(Type type) 58internal static void AssertHasInterface(Type type, Type iType) 61foreach (Type iFace in type.GetInterfaces()) 69internal void BeginMethod(Type returnType, string methodName, Type[] argTypes, string[] argNames, MethodAttributes methodAttributes) 76internal void BeginMethod(Type returnType, MethodBuilderInfo methodBuilderInfo, Type[] argTypes, string[] argNames, MethodAttributes methodAttributes) 86private void InitILGeneration(Type[] argTypes, string[] argNames, bool isStatic) 93_freeLocals = new Dictionary<(Type, string), Queue<LocalBuilder>>(); 149private readonly Dictionary<Type, LocalBuilder> _tmpLocals = new Dictionary<Type, LocalBuilder>(); 150internal LocalBuilder GetTempLocal(Type type) 161internal static Type GetVariableType(object var) 217private bool TryDequeueLocal(Type type, string name, [NotNullWhen(true)] out LocalBuilder? local) 224(Type, string) key = (type, name); 241internal LocalBuilder DeclareLocal(Type type, string name) 253internal LocalBuilder DeclareOrGetLocal(Type type, string name) 291Type varType = GetVariableType(forState.End); 304Type.EmptyTypes 384internal void BeginCatchBlock(Type exception) 421internal void InitObj(Type valueType) 426internal void NewArray(Type elementType, object len) 433internal void StackallocSpan(Type elementType, int len) 439_ilGen!.Emit(OpCodes.Newobj, typeof(Span<>).MakeGenericType(elementType).GetConstructor(new Type[] { typeof(void*), typeof(int) })!); 444Type objType = GetVariableType(obj).GetElementType()!; 458Type arrayType = GetVariableType(obj); 462Call(typeof(Array).GetMethod("SetValue", new Type[] { typeof(object), typeof(int) })!); 466Type objType = arrayType.GetElementType()!; 480private static bool IsStruct(Type objType) 486internal Type LoadMember(object obj, MemberInfo memberInfo) 500Type? currentType = propertyInfo.DeclaringType!.BaseType; 535internal Type LoadMember(MemberInfo memberInfo) 537Type? memberType; 568internal Type LoadMemberAddress(MemberInfo memberInfo) 570Type? memberType; 655internal void ConvertAddress(Type source, Type target) 660internal void ConvertValue(Type source, Type target) 665internal void Castclass(Type target) 670internal void Box(Type type) 675internal void Unbox(Type type) 708internal void Ldobj(Type type) 710OpCode opCode = GetLdindOpCode(Type.GetTypeCode(type)); 731internal void Stobj(Type type) 763internal void Ldtoken(Type t) 770Type valueType = o.GetType(); 771if (o is Type) 773Ldtoken((Type)o); 774Call(typeof(Type).GetMethod("GetTypeFromHandle", BindingFlags.Static | BindingFlags.Public, new Type[] { typeof(RuntimeTypeHandle) })!); 782switch (Type.GetTypeCode(valueType)) 820new Type[] { typeof(int), typeof(int), typeof(int), typeof(bool), typeof(byte) } 833new Type[] { typeof(long) } 847new Type[] { typeof(long) }, 859new Type[] { typeof(long), typeof(TimeSpan) }, 935internal void Stloc(Type type, string name) 951internal void Ldloc(Type type, string name) 1030internal void Ldelem(Type arrayElementType) 1038OpCode opCode = GetLdelemOpCode(Type.GetTypeCode(arrayElementType)); 1045internal void Ldelema(Type arrayElementType) 1078internal void Stelem(Type arrayElementType) 1084OpCode opCode = GetStelemOpCode(Type.GetTypeCode(arrayElementType)); 1190private void InternalConvert(Type source, Type target, bool isAddress) 1198OpCode opCode = GetConvOpCode(Type.GetTypeCode(target)); 1268[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type parent, 1269Type[] interfaces) 1336internal void IsInst(Type type) 1430internal Type ArgType; 1431internal ArgBuilder(string name, int index, Type argType) 1580public void AddToFreeLocals(Dictionary<(Type, string), Queue<LocalBuilder>> freeLocals) 1584(Type, string) key = (item.Value.LocalType, item.Key); 1605public readonly Type[] ParameterTypes; 1606public MethodBuilderInfo(MethodBuilder methodBuilder, Type[] parameterTypes) 1613public void Validate(Type? returnType, Type[] parameterTypes, MethodAttributes attributes) 1627private readonly Type _sourceType; 1628private readonly Type _targetType; 1632public CodeGeneratorConversionException(Type sourceType, Type targetType, bool isAddress, string reason)
System\Xml\Serialization\CodeIdentifier.cs (5)
183private static int GetCSharpName(Type t, Type[] parameters, int index, StringBuilder sb) 218internal static string GetCSharpName(Type t) 240Type[] arguments = t.IsGenericType || t.ContainsGenericParameters ? t.GetGenericArguments() : Type.EmptyTypes;
System\Xml\Serialization\CodeIdentifiers.cs (1)
172public object ToArray(Type type)
System\Xml\Serialization\Compilation.cs (21)
51internal TempAssembly(XmlMapping[] xmlMappings, Type?[] types, string? defaultNamespace, string? location) 138internal static Assembly? LoadGeneratedAssembly(Type type, string? defaultNamespace, out XmlSerializerImplementation? contract) 214Type contractType = GetTypeFromAssembly(serializer, "XmlSerializerContract"); 227private static Assembly? LoadAssemblyByPath(Type type, string assemblyName) 265private static bool IsSerializerVersionMatch(Assembly serializer, Type type, string? defaultNamespace) 279private static string GenerateAssemblyId(Type type) 301internal static bool GenerateSerializerToStream(XmlMapping[] xmlMappings, Type?[] types, string? defaultNamespace, Assembly? assembly, Hashtable assemblies, Stream stream) 315foreach (Type t in scope.Types) 343Type? type = types[i]; 438internal static Assembly GenerateRefEmitAssembly(XmlMapping[] xmlMappings, Type?[] types) 440var mainType = (types.Length > 0) ? types[0] : null; 463new Type[] { typeof(string) } 495Type writerType = writerCodeGen.GenerateEnd(); 528[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type type, string methodName) 540internal static Type GetTypeFromAssembly(Assembly assembly, string typeName) 543Type? type = assembly.GetType(typeName); 589internal static void VerifyLoadContext(Type? t, Assembly? assembly) 668private readonly Type _type; 670internal TempAssemblyCacheKey(string? ns, Type type) 695internal TempAssembly? this[string? ns, Type t] 712internal void Add(string? ns, Type t, TempAssembly assembly)
System\Xml\Serialization\Compiler.cs (5)
24internal static void AddImport(Type? type, Hashtable types) 33Type? baseType = type.BaseType; 37Type? declaringType = type.DeclaringType; 41foreach (Type intf in type.GetInterfaces()) 56Type[] arguments = type.GetGenericArguments();
System\Xml\Serialization\ContextAwareTables.cs (4)
15private readonly ConditionalWeakTable<Type, T> _collectibleTable; 20_collectibleTable = new ConditionalWeakTable<Type, T>(); 23internal T GetOrCreateValue(Type t, Func<Type, T> f)
System\Xml\Serialization\ImportContext.cs (1)
261Type t = item.GetType();
System\Xml\Serialization\Mappings.cs (2)
1040private Type? _type; 1156internal Type? Type
System\Xml\Serialization\Models.cs (22)
21private readonly Dictionary<Type, TypeModel> _models = new Dictionary<Type, TypeModel>(); 22private readonly Dictionary<Type, TypeModel> _arrayModels = new Dictionary<Type, TypeModel>(); 35internal TypeModel GetTypeModel(Type type) 41internal TypeModel GetTypeModel(Type type, bool directReference) 77internal ArrayModel GetArrayModel(Type type) 98private readonly Type _type; 102[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 112internal Type Type 131[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } 143[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } 149[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 156[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 203private static void CheckSupportedMember(TypeDesc? typeDesc, MemberInfo member, Type type) 275private readonly Type _fieldType; 279internal FieldModel(string name, Type fieldType, TypeDesc fieldTypeDesc, bool checkSpecified, bool checkShouldPersist) : 283internal FieldModel(string name, Type fieldType, TypeDesc fieldTypeDesc, bool checkSpecified, bool checkShouldPersist, bool readOnly) 294internal FieldModel(MemberInfo memberInfo, Type fieldType, TypeDesc fieldTypeDesc) 300_checkShouldPersistMethodInfo = memberInfo.DeclaringType!.GetMethod($"ShouldSerialize{memberInfo.Name}", Type.EmptyTypes); 345internal Type FieldType 422Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { }
System\Xml\Serialization\NameTable.cs (1)
98internal Array ToArray(Type type)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (16)
541[DynamicallyAccessedMembers(TrimmerConstants.AllMethods)] Type collectionType) 571[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type targetCollectionType) 603Type type = o.GetType(); 632Type memberType; 766Type elementType; 1050private static Type GetMemberType(MemberInfo memberInfo) 1052Type memberType; 1129Type collectionType = memberMapping.TypeDesc!.Type!; 1217MethodInfo? method = typeof(XmlSerializationReader).GetMethod(methodName, BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, new Type[] { typeof(string) }); 1299[DynamicallyAccessedMembers(TrimmerConstants.AllMethods)] Type type) 1324| DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type) => 1326type.GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly, null, Type.EmptyTypes, null); 1475private static XmlSerializationCollectionFixupCallback GetCreateCollectionOfObjectsCallback(Type collectionType) 1960Type memberType = GetMemberType(memberInfo); 1978private static void AddItemInArrayMember(object o, MemberInfo memberInfo, Type memberType, object item) 2045public Type? Type { get; set; }
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (8)
662Type objType = o.GetType(); 908Type t = o.GetType(); 1334public static MemberInfo? GetMember(Type declaringType, string memberName, bool throwOnNotFound) 1340Type? currentType = declaringType.BaseType; 1381public static MemberInfo GetEffectiveGetInfo(Type declaringType, string memberName) 1390var parent = declaringType.BaseType; 1408public static MemberInfo GetEffectiveSetInfo(Type declaringType, string memberName) 1417var parent = declaringType.BaseType;
System\Xml\Serialization\SchemaImporter.cs (1)
79internal void MakeDerived(StructMapping structMapping, Type? baseType, bool baseTypeCanBeIndirect)
System\Xml\Serialization\SchemaObjectWriter.cs (2)
336System.Type t = o.GetType(); 1054System.Type t = o.GetType();
System\Xml\Serialization\SoapAttributeOverrides.cs (4)
17public void Add(Type type, SoapAttributes? attributes) 22public void Add(Type type, string member, SoapAttributes? attributes) 37public SoapAttributes? this[Type type] 45public SoapAttributes? this[Type type, string member]
System\Xml\Serialization\SoapIncludeAttribute.cs (3)
9private Type _type; 11public SoapIncludeAttribute(Type type) 16public Type Type
System\Xml\Serialization\SoapReflectionImporter.cs (12)
65public void IncludeType(Type type) 71private void IncludeType(Type type, RecursionLimiter limiter) 77public XmlTypeMapping ImportTypeMapping(Type type) 83public XmlTypeMapping ImportTypeMapping(Type type, string? defaultNamespace) 142private SoapAttributes GetAttributes(Type type) 258[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 685Type accessorType = model.FieldType; 762internal string XsdTypeName(Type type) 772internal string XsdTypeName(Type type, SoapAttributes a, string name) 780Type genType = type.GetGenericTypeDefinition(); 781Type[] names = genType.GetGenericArguments(); 782Type[] types = type.GetGenericArguments();
System\Xml\Serialization\SourceInfo.cs (17)
30new Type[] { typeof(int) } 38public readonly Type? Type; 41public SourceInfo(string source, string? arg, MemberInfo? memberInfo, Type? type, CodeGenerator ilg) 56public void LoadAddress(Type? elementType) 62public void Load(Type? elementType) 68private void InternalLoad(Type? elementType, bool asAddress = false) 74Type varType = CodeGenerator.GetVariableType(varA); 80Type eType = varType.GetElementType()!; 109new Type[] { typeof(int) } 119Type eType = get_Item.ReturnType; 144Type varType; 176Type memberType = (MemberInfo is FieldInfo) ? 207private void Convert(Type sourceType, Type? targetType, bool asAddress) 220| DynamicallyAccessedMemberTypes.NonPublicMethods)] Type nullableType, Type targetType) 228Type.EmptyTypes
System\Xml\Serialization\TypeExtensions.cs (2)
16this Type targetType, 28Type sourceType = data.GetType();
System\Xml\Serialization\Types.cs (43)
90private Type? _type; 123internal TypeDesc(Type type, bool isXsdType, XmlSchemaType dataType, string formatterName, TypeFlags flags) 129internal TypeDesc(Type? type, string name, string fullName, TypeKind kind, TypeDesc? baseTypeDesc, TypeFlags flags, TypeDesc? arrayElementTypeDesc) 174internal Type? Type 357[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 546internal static bool IsKnownType(Type type) 553switch (Type.GetTypeCode(type)) 628private static void AddPrimitive(Type type, string dataTypeName, string formatterName, TypeFlags flags) 639private static void AddNonXsdPrimitive(Type type, string dataTypeName, string ns, string formatterName, XmlQualifiedName baseTypeName, XmlSchemaFacet[] facets, TypeFlags flags) 657private static void AddSoapEncodedPrimitive(Type type, string dataTypeName, string ns, string formatterName, XmlQualifiedName baseTypeName, TypeFlags flags) 686internal TypeDesc GetTypeDesc(Type type) 692internal TypeDesc GetTypeDesc(Type type, MemberInfo? source, bool directReference) 698internal TypeDesc GetTypeDesc(Type type, MemberInfo? source, bool directReference, bool throwOnError) 717internal TypeDesc GetArrayTypeDesc(Type type) 741internal Type? GetTypeFromTypeDesc(TypeDesc typeDesc) 748return de.Key as Type; 754private TypeDesc ImportTypeDesc(Type type, MemberInfo? memberInfo, bool directReference) 758Type? arrayElementType = null; 759Type? baseType = null; 943for (Type? t = type.DeclaringType; t != null && !t.ContainsGenericParameters && !(t.IsAbstract && t.IsSealed); t = t.DeclaringType) 949private static bool IsArraySegment(Type t) 954internal static bool IsOptionalValue(Type type) 972internal static string TypeName(Type t) 990Type[] arguments = t.GetGenericArguments(); 1008internal static Type? GetArrayElementType(Type type, string? memberInfo) 1162[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type derivedType, 1166Type currentType = derivedType; 1167Type typeToBeReplaced = memberInfoToBeReplaced.DeclaringType!; 1222| DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type) 1224ConstructorInfo? ctor = type.GetConstructor(BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic, Type.EmptyTypes); 1248private static Type? GetEnumeratorElementType(Type type, ref TypeFlags flags) 1252MethodInfo? enumerator = type.GetMethod("GetEnumerator", Type.EmptyTypes); 1276enumerator = type.GetMethod("System.Collections.IEnumerable.GetEnumerator", BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic, Type.EmptyTypes); 1287Type currentType = (p == null ? typeof(object) : p.PropertyType); 1289MethodInfo? addMethod = type.GetMethod("Add", new Type[] { currentType }); 1294addMethod = type.GetMethod("Add", new Type[] { currentType }); 1309[DynamicallyAccessedMembers(TrimmerConstants.PublicMembers)] Type type, string? memberInfo) 1327for (Type? t = type; t != null; t = t.BaseType) 1351MethodInfo? addMethod = type.GetMethod("Add", new Type[] { indexer.PropertyType }); 1358private static Type GetCollectionElementType( 1359[DynamicallyAccessedMembers(TrimmerConstants.PublicMembers)] Type type,
System\Xml\Serialization\XmlArrayItemAttribute.cs (4)
17private Type? _type; 43public XmlArrayItemAttribute(Type? type) 51public XmlArrayItemAttribute(string? elementName, Type? type) 60public Type? Type
System\Xml\Serialization\XmlAttributeAttribute.cs (4)
17private Type? _type; 40public XmlAttributeAttribute(Type? type) 48public XmlAttributeAttribute(string? attributeName, Type? type) 57public Type? Type
System\Xml\Serialization\XmlAttributeOverrides.cs (6)
19private readonly Dictionary<Type, Dictionary<string, XmlAttributes?>> _types = new Dictionary<Type, Dictionary<string, XmlAttributes?>>(); 24public void Add(Type type, XmlAttributes attributes) 32public void Add(Type type, string member, XmlAttributes? attributes) 50public XmlAttributes? this[Type type] 61public XmlAttributes? this[Type type, string member]
System\Xml\Serialization\XmlAttributes.cs (1)
176internal static object? GetAttr(MemberInfo memberInfo, Type attrType)
System\Xml\Serialization\Xmlcustomformatter.cs (1)
40Type type = value.GetType();
System\Xml\Serialization\XmlElementAttribute.cs (4)
17private Type? _type; 43public XmlElementAttribute(Type? type) 51public XmlElementAttribute(string? elementName, Type? type) 60public Type? Type
System\Xml\Serialization\XmlIncludeAttribute.cs (3)
14private Type? _type; 19public XmlIncludeAttribute(Type? type) 27public Type? Type
System\Xml\Serialization\XmlMapping.cs (1)
114internal static string GenerateKey(Type type, XmlRootAttribute? root, string? ns)
System\Xml\Serialization\XmlReflectionImporter.cs (43)
100Type type = ((XmlIncludeAttribute)attrs[i]).Type!; 110public void IncludeType(Type type) 117private void IncludeType(Type type, RecursionLimiter limiter) 142public XmlTypeMapping ImportTypeMapping(Type type) 152public XmlTypeMapping ImportTypeMapping(Type type, string? defaultNamespace) 162public XmlTypeMapping ImportTypeMapping(Type type, XmlRootAttribute? root) 172public XmlTypeMapping ImportTypeMapping(Type type, XmlRootAttribute? root, string? defaultNamespace) 248private XmlAttributes GetAttributes(Type type, bool canBeSimpleType) 487[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type type) 498MethodInfo? getMethod = getMethod = type.GetMethod(provider.MethodName, /* BindingFlags.DeclaredOnly | */ BindingFlags.Static | BindingFlags.Public, new Type[] { typeof(XmlSchemaSet) }); 510private SpecialMapping ImportSpecialMapping(Type type, TypeDesc typeDesc, string? ns, ImportContext context) 623private static InvalidOperationException InvalidAttributeUseException(Type type) 647[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 712private TypeMapping? GetTypeMapping(string? typeName, string? ns, TypeDesc typeDesc, NameTable typeLib, Type? type) 957internal string XsdTypeName(Type type) 967internal string XsdTypeName(Type type, XmlAttributes a, string name) 975Type genType = type.GetGenericTypeDefinition(); 976Type[] names = genType.GetGenericArguments(); 977Type[] types = type.GetGenericArguments(); 1004private void SetArrayMappingType(ArrayMapping mapping, string? defaultNs, Type type) 1387Type? choiceIdentifierType = null; 1418Type? choiceIdentifierType = null; 1427private static Type CheckChoiceIdentifierType(Type type, bool isArrayLike, string identifierName, string memberName) 1452private static Type GetChoiceIdentifierType(XmlChoiceIdentifierAttribute choice, XmlReflectionMember[] xmlReflectionMembers, bool isArrayLike, string accessorName) 1466private static Type GetChoiceIdentifierType(XmlChoiceIdentifierAttribute choice, StructModel structModel, bool isArrayLike, string accessorName) 1496Type enumType = member.FieldType; 1503private void CreateArrayElementsFromAttributes(ArrayMapping arrayMapping, XmlArrayItemAttributes attributes, Type arrayElementType, string? arrayElementNs, RecursionLimiter limiter) 1512Type targetType = xmlArrayItem.Type ?? arrayElementType; 1529private void ImportAccessorMapping(MemberMapping accessor, FieldModel model, XmlAttributes a, string? ns, Type? choiceIdentifierType, bool rpc, bool openModel, RecursionLimiter limiter) 1539Type accessorType = model.FieldType; 1571Type arrayElementType = TypeScope.GetArrayElementType(accessorType, $"{model.FieldTypeDesc.FullName}.{model.Name}")!; 1598Type targetType = a.XmlAttribute!.Type == null ? arrayElementType : a.XmlAttribute.Type!; 1628Type targetType = a.XmlText.Type ?? arrayElementType; 1643Type targetType = xmlElement.Type ?? arrayElementType; 1684Type targetType = typeof(IXmlSerializable).IsAssignableFrom(arrayElementType) ? arrayElementType : typeof(XmlNode).IsAssignableFrom(arrayElementType) ? arrayElementType : typeof(XmlElement); 1885Type targetType = xmlElement.Type ?? accessorType; 1925Type targetType = typeof(IXmlSerializable).IsAssignableFrom(accessorType) ? accessorType : typeof(XmlNode).IsAssignableFrom(accessorType) ? accessorType : typeof(XmlElement); 2076private void CheckAmbiguousChoice(XmlAttributes a, Type accessorType, string accessorName) 2085Type type = elements[i]!.Type == null ? accessorType : elements[i]!.Type!; 2110Type type = items[i]!.Type == null ? accessorType : items[i]!.Type!; 2144private static object? GetDefaultValue(TypeDesc fieldTypeDesc, Type t, XmlAttributes a) 2259internal static XmlTypeMapping GetTopLevelMapping(Type type, string? defaultNamespace)
System\Xml\Serialization\XmlReflectionMember.cs (2)
16private Type? _type; 25public Type? MemberType
System\Xml\Serialization\XmlSchemaExporter.cs (2)
923Type formatter = typeof(XmlConvert); 924System.Reflection.MethodInfo? format = formatter.GetMethod("ToString", new Type[] { pm.TypeDesc.Type! });
System\Xml\Serialization\XmlSchemaImporter.cs (18)
31public XmlTypeMapping ImportDerivedTypeMapping(XmlQualifiedName name, Type? baseType) 52public XmlTypeMapping ImportDerivedTypeMapping(XmlQualifiedName name, Type? baseType, bool baseTypeCanBeIndirect) 86public XmlTypeMapping ImportSchemaType(XmlQualifiedName typeName, Type? baseType) 93public XmlTypeMapping ImportSchemaType(XmlQualifiedName typeName, Type? baseType, bool baseTypeCanBeIndirect) 194public XmlMembersMapping ImportMembersMapping(XmlQualifiedName[] names, Type? baseType, bool baseTypeCanBeIndirect) 249private ElementAccessor ImportElement(XmlQualifiedName name, Type desiredMappingType, Type? baseType) 266private ElementAccessor ImportElement(XmlSchemaElement element, string identifier, Type desiredMappingType, Type? baseType, string? ns, bool topLevelElement) 326private TypeMapping ImportElementType(XmlSchemaElement element, string identifier, Type desiredMappingType, Type? baseType, string? ns) 415private TypeMapping? ImportType(XmlQualifiedName name, Type desiredMappingType, Type? baseType, TypeFlags flags, bool addref) 444private TypeMapping? ImportType(XmlSchemaComplexType type, string? typeNs, string identifier, Type desiredMappingType, Type? baseType) 495private StructMapping ImportStructType(XmlSchemaType type, string? typeNs, string identifier, Type? baseType, bool arrayLike) 606private StructMapping ImportStructDataType(XmlSchemaSimpleType dataType, string? typeNs, string identifier, Type baseType) 1663private TypeMapping? ImportDataType(XmlSchemaSimpleType dataType, string? typeNs, string identifier, Type? baseType, TypeFlags flags, bool isList)
System\Xml\Serialization\XmlSchemas.cs (3)
209public object? Find(XmlQualifiedName name, Type type) 213internal object? Find(XmlQualifiedName name, Type type, bool checkCache) 603Type type = o.GetType();
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (6)
167internal void GenerateSupportedTypes(Type?[] types) 172_writer.Write(typeof(Type).FullName); 178Type? type = types[i]; 338_writer.Write(typeof(Type).FullName); 346Type? type = xmlMappings[i].Accessor.Mapping!.TypeDesc!.Type; 367internal void GenerateSerializerContract(XmlMapping[] xmlMappings, Type?[] types, string readerType, string?[] readMethods, string writerType, string?[] writerMethods, Hashtable serializers)
System\Xml\Serialization\XmlSerializationILGen.cs (45)
23internal Dictionary<string, Type> CreatedTypes = new Dictionary<string, Type>(); 73private static readonly Type[] s_typeType = new Type[] { typeof(Type) }; 74private static readonly Type[] s_xmlReaderType = new Type[] { typeof(XmlReader) }; 75private static readonly Type[] s_objectXmlSerializationWriterType = new Type[] { typeof(object), typeof(XmlSerializationWriter) }; 76private static readonly Type[] s_xmlSerializationReaderType = new Type[] { typeof(XmlSerializationReader) }; 79MethodAttributes attributes, Type? returnType, Type[] parameterTypes) 163Type.EmptyTypes, 176Type.EmptyTypes 214new Type[] { typeof(object), typeof(object) } 230internal void GenerateSupportedTypes(Type[] types, TypeBuilder serializerContractTypeBuilder) 239var uniqueTypes = new HashSet<Type>(); 242Type type = types[i]; 277Type.EmptyTypes); 281Type.EmptyTypes 286Type.EmptyTypes, 294Type.EmptyTypes 298Type.EmptyTypes, 306Type baseSerializerType = baseSerializerTypeBuilder.CreateType(); 322Type.EmptyTypes 345new Type[] { typeof(string), typeof(string) } 370new Type[] { (mapping is XmlMembersMapping) ? typeof(object[]) : typeof(object) } 394Type.EmptyTypes 402Type typedSerializerType = typedSerializerTypeBuilder.CreateType(); 415new Type[] { typeof(object), typeof(object) } 422Type.EmptyTypes 448Type? type = xmlMappings[i].Accessor.Mapping!.TypeDesc!.Type; 462Type.EmptyTypes 479internal void GenerateSerializerContract(XmlMapping[] xmlMappings, Type[] types, string readerType, string[] readMethods, string writerType, string[] writerMethods, Dictionary<string, string> serializers) 486Type.EmptyTypes 498Type.EmptyTypes, 504Type.EmptyTypes 518Type.EmptyTypes, 524Type.EmptyTypes 538Type.EmptyTypes 544Type.EmptyTypes, 561Type serializerContractType = serializerContractTypeBuilder.CreateType(); 577internal void ILGenLoad(string source, Type? type) 586Type memType = (memInfo is FieldInfo) ? ((FieldInfo)memInfo).FieldType : ((PropertyInfo)memInfo).PropertyType;
System\Xml\Serialization\XmlSerializationReader.cs (16)
270private Type? GetPrimitiveType(XmlQualifiedName typeName, bool throwOnUnknown) 1313protected Exception CreateUnknownConstantException(string? value, Type enumType) 1318protected Exception CreateInvalidCastException(Type type, object? value) 1323protected Exception CreateInvalidCastException(Type type, object? value, string? id) 1345protected Array EnsureArrayIndex(Array? a, int index, Type elementType) 1355protected Array? ShrinkArray(Array? a, int length, Type elementType, bool isNullable) 1557Type? fallbackElementType = null; 1562Type? arrayType = (Type?)_types[new XmlQualifiedName(typeName, typeNs)]; 1587Type? elementType = null; 1592elementType = (Type?)_types[qname]; 1715Type? itemType = null; 1721Type currItemType = currItem.GetType(); 1857protected void AddReadCallback(string name, string ns, Type type, XmlSerializationReadCallback read) 5029Writer.Write(typeof(Type).FullName); 5091private void WriteCatchException(Type exceptionType)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (171)
32private static readonly Type[] s_boolType = new Type[] { typeof(bool) }; 192Type.EmptyTypes); 229ilg.BeginMethod(typeof(void), "InitIDs", Type.EmptyTypes, Array.Empty<string>(), 234Type.EmptyTypes 239Type.EmptyTypes 244new Type[] { typeof(string) } 261Type readerType = this.typeBuilder.CreateType(); 286Type.EmptyTypes 291new Type[] { typeof(string), typeof(string) } 309List<Type> argTypes = new List<Type>(); 344ilg.BeginMethod(typeof(void), "InitCallbacks", Type.EmptyTypes, Array.Empty<string>(), 393Type.EmptyTypes, 402Type.EmptyTypes 407Type.EmptyTypes 522Type.EmptyTypes 537Type.EmptyTypes 547Type.EmptyTypes 562Type.EmptyTypes 591Type.EmptyTypes 636Type.EmptyTypes, 651Type.EmptyTypes 656Type.EmptyTypes 692new Type[] { typeof(string) } 700Type.EmptyTypes 705Type.EmptyTypes 716Type.EmptyTypes 721Type.EmptyTypes 750Type.EmptyTypes 755Type.EmptyTypes 766Type.EmptyTypes 771Type.EmptyTypes 804new Type[] { typeof(string) }, 815Type.EmptyTypes 820Type.EmptyTypes 832new Type[] { typeof(string) } 840Type argType = source == "false" ? typeof(bool) : typeof(string); 857new Type[] { argType } 865new Type[] { argType } 873Type.EmptyTypes 878Type.EmptyTypes 889Type.EmptyTypes 894Type.EmptyTypes 965Type.EmptyTypes, 976Type.EmptyTypes 986new Type[] { typeof(object), typeof(object) } 1024List<Type> argTypes = new List<Type>(); 1026Type returnType; 1027Type underlyingType; 1048new Type[] { typeof(string), typeof(Hashtable), typeof(string) } 1091new Type[] { typeof(string), typeof(string) } 1112new Type[] { typeof(string), typeof(Type) } 1145List<Type> argTypes = new List<Type>(); 1184Type.EmptyTypes 1189Type.EmptyTypes 1204new Type[] { typeof(string) } 1209new Type[] { typeof(string) } 1214Type.EmptyTypes 1228Type.EmptyTypes 1293Type.EmptyTypes)!; 1330List<Type> argTypes = new List<Type>(); 1351Type.EmptyTypes 1356Type.EmptyTypes 1395new Type[] { locXsiType.LocalType } 1438new Type[] { typeof(string), typeof(string) } 1443new Type[] { typeof(XmlQualifiedName) } 1461new Type[] { locXsiType.LocalType } 1474new Type[] { typeof(XmlQualifiedName) } 1501new Type[] { typeof(string), typeof(string) } 1615Type.EmptyTypes 1620Type.EmptyTypes 1630Type.EmptyTypes 1639Type.EmptyTypes 1653Type.EmptyTypes 1669Type.EmptyTypes 1682Type.EmptyTypes 1703Type.EmptyTypes 1708Type.EmptyTypes 1746Type.EmptyTypes 1751Type.EmptyTypes 1756Type.EmptyTypes 1811Type.EmptyTypes 1816Type.EmptyTypes 1870new Type[] { typeof(string) } 1875Type.EmptyTypes 1880Type.EmptyTypes 1885Type.EmptyTypes 1901Type.EmptyTypes 1912new Type[] { typeof(string), typeof(string) } 1917Type.EmptyTypes 1945new Type[] { typeof(string) } 1950Type.EmptyTypes 1966Type.EmptyTypes 1971new Type[] { typeof(XmlReader) } 1983new Type[] { localAttr.LocalType } 1992List<Type> argTypes = new List<Type>(); 2074new Type[] { typeof(char[]) } 2079Type.EmptyTypes 2084Type.EmptyTypes 2172new Type[] { typeof(string) } 2238Type.EmptyTypes 2243Type.EmptyTypes 2270Type.EmptyTypes 2275Type.EmptyTypes 2326Type.EmptyTypes 2331Type.EmptyTypes 2336Type.EmptyTypes 2341new Type[] { typeof(string) } 2370Type.EmptyTypes 2375Type.EmptyTypes 2385new Type[] { typeof(string) } 2398new Type[] { typeof(string), typeof(bool) } 2510Type.EmptyTypes 2639new Type[] { typeof(Array), typeof(int), typeof(Type), typeof(bool) } 2693Type varType = CodeGenerator.GetVariableType(variable); 2717Type arrayElementType = localA.LocalType.GetElementType()!; 2721new Type[] { typeof(Array), typeof(int), typeof(Type) } 2765private void WriteSourceEnd(string source, Type elementType) 2769private void WriteSourceEnd(string source, Type elementType, Type stackType) 2774Type varType = CodeGenerator.GetVariableType(variable); 2802Type arrayElementType = CodeGenerator.GetVariableType(oVar).GetElementType()!; 2823new Type[] { elementType } 2826Type addParameterType = Add.GetParameters()[0].ParameterType; 2837Type varType = CodeGenerator.GetVariableType(ilg.GetVariable(match.Groups["a"].Value)); 2839Type varElementType = varType.GetElementType()!; 2852Type.EmptyTypes 2888Type.EmptyTypes 2893Type.EmptyTypes 2909Type.EmptyTypes 2919Type.EmptyTypes 2931Type.EmptyTypes 2942Type.EmptyTypes 3002Type.EmptyTypes 3025Type.EmptyTypes 3030Type.EmptyTypes 3039Type.EmptyTypes 3056Type.EmptyTypes 3061Type.EmptyTypes 3071Type.EmptyTypes 3095Type.EmptyTypes 3136Type.EmptyTypes 3141Type.EmptyTypes 3152List<Type> argTypes = new List<Type>(); 3201Type.EmptyTypes 3226isWrappedAny ? new Type[] { typeof(IXmlSerializable), typeof(bool) } : new Type[] { typeof(IXmlSerializable) } 3297isWrappedAny ? new Type[] { typeof(IXmlSerializable), typeof(bool) } : new Type[] { typeof(IXmlSerializable) } 3316new Type[] { typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string) } 3334new Type[] { typeof(string), typeof(string), typeof(string) } 3354Type.EmptyTypes 3359Type.EmptyTypes 3379Type.EmptyTypes 3384Type.EmptyTypes 3450new Type[] { typeof(string) } 3461new Type[] { typeof(string) } 3472private void WriteCatchException(Type exceptionType) 3483private void WriteCreateInstance(string source, bool ctorInaccessible, Type type) 3513new Type[] { typeof(object) } 3518new Type[] { typeof(object), typeof(string) } 3601Type.EmptyTypes
System\Xml\Serialization\XmlSerializationWriter.cs (50)
188private XmlQualifiedName GetPrimitiveTypeName(Type type) 194private XmlQualifiedName? GetPrimitiveTypeName(Type type, bool throwIfUnknown) 202internal static XmlQualifiedName? GetPrimitiveTypeNameInternal(Type type) 207switch (Type.GetTypeCode(type)) 264Type t = o.GetType(); 269switch (Type.GetTypeCode(t)) 818protected Exception CreateUnknownTypeException(Type type) 858protected Exception CreateInvalidAnyTypeException(Type type) 1175protected void AddWriteCallback(Type type, string typeName, string? typeNs, XmlSerializationWriteCallback callback) 1186private void WriteArray(string name, string? ns, object o, Type type) 1188Type elementType = TypeScope.GetArrayElementType(type, null)!; 1225Type? elementBaseType = elementType.BaseType; 1317protected void WritePotentiallyReferencingElement(string? n, string? ns, object? o, Type? ambientType) 1323protected void WritePotentiallyReferencingElement(string n, string? ns, object? o, Type? ambientType, bool suppressReference) 1329protected void WritePotentiallyReferencingElement(string? n, string? ns, object? o, Type? ambientType, bool suppressReference, bool isNullable) 1336Type t = o.GetType(); 1337if (Type.GetTypeCode(t) == TypeCode.Object && !(o is Guid) && (t != typeof(XmlQualifiedName)) && !(o is XmlNode[]) && (t != typeof(byte[]))) 1378private void WriteReferencedElement(object o, Type? ambientType) 1384private void WriteReferencedElement(string? name, string? ns, object o, Type? ambientType) 1387Type t = o.GetType(); 1405private TypeEntry? GetTypeEntry(Type t) 1478internal Type? type; 1494internal static bool IsTypeDynamic(Type type) 1508Type[] parameterTypes = type.GetGenericArguments(); 1513Type parameterType = parameterTypes[i]; 1529internal static bool IsTypeDynamic(Type[] arguments) 1531foreach (Type t in arguments) 1610foreach (Type type in scope.Types) 1619private string WriteTypeInfo(TypeScope scope, TypeDesc typeDesc, Type type) 1634_writer.WriteLine($"static {typeof(Type).FullName} {typeVariable} = {elementTypeVariable}.MakeArrayType();"); 1639_writer.Write($"static {typeof(Type).FullName} {typeVariable} = {assemblyVariable}.GetType("); 1648Type? parameterType = Nullable.GetUnderlyingType(type); 1652_writer.WriteLine($"static {typeof(Type).FullName} {typeVariable} = typeof(System.Nullable<>).MakeGenericType(new {typeof(Type).FullName}[] {{{parameterTypeVariable}}});"); 1657_writer.Write($"static {typeof(Type).FullName} {typeVariable} = {assemblyVariable}.GetType("); 1686"object", "string", typeof(Type).FullName, 1694[DynamicallyAccessedMembers(TrimmerConstants.PublicMembers)] Type type) 1731[DynamicallyAccessedMembers(TrimmerConstants.PublicMembers)] Type type) 1754private string WriteAssemblyInfo(Type type) 1773[DynamicallyAccessedMembers(TrimmerConstants.PublicMembers)] Type type, string escapedName, string typeVariable, string memberName) 1822_writer.Write($"new {typeof(Type).FullName}[] {{ "); 1835[DynamicallyAccessedMembers(TrimmerConstants.PublicMembers)] Type type, string escapedName, bool collectionUseReflection, bool elementUseReflection) 1849_writer.Write(typeof(Type[]).FullName); 3114Writer.Write(typeof(Type).FullName); 4176private void WriteElementCall(string func, Type cast, string source, string name, string? ns, bool isNullable, bool isAny) 4216Type? type = Type.GetType(mapping.TypeDesc!.Type!.FullName!); 4224Type? type = Type.GetType(mapping.TypeDesc!.Type!.FullName!); 4266Type type = value.GetType();
System\Xml\Serialization\XmlSerializationWriterILGen.cs (125)
33Type.EmptyTypes); 63internal Type GenerateEnd() 89ilg.BeginMethod(typeof(void), "InitCallbacks", Type.EmptyTypes, Array.Empty<string>(), 101List<Type> argTypes = new List<Type>(); 121private void WriteEnumValue(EnumMapping mapping, SourceInfo source, out Type returnType) 136new Type[] { mapping.TypeDesc!.Type! }); 143private void WritePrimitiveValue(TypeDesc typeDesc, SourceInfo source, out Type returnType) 154Type argType = typeDesc.Type!; 164new Type[] { argType } 182new Type[] { typeDesc.Type! } 230List<Type> argTypes = new List<Type>(); 239Type argType; 257new Type[] { typeof(string), typeof(string) } 282new Type[] { typeof(string), typeof(string) } 295new Type[] { typeof(string), typeof(string), typeof(object), typeof(bool) } 315Type.EmptyTypes 346private static readonly Type[] s_objectArrayType = new Type[] { typeof(object[]) }; 347private static readonly Type[] s_objectType = new Type[] { typeof(object) }; 368Type.EmptyTypes 376Type.EmptyTypes 559Type.EmptyTypes 579Type.EmptyTypes 600List<Type> argTypes = new List<Type>(); 683new Type[] { typeof(long), typeof(string[]), typeof(long[]), typeof(string) } 703Type.EmptyTypes 708new Type[] { typeof(IFormatProvider) } 713new Type[] { typeof(object), typeof(string) } 751List<Type> argTypes = new List<Type>(); 758Type oType = CodeGenerator.GetVariableType(oVar); 804Type.EmptyTypes 809new Type[] { typeof(string), typeof(string) } 819new Type[] { typeof(string), typeof(string) } 829new Type[] { mapping.TypeDesc.Type! } 834new Type[] { typeof(string) } 847Type.EmptyTypes 870Type.EmptyTypes 875new Type[] { typeof(string), typeof(string) } 885new Type[] { typeof(string), typeof(string) } 897Type.EmptyTypes 915List<Type> argTypes = new List<Type>(5); 944new Type[] { typeof(string), typeof(string) } 958LocalBuilder tLoc = ilg.DeclareLocal(typeof(Type), "t"); 962Type.EmptyTypes 981new Type[] { typeof(string), typeof(string), typeof(object), typeof(bool) } 1014new Type[] { typeof(bool) } 1049new Type[] { typeof(string), typeof(string), typeof(object), typeof(bool), typeof(XmlSerializerNamespaces) } 1059new Type[] { typeof(string), typeof(string) } 1177Type.EmptyTypes 1182new Type[] { typeof(string), typeof(string), typeof(string) } 1196Type.EmptyTypes 1217Type methodType; 1218Type argType; 1228Type.EmptyTypes 1233new Type[] { typeof(string) } 1249new Type[] { typeof(string) } 1270new Type[] { argType } 1292Type.EmptyTypes 1297Type.EmptyTypes 1308Type.EmptyTypes 1315List<Type> argTypes = new List<Type>(); 1328Type.EmptyTypes 1366new Type[] { typeof(XmlNode), typeof(object) } 1387Type? targetType, 1456new Type[] { typeof(string), typeof(string) } 1487Type typeIEnumerable = typeof(IEnumerable); 1492Type.EmptyTypes)!; 1498Type typeIEnumerable = typeof(IEnumerable<>).MakeGenericType(arrayElementTypeDesc.Type!); 1503Type.EmptyTypes)!; 1511Type.EmptyTypes)!; 1530Type.EmptyTypes)!; 1714Type.EmptyTypes 1719Type.EmptyTypes 1727new Type[] { typeof(string), typeof(string) } 1750new Type[] { typeof(string), typeof(string), typeof(string), typeof(string) } 1777new Type[] { typeof(string), typeof(string) } 1784Type.EmptyTypes 1789Type.EmptyTypes 1853Type argType; 1866new Type[] { argType } 1878new Type[] { typeof(XmlWriter) } 1883Type.EmptyTypes 1907Type.EmptyTypes 1996List<Type> argTypes = new List<Type>(); 2064private void WriteElementCall(string func, Type cast, SourceInfo source, string? name, string? ns, bool isNullable, bool isAny) 2069new Type[] { cast, typeof(string), typeof(string), typeof(bool), typeof(bool) } 2098Type.EmptyTypes 2134Type valueType = value.GetType(); 2140new Type[] { valueType, valueType } 2170new Type[] { typeof(string), typeof(string), typeof(string) } 2197new Type[] { typeof(XmlSerializerNamespaces) } 2215private void WriteLocalDecl(string variableName, string initValue, Type type) 2224private void WriteTypeCompare(string variable, Type type) 2229private void WriteInstanceOf(SourceInfo source, Type type) 2233private void WriteArrayTypeCompare(string variable, Type arrayType) 2310foreach (Type type in scope.Types) 2340internal static void ILGenForEnumMember(CodeGenerator ilg, Type type, string memberName) 2354internal static void ILGenForCreateInstance(CodeGenerator ilg, Type type, bool ctorInaccessible, bool cast) 2360Type.EmptyTypes 2378internal static void ILGenForCreateInstance(CodeGenerator ilg, Type type, Type? cast) 2392Type? xName = type.Assembly.GetType("System.Xml.Linq.XName"); 2398new Type[] { typeof(string) } 2402new Type[] { xName } 2423new[] { typeof(Type) } 2457MethodInfo constructorInvoke = typeof(ConstructorInfo).GetMethod("Invoke", new Type[] { typeof(object[]) })!; 2468Type.EmptyTypes)!; 2477new Type[] { typeof(Type) } 2489Type localType = initValue.Type!; 2529internal static void WriteCreateInstance(string source, bool ctorInaccessible, Type type, CodeGenerator ilg) 2537internal static void WriteInstanceOf(SourceInfo source, Type type, CodeGenerator ilg) 2550Type localType = (typeName == arrayTypeDesc.CSharpName) ? arrayTypeDesc.Type! : arrayTypeDesc.Type!.MakeArrayType(); 2556internal static void WriteTypeCompare(string variable, Type type, CodeGenerator ilg) 2560ilg.Ldloc(typeof(Type), variable); 2564internal static void WriteArrayTypeCompare(string variable, Type arrayType, CodeGenerator ilg) 2568ilg.Ldloc(typeof(Type), variable);
System\Xml\Serialization\XmlSerializer.cs (35)
95public virtual bool CanSerialize(Type type) { throw new NotSupportedException(); } 97public virtual XmlSerializer GetSerializer(Type type) { throw new NotSupportedException(); } 134private readonly Type? _primitiveType; 138private Type? _rootType; 172public XmlSerializer(Type type, XmlAttributeOverrides? overrides, Type[]? extraTypes, XmlRootAttribute? root, string? defaultNamespace) : 179public XmlSerializer(Type type, XmlRootAttribute? root) : this(type, null, Type.EmptyTypes, root, null, null) 185public XmlSerializer(Type type, Type[]? extraTypes) : this(type, null, extraTypes, null, null, null) 191public XmlSerializer(Type type, XmlAttributeOverrides? overrides) : this(type, overrides, Type.EmptyTypes, null, null, null) 210public XmlSerializer(Type type) : this(type, (string?)null) 216public XmlSerializer(Type type, string? defaultNamespace) 276public XmlSerializer(Type type, XmlAttributeOverrides? overrides, Type[]? extraTypes, XmlRootAttribute? root, string? defaultNamespace, string? location) 291private static XmlTypeMapping GenerateXmlTypeMapping(Type type, XmlAttributeOverrides? overrides, Type[]? extraTypes, XmlRootAttribute? root, string? defaultNamespace) 312internal static TempAssembly? GenerateTempAssembly(XmlMapping xmlMapping, Type? type, string? defaultNamespace) 319internal static TempAssembly? GenerateTempAssembly(XmlMapping xmlMapping, Type? type, string? defaultNamespace, string? location) 329return new TempAssembly(new XmlMapping[] { xmlMapping }, new Type?[] { type }, defaultNamespace, location); 573return FromMappings(mappings, (Type?)null); 578public static XmlSerializer?[] FromMappings(XmlMapping[]? mappings, Type? type) 616tempAssembly = new TempAssembly(mappings, new Type?[] { type }, null, null); 649private static XmlSerializer[] GetReflectionBasedSerializers(XmlMapping[] mappings, Type? type) 666internal static bool GenerateSerializer(Type[]? types, XmlMapping[] mappings, Stream stream) 682Type type = types[i]; 706private static XmlSerializer[] GetSerializersFromCache(XmlMapping[] mappings, Type type) 735TempAssembly tempAssembly = new TempAssembly(pendingMappings, new Type[] { type }, null, null); 754public static XmlSerializer?[] FromTypes(Type[]? types) 768public static string GetXmlSerializerAssemblyName(Type type) 773public static string GetXmlSerializerAssemblyName(Type type, string? defaultNamespace) 843private static XmlTypeMapping? GetKnownMapping(Type type, string? ns) 861switch (Type.GetTypeCode(_primitiveType)) 943switch (Type.GetTypeCode(_primitiveType))
System\Xml\Serialization\XmlSerializerFactory.cs (12)
23public XmlSerializer CreateSerializer(Type type, XmlAttributeOverrides? overrides, Type[]? extraTypes, XmlRootAttribute? root, string? defaultNamespace) 30public XmlSerializer CreateSerializer(Type type, XmlRootAttribute? root) 32return CreateSerializer(type, null, Type.EmptyTypes, root, null, null); 37public XmlSerializer CreateSerializer(Type type, Type[]? extraTypes) 44public XmlSerializer CreateSerializer(Type type, XmlAttributeOverrides? overrides) 46return CreateSerializer(type, overrides, Type.EmptyTypes, null, null, null); 58public XmlSerializer CreateSerializer(Type type) 65public XmlSerializer CreateSerializer(Type type, string? defaultNamespace) 72public XmlSerializer CreateSerializer(Type type, XmlAttributeOverrides? overrides, Type[]? extraTypes, XmlRootAttribute? root, string? defaultNamespace, string? location)
System\Xml\Serialization\XmlSerializerVersionAttribute.cs (3)
14private Type? _type; 20public XmlSerializerVersionAttribute(Type? type) 44public Type? Type
System\Xml\Serialization\XmlTextAttribute.cs (3)
15private Type? _type; 28public XmlTextAttribute(Type? type) 36public Type? Type
System\Xml\XmlResolver.cs (3)
29Type? ofObjectToReturn); 33Type? ofObjectToReturn) 79public virtual bool SupportsType(Uri absoluteUri, Type? type)
System\Xml\XmlResolver.FileSystemResolver.cs (2)
29public override object? GetEntity(Uri absoluteUri, string? role, Type? ofObjectToReturn) 40public override Task<object> GetEntityAsync(Uri absoluteUri, string? role, Type? ofObjectToReturn)
System\Xml\XmlResolver.ThrowingResolver.cs (2)
38public override object GetEntity(Uri absoluteUri, string? role, Type? ofObjectToReturn) 43public override Task<object> GetEntityAsync(Uri absoluteUri, string? role, Type? ofObjectToReturn)
System\Xml\XmlSecureResolver.cs (2)
24public override object? GetEntity(Uri absoluteUri, string? role, Type? ofObjectToReturn) => XmlResolver.ThrowingResolver.GetEntity(absoluteUri, role, ofObjectToReturn); 27public override Task<object> GetEntityAsync(Uri absoluteUri, string? role, Type? ofObjectToReturn) => XmlResolver.ThrowingResolver.GetEntityAsync(absoluteUri, role, ofObjectToReturn);
System\Xml\XmlUrlResolver.cs (2)
39public override object? GetEntity(Uri absoluteUri, string? role, Type? ofObjectToReturn) 50public override async Task<object> GetEntityAsync(Uri absoluteUri, string? role, Type? ofObjectToReturn)
System\Xml\XPath\XPathItem.cs (3)
28public abstract Type ValueType { get; } 34public virtual object ValueAs(Type returnType) { return ValueAs(returnType, null); } 35public abstract object ValueAs(Type returnType, IXmlNamespaceResolver? nsResolver);
System\Xml\XPath\XPathNavigator.cs (2)
136public override Type ValueType 344public override object ValueAs(Type returnType, IXmlNamespaceResolver? nsResolver)
System\Xml\XPath\XPathNavigatorReader.cs (1)
188public override System.Type ValueType
System\Xml\Xsl\IlGen\GenerateHelper.cs (25)
43public readonly Type SeqType; 51public readonly Type IListType; 61public XmlILStorageMethods(Type storageType) 64Type? aggType = null; 98Type sequenceType; 124Type listType = typeof(IList<>).MakeGenericType(storageType); 160public static readonly ConstructorInfo NonUserCode = typeof(DebuggerNonUserCodeAttribute).GetConstructor(Type.EmptyTypes)!; 162public static readonly ConstructorInfo StepThrough = typeof(DebuggerStepThroughAttribute).GetConstructor(Type.EmptyTypes)!; 163public static readonly ConstructorInfo Transparent = typeof(SecurityTransparentAttribute).GetConstructor(Type.EmptyTypes)!; 270public static readonly MethodInfo ChangeTypeXsltArg = typeof(XmlQueryRuntime).GetMethod("ChangeTypeXsltArgument", new[] { typeof(int), typeof(object), typeof(Type) })!; 321public static readonly MethodInfo ValueAsAny = typeof(XPathItem).GetMethod("ValueAs", new[] { typeof(Type), typeof(IXmlNamespaceResolver) })!; 438public static readonly MethodInfo GetTypeFromHandle = typeof(Type).GetMethod("GetTypeFromHandle")!; 440public static readonly Dictionary<Type, XmlILStorageMethods> StorageMethods = new Dictionary<Type, XmlILStorageMethods>(13) 646public void LoadType(Type clrTyp) 661public LocalBuilder DeclareLocal(string name, Type type) 887public void TreatAs(Type clrTypeSrc, Type clrTypeDst) 1061public void CallGetEarlyBoundObject(int idxObj, Type clrType) 1103public void CallGetGlobalValue(int idxValue, Type clrType) 1111public void CallSetGlobalValue(Type clrType) 1358public void CallCacheCount(Type itemStorageType) 1364public void CallCacheItem(Type itemStorageType) 1374public void CallValueAs(Type clrType) 1684public void Emit(OpCode opcode, Type typVal)
System\Xml\Xsl\IlGen\IteratorDescriptor.cs (9)
53private Type _itemStorageType; 72public static StorageDescriptor Stack(Type itemStorageType, bool isCached) 84public static StorageDescriptor Parameter(int paramIndex, Type itemStorageType, bool isCached) 98public static StorageDescriptor Local(LocalBuilder loc, Type itemStorageType, bool isCached) 115public static StorageDescriptor Current(LocalBuilder locIter, MethodInfo currentMethod, Type itemStorageType) 131public static StorageDescriptor Global(MethodInfo methGlobal, Type itemStorageType, bool isCached) 170public StorageDescriptor ToStorageType(Type itemStorageType) 229public Type ItemStorageType 675public void EnsureItemStorageType(XmlQueryType xmlType, Type storageTypeDest)
System\Xml\Xsl\IlGen\StaticDataManager.cs (1)
166public int DeclareEarlyBound(string namespaceUri, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type ebType)
System\Xml\Xsl\IlGen\XmlILModule.cs (7)
118public MethodInfo DefineMethod(string name, Type returnType, Type[] paramTypes, string?[] paramNames, XmlILMethodAttributes xmlAttrs) 123Type[] paramTypesNew; 137paramTypesNew = new Type[paramTypes.Length + 1]; 218public FieldInfo DefineField(string fieldName, Type type) 239Type typBaked; 262public Delegate CreateDelegate(string name, Type typDelegate)
System\Xml\Xsl\IlGen\XmlIlTypeHelper.cs (4)
24public static Type GetStorageType(XmlQueryType qyTyp) 26Type storageType; 48private static readonly Type[] s_typeCodeToStorage = { 106private static readonly Type[] s_typeCodeToCachedStorage = {
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (23)
908Type itemStorageType = GetItemStorageType(ndCond); 977private void ConditionalBranch(QilNode ndBranch, Type itemStorageType, LocalBuilder? locResult) 1164Type itemStorageType = GetItemStorageType(ndSeq); 1274private QilBinary CreateSetIterator(QilBinary ndSet, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, MethodInfo methCurrent) 1385Type typAgg = methAgg.DeclaringType!; 2262Type itemStorageType = GetItemStorageType(ndSort); 3611Type? clrTypeRetSrc; 3612Type clrTypeRetDst; 3641Type clrTypeActualArg, clrTypeFormalArg; 3658Type itemType = GetItemStorageType(ndActualArg); 3922private void CreateSimpleIterator(QilNode ndCtxt, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, MethodInfo methCurrent) 3945private void CreateFilteredIterator(QilNode ndCtxt, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, MethodInfo methCurrent, 3981private void CreateContainerIterator(QilUnary ndDod, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, MethodInfo methCurrent, 4018private void GenerateSimpleIterator(Type itemStorageType, LocalBuilder locIter, MethodInfo methNext, MethodInfo methCurrent) 4050MethodInfo methNext, MethodInfo methCurrent, Type itemStorageType) 4732private void NestedVisit(QilNode nd, Type itemStorageType, bool isCached) 4803private void NestedVisitEnsureStack(QilNode nd, Type itemStorageType, bool isCached) 4837private void NestedVisitEnsureCache(QilNode nd, Type itemStorageType) 4843Type cacheType; 4961private static Type GetStorageType(QilNode nd) 4969private static Type GetStorageType(XmlQueryType typ) 4977private static Type GetItemStorageType(QilNode nd) 4985private static Type GetItemStorageType(XmlQueryType typ)
System\Xml\Xsl\QIL\QilTypeChecker.cs (4)
998private static void CheckLiteralValue(QilNode node, Type clrTypeValue) 1002Type clrType = ((QilLiteral)node).Value!.GetType(); 1007private static void CheckClass(QilNode node, Type clrTypeClass) 1013private static void CheckClassAndNodeType(QilNode node, Type clrTypeClass, QilNodeType nodeType)
System\Xml\Xsl\Runtime\EarlyBoundInfo.cs (4)
18private readonly Type _ebType; 20public EarlyBoundInfo(string namespaceUri, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type ebType) 27_constrInfo = ebType.GetConstructor(Type.EmptyTypes)!; 40public Type EarlyBoundType
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (12)
33[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type objectType, 65private Type? _objectType; // Type of the object which will be searched for matching methods 70private Type[]? _argClrTypes; // Type array for extension function arguments 71private Type? _retClrType; // Type for extension function return value 95public XmlExtensionFunction(string name, string namespaceUri, int numArgs, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.PublicMethods)] Type objectType, BindingFlags flags) 103public void Init(string name, string namespaceUri, int numArgs, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.PublicMethods)] Type objectType, BindingFlags flags) 132public Type GetClrArgumentType(int index) 141public Type? ClrReturnType 238_argClrTypes = new Type[paramInfo.Length]; 327private Type GetClrType(Type clrType) 341private static XmlQueryType InferXmlType(Type clrType)
System\Xml\Xsl\Runtime\XmlQueryContext.cs (1)
260Type clrTypeFormalArg;
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (3)
469public object ChangeTypeXsltArgument(int indexType, object value, Type destinationType) 478internal static object ChangeTypeXsltArgument(XmlQueryType xmlType, object value, Type destinationType) 629Type sourceType = value.GetType();
System\Xml\Xsl\Runtime\XmlQueryStaticData.cs (4)
55Type[]? ebTypes; 75public XmlQueryStaticData(byte[] data, Type[]? ebTypes) 191public void GetObjectData(out byte[] data, out Type[]? ebTypes) 315ebTypes = new Type[_earlyBound.Length];
System\Xml\Xsl\Runtime\XsltConvert.cs (3)
35Type itemType = item.ValueType; 81Type itemType = item.ValueType; 348internal static XmlQueryType InferXsltType(Type clrType)
System\Xml\Xsl\Runtime\XsltFunctions.cs (1)
329Type itemType = item.ValueType;
System\Xml\Xsl\Runtime\XsltLibrary.cs (1)
342Type itemType = item.ValueType;
System\Xml\Xsl\XmlIlGenerator.cs (12)
132MethodInfo methExec = _module.DefineMethod("Execute", typeof(void), Type.EmptyTypes, Array.Empty<string>(), XmlILMethodAttributes.NonUser); 138MethodInfo methRoot = _module.DefineMethod("Root", typeof(void), Type.EmptyTypes, Array.Empty<string>(), methAttrs); 196Type[] paramTypes; 198Type typReturn; 203paramTypes = new Type[ndFunc.Arguments.Count]; 253Type typReturn; 261methInfo = _module!.DefineMethod(ndRef.DebugName!.ToString(), typReturn, Type.EmptyTypes, Array.Empty<string>(), methAttrs); 300new Type[] { typeof(XPathNavigator), typeof(XPathNavigator) }, 356Type[]? ebTypes; 363fldTypes = _module.DefineField(XmlQueryStaticData.TypesFieldName, typeof(Type[])); 379LocalBuilder locTypes = _helper.DeclareLocal("$$$types", typeof(Type[])); 381_helper.Emit(OpCodes.Newarr, typeof(Type));
System\Xml\Xsl\Xslt\QilGenerator.cs (1)
202Type? value = scriptClasses[key];
System\Xml\Xsl\Xslt\Scripts.cs (5)
34Type? type; 51private readonly Dictionary<string, Type?> _backingDictionary = new Dictionary<string, Type?>(); 53public Type? this[string key] 70public bool TryGetValue(string key, [MaybeNullWhen(false)] out Type value) => _backingDictionary.TryGetValue(key, out value);
System\Xml\Xsl\XsltOld\NumberAction.cs (1)
372if (Type.GetTypeCode(value.GetType()) == TypeCode.Object)
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (6)
544public static XPathResultType GetXPathType(Type type) 546switch (Type.GetTypeCode(type)) 708private static object ToNumeric(object argument, Type type) 713public static object ConvertToXPathType(object val, XPathResultType xt, Type type) 958private readonly Type[] _types; 971_types = new Type[parameters.Length];
System\Xml\Xslt\XslCompiledTransform.cs (4)
180public void Load(Type compiledStylesheet) 207Type[]? earlyBoundTypes = (Type[]?)fldTypes.GetValue(null); 224public void Load(MethodInfo executeMethod, byte[] queryData, Type[]? earlyBoundTypes)
System.Private.Xml.Linq (6)
System\Xml\Linq\XHelper.cs (1)
11internal static bool IsInstanceOfType(object? o, Type type)
System\Xml\Linq\XObject.cs (5)
118public object? Annotation(Type type) 142private object? AnnotationForSealedType(Type type) 198public IEnumerable<object> Annotations(Type type) 205private IEnumerable<object> AnnotationsIterator(Type type) 259public void RemoveAnnotations(Type type)
System.Reflection.Context (280)
System\Reflection\Context\CollectionServices.cs (2)
38public static object[] ConvertListToArray(List<object> list, Type arrayType) 52public static object[] IEnumerableToArray(IEnumerable<object> enumerable, Type arrayType)
System\Reflection\Context\Custom\AttributeUtils.cs (14)
11public static object[] GetCustomAttributes(CustomReflectionContext context, CustomType type, Type attributeFilterType, bool inherit) 51public static object[] GetCustomAttributes(CustomReflectionContext context, CustomMethodInfo method, Type attributeFilterType, bool inherit) 91public static object[] GetCustomAttributes(CustomReflectionContext context, CustomConstructorInfo constructor, Type attributeFilterType) 99public static object[] GetCustomAttributes(CustomReflectionContext context, CustomPropertyInfo property, Type attributeFilterType) 107public static object[] GetCustomAttributes(CustomReflectionContext context, CustomEventInfo evnt, Type attributeFilterType) 115public static object[] GetCustomAttributes(CustomReflectionContext context, CustomFieldInfo field, Type attributeFilterType) 123public static object[] GetCustomAttributes(CustomReflectionContext context, CustomParameterInfo parameter, Type attributeFilterType) 131public static bool IsDefined(ICustomAttributeProvider provider, Type attributeType, bool inherit) 137private static IEnumerable<object> GetFilteredAttributes(CustomReflectionContext context, MemberInfo member, Type attributeFilterType) 144private static IEnumerable<object> GetFilteredAttributes(CustomReflectionContext context, ParameterInfo parameter, Type attributeFilterType) 151private static void CombineCustomAttributes(List<object> declaredAttributes, IEnumerable<object> inheritedAttributes, Type attributeFilterType, bool inherited, bool allowMultiple) 158Type attributeType = newAttribute.GetType(); 177private static void GetAttributeUsage(Type attributeFilterType, out bool inherited, out bool allowMultiple) 197internal static IEnumerable<object> FilterCustomAttributes(IEnumerable<object> attributes, Type attributeFilterType)
System\Reflection\Context\Custom\CustomConstructorInfo.cs (2)
25public override object[] GetCustomAttributes(Type attributeType, bool inherit) 30public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Custom\CustomEventInfo.cs (2)
25public override object[] GetCustomAttributes(Type attributeType, bool inherit) 30public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Custom\CustomFieldInfo.cs (2)
25public override object[] GetCustomAttributes(Type attributeType, bool inherit) 30public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Custom\CustomMethodInfo.cs (2)
25public override object[] GetCustomAttributes(Type attributeType, bool inherit) 30public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Custom\CustomParameterInfo.cs (2)
25public override object[] GetCustomAttributes(Type attributeType, bool inherit) 30public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Custom\CustomPropertyInfo.cs (2)
25public override object[] GetCustomAttributes(Type attributeType, bool inherit) 30public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Custom\CustomType.cs (10)
16public CustomType(Type template, CustomReflectionContext context) 31public override object[] GetCustomAttributes(Type attributeType, bool inherit) 36public override bool IsDefined(Type attributeType, bool inherit) 43Type objectType = ReflectionContext.GetTypeForObject(o!); 85protected override PropertyInfo? GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) 137binder ??= Type.DefaultBinder; 184protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 272Type? declaringType = match.DeclaringType; 279binder ??= Type.DefaultBinder;
System\Reflection\Context\CustomReflectionContext.cs (5)
65protected virtual IEnumerable<PropertyInfo> AddProperties(Type type) 72Type propertyType, 89Type propertyType, 136internal IEnumerable<object> GetCustomAttributesOnMember(MemberInfo member, IEnumerable<object> declaredAttributes, Type attributeFilterType) 142internal IEnumerable<object> GetCustomAttributesOnParameter(ParameterInfo parameter, IEnumerable<object> declaredAttributes, Type attributeFilterType)
System\Reflection\Context\CustomReflectionContext.Projector.cs (3)
50public override TypeInfo? ProjectType(Type? value) 231output = ProjectType((Type)value); 263Type? argumentType = ProjectType(value.ArgumentType);
System\Reflection\Context\Delegation\DelegatingAssembly.cs (6)
45public override object[] GetCustomAttributes(Type attributeType, bool inherit) 60public override bool IsDefined(Type attributeType, bool inherit) 108public override Type[] GetExportedTypes() 153public override Stream? GetManifestResourceStream(Type type, string name) 193public override Type? GetType(string name, bool throwOnError, bool ignoreCase) 198public override Type[] GetTypes()
System\Reflection\Context\Delegation\DelegatingConstructorInfo.cs (5)
34public override Type? DeclaringType 84public override Type? ReflectedType 91public override object[] GetCustomAttributes(Type attributeType, bool inherit) 106public override Type[] GetGenericArguments() 136public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Delegation\DelegatingEventInfo.cs (5)
23public override Type? DeclaringType 28public override Type? EventHandlerType 53public override Type? ReflectedType 85public override object[] GetCustomAttributes(Type attributeType, bool inherit) 100public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Delegation\DelegatingExceptionHandlingClause.cs (1)
19public override Type? CatchType
System\Reflection\Context\Delegation\DelegatingFieldInfo.cs (7)
24public override Type? DeclaringType 34public override Type FieldType 69public override Type? ReflectedType 76public override object[] GetCustomAttributes(Type attributeType, bool inherit) 91public override Type[] GetOptionalCustomModifiers() 101public override Type[] GetRequiredCustomModifiers() 116public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Delegation\DelegatingLocalVariableInfo.cs (1)
27public override Type LocalType
System\Reflection\Context\Delegation\DelegatingMethodInfo.cs (9)
36public override Type? DeclaringType 86public override Type? ReflectedType 101public override Type ReturnType 113public override object[] GetCustomAttributes(Type attributeType, bool inherit) 128public override Type[] GetGenericArguments() 158public override bool IsDefined(Type attributeType, bool inherit) 164public override MethodInfo MakeGenericMethod(params Type[] typeArguments) 169public override Delegate CreateDelegate(Type delegateType) 174public override Delegate CreateDelegate(Type delegateType, object? target)
System\Reflection\Context\Delegation\DelegatingModule.cs (15)
64public override Type[] FindTypes(TypeFilter? filter, object? filterCriteria) 74public override object[] GetCustomAttributes(Type attributeType, bool inherit) 94protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 119public override Type? GetType(string className, bool throwOnError, bool ignoreCase) 124public override Type[] GetTypes() 129public override bool IsDefined(Type attributeType, bool inherit) 139public override FieldInfo? ResolveField(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 144public override MemberInfo? ResolveMember(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 149public override MethodBase? ResolveMethod(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 164public override Type ResolveType(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
System\Reflection\Context\Delegation\DelegatingParameterInfo.cs (5)
43public override Type ParameterType 60public override object[] GetCustomAttributes(Type attributeType, bool inherit) 75public override Type[] GetOptionalCustomModifiers() 80public override Type[] GetRequiredCustomModifiers() 85public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Delegation\DelegatingPropertyInfo.cs (7)
34public override Type? DeclaringType 54public override Type PropertyType 59public override Type? ReflectedType 106public override object[] GetCustomAttributes(Type attributeType, bool inherit) 131public override Type[] GetOptionalCustomModifiers() 136public override Type[] GetRequiredCustomModifiers() 141public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Delegation\DelegatingType.cs (32)
16public DelegatingType(Type type) 37public override Type? BaseType 57public override Type? DeclaringType 140public override Type? ReflectedType 155public override Type UnderlyingSystemType 160public Type UnderlyingType 195public override Type GetEnumUnderlyingType() 200public override object[] GetCustomAttributes(Type attributeType, bool inherit) 220public override Type[] GetGenericArguments() 225public override Type[] GetGenericParameterConstraints() 230public override Type GetGenericTypeDefinition() 235public override InterfaceMapping GetInterfaceMap(Type interfaceType) 247return Type.GetTypeCode(_typeInfo); 250public override bool IsAssignableFrom([NotNullWhen(true)] Type? c) 260public override bool IsDefined(Type attributeType, bool inherit) 270public override bool IsEquivalentTo([NotNullWhen(true)] Type? other) 288public override bool IsSubclassOf(Type c) 303protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 313public override Type? GetElementType() 338public override Type? GetInterface(string name, bool ignoreCase) 343public override Type[] GetInterfaces() 353protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 366public override Type? GetNestedType(string name, BindingFlags bindingAttr) 371public override Type[] GetNestedTypes(BindingFlags bindingAttr) 381protected override PropertyInfo? GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) 446public override Type MakeArrayType() 451public override Type MakeArrayType(int rank) 456public override Type MakePointerType() 462public override Type MakeGenericType(params Type[] typeArguments) 467public override Type MakeByRefType()
System\Reflection\Context\Projection\ProjectingAssembly.cs (5)
30public override object[] GetCustomAttributes(Type attributeType, bool inherit) 42public override bool IsDefined(Type attributeType, bool inherit) 54public override Type[] GetExportedTypes() 89public override Type? GetType(string name, bool throwOnError, bool ignoreCase) 94public override Type[] GetTypes()
System\Reflection\Context\Projection\ProjectingConstructorInfo.cs (5)
23public override Type? DeclaringType 33public override Type? ReflectedType 38public override object[] GetCustomAttributes(Type attributeType, bool inherit) 50public override bool IsDefined(Type attributeType, bool inherit) 57public override Type[] GetGenericArguments()
System\Reflection\Context\Projection\ProjectingEventInfo.cs (5)
24public override Type? DeclaringType 29public override Type? EventHandlerType 38public override Type? ReflectedType 63public override object[] GetCustomAttributes(Type attributeType, bool inherit) 75public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Projection\ProjectingExceptionHandlingClause.cs (1)
22public override Type? CatchType
System\Reflection\Context\Projection\ProjectingFieldInfo.cs (7)
24public override Type? DeclaringType 29public override Type FieldType 39public override Type? ReflectedType 44public override object[] GetCustomAttributes(Type attributeType, bool inherit) 56public override bool IsDefined(Type attributeType, bool inherit) 63public override Type[] GetOptionalCustomModifiers() 68public override Type[] GetRequiredCustomModifiers()
System\Reflection\Context\Projection\ProjectingLocalVariableInfo.cs (1)
22public override Type LocalType
System\Reflection\Context\Projection\ProjectingMethodInfo.cs (9)
24public override Type? DeclaringType 34public override Type? ReflectedType 58public override Type ReturnType 68public override object[] GetCustomAttributes(Type attributeType, bool inherit) 80public override bool IsDefined(Type attributeType, bool inherit) 87public override Type[] GetGenericArguments() 108public override MethodInfo MakeGenericMethod(params Type[] typeArguments) 113public override Delegate CreateDelegate(Type delegateType) 118public override Delegate CreateDelegate(Type delegateType, object? target)
System\Reflection\Context\Projection\ProjectingModule.cs (14)
29public override object[] GetCustomAttributes(Type attributeType, bool inherit) 41public override bool IsDefined(Type attributeType, bool inherit) 58protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 69public override Type? GetType(string className, bool throwOnError, bool ignoreCase) 74public override Type[] GetTypes() 79public override FieldInfo? ResolveField(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 87public override MemberInfo? ResolveMember(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 95public override MethodBase? ResolveMethod(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) 103public override Type ResolveType(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
System\Reflection\Context\Projection\ProjectingParameterInfo.cs (5)
29public override Type ParameterType 34public override object[] GetCustomAttributes(Type attributeType, bool inherit) 46public override bool IsDefined(Type attributeType, bool inherit) 53public override Type[] GetOptionalCustomModifiers() 58public override Type[] GetRequiredCustomModifiers()
System\Reflection\Context\Projection\ProjectingPropertyInfo.cs (7)
24public override Type? DeclaringType 34public override Type PropertyType 39public override Type? ReflectedType 64public override object[] GetCustomAttributes(Type attributeType, bool inherit) 76public override bool IsDefined(Type attributeType, bool inherit) 83public override Type[] GetOptionalCustomModifiers() 88public override Type[] GetRequiredCustomModifiers()
System\Reflection\Context\Projection\ProjectingType.cs (31)
16public ProjectingType(Type type, Projector projector) 34public override Type? BaseType 44public override Type? DeclaringType 54public override Type? ReflectedType 64public override Type GetEnumUnderlyingType() 69public override object[] GetCustomAttributes(Type attributeType, bool inherit) 86public override Type[] GetGenericArguments() 91public override Type[] GetGenericParameterConstraints() 96public override Type GetGenericTypeDefinition() 101public override InterfaceMapping GetInterfaceMap(Type interfaceType) 138public override bool IsAssignableFrom([NotNullWhen(true)] Type? c) 147public override bool IsDefined(Type attributeType, bool inherit) 154public override bool IsEquivalentTo([NotNullWhen(true)] Type? other) 165Type? objectType = _projector.ProjectType(o?.GetType()); 173public override bool IsSubclassOf(Type c) 182protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 194public override Type? GetElementType() 219public override Type? GetInterface(string name, bool ignoreCase) 224public override Type[] GetInterfaces() 236Type[] nestedTypes = GetNestedTypes(bindingAttr); 260protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 272public override Type? GetNestedType(string name, BindingFlags bindingAttr) 277public override Type[] GetNestedTypes(BindingFlags bindingAttr) 287protected override PropertyInfo? GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) 295public override Type MakeArrayType() 300public override Type MakeArrayType(int rank) 305public override Type MakePointerType() 311public override Type MakeGenericType(params Type[] typeArguments) 318public override Type MakeByRefType()
System\Reflection\Context\Projection\Projector.cs (7)
46public abstract TypeInfo? ProjectType(Type? value); 82public static Type[]? Unproject(Type[]? values) 87Type[] newTypes = new Type[values.Length]; 97public static Type? Unproject(Type? value)
System\Reflection\Context\Virtual\InheritedMethodInfo.cs (3)
13private readonly Type _reflectedType; 15public InheritedMethodInfo(MethodInfo baseMethod, Type reflectedType) 28public override Type ReflectedType
System\Reflection\Context\Virtual\InheritedPropertyInfo.cs (3)
13private readonly Type _reflectedType; 15public InheritedPropertyInfo(PropertyInfo baseProperty, Type reflectedType) 28public override Type ReflectedType
System\Reflection\Context\Virtual\VirtualMethodBase.cs (9)
14protected abstract Type[] GetParameterTypes(); 51public sealed override Type? ReflectedType 71public sealed override Type[] GetGenericArguments() 73return CollectionServices.Empty<Type>(); 92public sealed override MethodInfo MakeGenericMethod(params Type[] typeArguments) 97public override object[] GetCustomAttributes(Type attributeType, bool inherit) 112public override bool IsDefined(Type attributeType, bool inherit) 143Type[] parameterTypes = GetParameterTypes(); 147foreach (Type t in parameterTypes)
System\Reflection\Context\Virtual\VirtualParameter.cs (1)
11public VirtualParameter(MemberInfo member, Type parameterType, string? name, int position)
System\Reflection\Context\Virtual\VirtualPropertyBase.cs (13)
14private readonly Type _propertyType; 15private Type? _declaringType; 18protected VirtualPropertyBase(Type propertyType, string name, CustomReflectionContext context) 43public sealed override Type? DeclaringType 53public sealed override Type PropertyType 78public sealed override Type? ReflectedType 147public sealed override Type[] GetOptionalCustomModifiers() 149return CollectionServices.Empty<Type>(); 152public sealed override Type[] GetRequiredCustomModifiers() 154return CollectionServices.Empty<Type>(); 157public override object[] GetCustomAttributes(Type attributeType, bool inherit) 172public override bool IsDefined(Type attributeType, bool inherit) 201internal void SetDeclaringType(Type declaringType)
System\Reflection\Context\Virtual\VirtualPropertyBase.FuncPropertyAccessorBase.cs (1)
29public sealed override Type? DeclaringType
System\Reflection\Context\Virtual\VirtualPropertyBase.PropertyGetterBase.cs (3)
20public sealed override Type ReturnType 25protected override Type[] GetParameterTypes() 27return CollectionServices.Empty<Type>();
System\Reflection\Context\Virtual\VirtualPropertyBase.PropertySetterBase.cs (4)
10private Type[]? _parameterTypes; 22public sealed override Type ReturnType 27protected override Type[] GetParameterTypes() 29return _parameterTypes ??= new Type[1] { DeclaringProperty.PropertyType };
System\Reflection\Context\Virtual\VirtualPropertyInfo.cs (3)
19Type propertyType, 58public override object[] GetCustomAttributes(Type attributeType, bool inherit) 73public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertyGetter.cs (2)
40public override object[] GetCustomAttributes(Type attributeType, bool inherit) 55public override bool IsDefined(Type attributeType, bool inherit)
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertySetter.cs (2)
57public override object[] GetCustomAttributes(Type attributeType, bool inherit) 72public override bool IsDefined(Type attributeType, bool inherit)
System.Reflection.DispatchProxy (52)
src\libraries\Common\src\System\Reflection\Emit\IgnoreAccessChecksToAttributeBuilder.cs (1)
35new Type[] { assemblyNameField.FieldType });
System\Reflection\DispatchProxy.cs (2)
58public static object Create([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type proxyType)
System\Reflection\DispatchProxyGenerator.cs (49)
52private static readonly MethodInfo s_getTypeFromHandleMethod = typeof(Type).GetMethod("GetTypeFromHandle", new Type[] { typeof(RuntimeTypeHandle) })!; 59typeof(MethodInfo).GetMethod("MakeGenericMethod", new Type[] { typeof(Type[]) })!; 64[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type baseType, 65[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType, 82[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type generatedType, 90public Type GeneratedType { get; } 109private readonly Dictionary<Type, Dictionary<Type, GeneratedTypeInfo>> _baseTypeAndInterfaceToGeneratedProxyType = new Dictionary<Type, Dictionary<Type, GeneratedTypeInfo>>(); 145[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type baseType, 146[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType, 151if (!_baseTypeAndInterfaceToGeneratedProxyType.TryGetValue(baseType, out Dictionary<Type, GeneratedTypeInfo>? interfaceToProxy)) 153interfaceToProxy = new Dictionary<Type, GeneratedTypeInfo>(); 171[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type baseType, 172[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType, 197if (baseType.GetConstructor(Type.EmptyTypes) == null) 205foreach (Type t in interfaceType.GetInterfaces()) 221[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type proxyBaseType) 244internal void EnsureTypeIsVisible(Type type) 262private readonly Type _proxyBaseType; 269[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type proxyBaseType) 285Type[] args = new Type[_fields.Count]; 295ConstructorInfo baseCtor = _proxyBaseType.GetConstructor(Type.EmptyTypes)!; 318internal void AddInterfaceImpl([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type iface) 419Type[] paramTypes = new Type[parameters.Length]; 420Type[][] paramReqMods = new Type[paramTypes.Length][]; 438Type[] ts = mi.GetGenericArguments(); 496Type[] genericTypes = mi.GetGenericArguments(); 497GenericArray<Type> typeArr = new GenericArray<Type>(il, genericTypes.Length); 503typeArr.EndSet(typeof(Type)); 553private static int GetTypeCode(Type type) => (int)Type.GetTypeCode(type); 621private static void Convert(ILGenerator il, Type source, Type target, bool isAddress) 630Type argType = source.GetElementType()!; 674private static void Ldind(ILGenerator il, Type type) 687private static void Stind(ILGenerator il, Type type) 703private readonly Type[] _paramTypes; 704internal ParametersArray(ILGenerator il, Type[] paramTypes) 720internal void EndSet(int i, Type stackType) 723Type argType = _paramTypes[i].GetElementType()!; 761internal void EndSet(Type stackType)
System.Reflection.Emit (375)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (10)
12internal static MethodInfo MakeGenericMethod(MethodInfo method, Type[] inst) 24private readonly Type[] _inst; 28internal MethodBuilderInstantiation(MethodInfo method, Type[] inst) 45public override Type? DeclaringType => _method.DeclaringType; 46public override Type? ReflectedType => _method.ReflectedType; 48public override object[] GetCustomAttributes(Type attributeType, bool inherit) { return _method.GetCustomAttributes(attributeType, inherit); } 49public override bool IsDefined(Type attributeType, bool inherit) { return _method.IsDefined(attributeType, inherit); } 63public override Type[] GetGenericArguments() { return _inst; } 89public override MethodInfo MakeGenericMethod(params Type[] arguments) 99public override Type ReturnType => _method.ReturnType;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (26)
24internal Type _baseType = null!; 43internal static Type? FormCompoundType(string? format, Type baseType, int curIndex) 215internal SymbolType(Type baseType, TypeKind typeKind) 264public override Type MakePointerType() 269public override Type MakeByRefType() 275public override Type MakeArrayType() 281public override Type MakeArrayType(int rank) 322Type baseType; 333Type baseType; 347Type baseType; 368public override Type BaseType => typeof(Array); 372CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 385CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 410public override Type GetInterface(string name, bool ignoreCase) 416public override Type[] GetInterfaces() 435Type? returnType, Type[]? types, ParameterModifier[]? modifiers) 447public override Type[] GetNestedTypes(BindingFlags bindingAttr) 453public override Type GetNestedType(string name, BindingFlags bindingAttr) 477public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) 491Type baseType; 528public override Type? GetElementType() 538public override Type UnderlyingSystemType => this; 545public override object[] GetCustomAttributes(Type attributeType, bool inherit) 550public override bool IsDefined(Type attributeType, bool inherit)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (8)
236internal static string? ToString(Type type, Format format) 249private void AddElementType(Type type) 266private void AddAssemblyQualifiedName(Type type, Format format) 268Type rootType = type; 274var nestings = new List<Type>(); 275for (Type? t = rootType; t != null; t = t.IsGenericParameter ? null : t.DeclaringType) 280Type enclosingType = nestings[i]; 292Type[] genericArguments = rootType.GetGenericArguments();
System\Reflection\Emit\ArrayMethod.cs (14)
12private readonly Type _containingType; 15private readonly Type _returnType; 16private readonly Type[] _parameterTypes; 21internal ArrayMethod(ModuleBuilderImpl module, Type arrayClass, string methodName, 22CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes) 27_parameterTypes = new Type[parameterTypes.Length]; 35_parameterTypes = Type.EmptyTypes; 46internal Type[] ParameterTypes => _parameterTypes; 52public override Type? ReflectedType => _containingType; 56public override Type? DeclaringType => _containingType; 72public override Type ReturnType => _returnType; 85public override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_SymbolMethod); 87public override bool IsDefined(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_SymbolMethod);
System\Reflection\Emit\ConstructorBuilderImpl.cs (7)
13public ConstructorBuilderImpl(string name, MethodAttributes attributes, CallingConventions callingConvention, Type[]? parameterTypes, 14Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers, ModuleBuilderImpl module, TypeBuilderImpl type) 64public override Type DeclaringType => _methodBuilder.DeclaringType!; 70public override Type? ReflectedType => _methodBuilder.ReflectedType; 76public override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_DynamicModule); 82public override bool IsDefined(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_DynamicModule);
System\Reflection\Emit\CustomAttributeWrapper.cs (4)
83Type fieldType = dataType == EnumType ? typeof(int) : ElementTypeToType((SerializationTypeCode)dataType); 121private static object? DecodeCustomAttributeValue(Type t, ReadOnlySpan<byte> data, int pos, out int rpos) 123switch (Type.GetTypeCode(t)) 157private static Type ElementTypeToType(SerializationTypeCode elementType) =>
System\Reflection\Emit\EnumBuilderImpl.cs (19)
14internal EnumBuilderImpl(string name, Type underlyingType, TypeAttributes visibility, ModuleBuilderImpl module) 60public override Type? BaseType => _typeBuilder.BaseType; 70public override Type? DeclaringType => _typeBuilder.DeclaringType; 72public override Type? ReflectedType => _typeBuilder.ReflectedType; 74public override Type UnderlyingSystemType => this; 76public override Type GetEnumUnderlyingType() => _underlyingField.FieldType; 90public override Type? GetElementType() => _typeBuilder.GetElementType(); 97public override Type[] GetInterfaces() => EmptyTypes; 99public override bool IsDefined(Type attributeType, bool inherit) => throw new NotImplementedException(); 101public override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new NotImplementedException(); 110CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) => throw new NotSupportedException(); 123CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => throw new NotSupportedException(); 130public override Type? GetInterface(string name, bool ignoreCase) => throw new NotSupportedException(); 135Type? returnType, Type[]? types, ParameterModifier[]? modifiers) => throw new NotSupportedException(); 137public override Type[] GetNestedTypes(BindingFlags bindingAttr) => throw new NotSupportedException(); 139public override Type? GetNestedType(string name, BindingFlags bindingAttr) => throw new NotSupportedException(); 142public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) 146public override bool IsAssignableFrom([NotNullWhen(true)] Type? c) => throw new NotSupportedException();
System\Reflection\Emit\EventBuilderImpl.cs (3)
14private readonly Type _eventType; 23public EventBuilderImpl(string name, EventAttributes attributes, Type eventType, TypeBuilderImpl typeBuilder) 33internal Type EventType => _eventType;
System\Reflection\Emit\FieldBuilderImpl.cs (15)
17private readonly Type _fieldType; 18private readonly Type[]? _requiredCustomModifiers; 19private readonly Type[]? _optionalCustomModifiers; 29internal FieldBuilderImpl(TypeBuilderImpl typeBuilder, string fieldName, Type type, FieldAttributes attributes, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers) 95public override Type? DeclaringType => _typeBuilder._isHiddenGlobalType ? null : _typeBuilder; 97public override Type? ReflectedType => DeclaringType; 102public override Type FieldType => _fieldType; 112public override Type[] GetRequiredCustomModifiers() => _requiredCustomModifiers ?? Type.EmptyTypes; 114public override Type[] GetOptionalCustomModifiers() => _optionalCustomModifiers ?? Type.EmptyTypes; 121public override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_DynamicModule); 123public override bool IsDefined(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_DynamicModule);
System\Reflection\Emit\GenericTypeParameterBuilderImpl.cs (25)
18private Type? _parent; 21internal List<Type>? _interfaces; 40protected override void SetBaseTypeConstraintCore([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? baseTypeConstraint) 46_interfaces ??= new List<Type>(); 60protected override void SetInterfaceConstraintsCore(params Type[]? interfaceConstraints) 64_interfaces ??= new List<Type>(interfaceConstraints.Length); 69public override Type[] GetGenericParameterConstraints() => 81public override Type UnderlyingSystemType => this; 88public override Type? BaseType => _parent; 98public override Type? GetElementType() => null; 100public override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new NotSupportedException(); 101public override bool IsDefined(Type attributeType, bool inherit) => throw new NotSupportedException(); 103protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) => throw new NotSupportedException(); 107protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => throw new NotSupportedException(); 116public override Type GetInterface(string name, bool ignoreCase) => throw new NotSupportedException(); 118public override Type[] GetInterfaces() => throw new NotSupportedException(); 124protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) => throw new NotSupportedException(); 128public override Type[] GetNestedTypes(BindingFlags bindingAttr) => throw new NotSupportedException(); 130public override Type GetNestedType(string name, BindingFlags bindingAttr) => throw new NotSupportedException(); 133public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) => throw new NotSupportedException(); 144public override Type MakePointerType() => 147public override Type MakeByRefType() => 151public override Type MakeArrayType() => 155public override Type MakeArrayType(int rank) =>
System\Reflection\Emit\ILGeneratorImpl.cs (17)
86public override void BeginCatchBlock(Type? exceptionType) 243public override LocalBuilder DeclareLocal(Type localType, bool pinned) 613public override void Emit(OpCode opcode, Type cls) 621public override void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[]? optionalParameterTypes) 639new KeyValuePair<MethodInfo, Type[]>(methodInfo, optionalParameterTypes)); 643private static int GetStackChange(OpCode opcode, MethodInfo methodInfo, Type voidType, Type[]? optionalParameterTypes) 684Type? returnType, Type[]? parameterTypes, Type[]? optionalParameterTypes) 713public override void EmitCalli(OpCode opcode, CallingConvention unmanagedCallConv, Type? returnType, Type[]? parameterTypes) 721private static int GetStackChange(Type? returnType, Type voidType, Type[]? parameterTypes) 869public Type? ExceptionType; 878Type? catchType = null)
System\Reflection\Emit\LocalBuilderImpl.cs (3)
10private readonly Type _localType; 17internal LocalBuilderImpl(int index, Type type, MethodInfo method, bool isPinned) 45public override Type LocalType => _localType;
System\Reflection\Emit\MethodBuilderImpl.cs (29)
16private Type _returnType; 17internal Type[]? _parameterTypes; 27internal Type[]? _returnTypeRequiredModifiers; 28internal Type[]? _returnTypeOptionalCustomModifiers; 29internal Type[][]? _parameterTypeRequiredCustomModifiers; 30internal Type[][]? _parameterTypeOptionalCustomModifiers; 39Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, 40Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers, 67_parameterTypes = new Type[parameterTypes.Length]; 86internal Type[]? ParameterTypes => _parameterTypes; 217protected override void SetSignatureCore(Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, Type[]? parameterTypes, 218Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers) 229_parameterTypes = new Type[parameterTypes.Length]; 244public override Type? DeclaringType => _declaringType._isHiddenGlobalType ? null : _declaringType; 254public override Type? ReflectedType => DeclaringType; 270public override Type ReturnType => _returnType; 277public override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_DynamicModule); 279public override Type[] GetGenericArguments() => _typeParameters ?? Type.EmptyTypes; 318public override bool IsDefined(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_DynamicModule); 322public override MethodInfo MakeGenericMethod(params Type[] typeArguments) =>
System\Reflection\Emit\ModuleBuilderImpl.cs (56)
23private readonly Dictionary<Type, EntityHandle> _typeReferences = new(); 38private Type?[]? _coreTypes; 41private static readonly Type[] s_coreTypes = { typeof(void), typeof(object), typeof(bool), typeof(char), typeof(sbyte), 57internal Type GetTypeFromCoreAssembly(CoreTypeId typeId) 69_coreTypes = new Type[s_coreTypes.Length]; 78internal CoreTypeId? GetTypeIdFromCoreTypes(Type type) 90_coreTypes = new Type[s_coreTypes.Length]; 207foreach (Type iface in typeBuilder._interfaces) 373Type[] gParams = method.GetGenericArguments(); 618if (pair.Key is KeyValuePair<MethodInfo, Type[]> pair2) 691private EntityHandle GetTypeReferenceOrSpecificationHandle(Type type) 718private TypeSpecificationHandle AddTypeSpecification(Type type) => 722private MethodSpecificationHandle AddMethodSpecification(EntityHandle methodHandle, Type[] genericArgs) => 736Type declaringType = field.DeclaringType!; 743Type fieldType = ((FieldInfo)GetOriginalMemberIfConstructedType(field)).FieldType; 778private EntityHandle GetMethodReference(MethodInfo methodInfo, Type[] optionalParameterTypes) 793private BlobBuilder GetMethodSignature(MethodInfo method, Type[]? optionalParameterTypes) => 817Type declaringType = memberInfo.DeclaringType!; 828private static Type[] ParameterTypes(ParameterInfo[] parameterInfos) 832return Type.EmptyTypes; 835Type[] parameterTypes = new Type[parameterInfos.Length]; 878foreach (Type constraint in gParam.GetGenericParameterConstraints()) 888Type type = defaultValue.GetType(); 996internal EntityHandle GetTypeHandle(Type type) 1027if (member is Type type) 1055internal TypeBuilder DefineNestedType(string name, TypeAttributes attr, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, 1056Type[]? interfaces, PackingSize packingSize, int typesize, TypeBuilderImpl? enclosingType) 1068public override bool IsDefined(Type attributeType, bool inherit) => throw new NotImplementedException(); 1102private bool IsConstructedFromTypeBuilder(Type type) 1112Type elementType = type.GetElementType()!; 1119internal bool ContainsTypeBuilder(Type[] genericArguments) 1121foreach (Type type in genericArguments) 1137internal EntityHandle TryGetTypeHandle(Type type) 1193internal EntityHandle TryGetMethodHandle(MethodInfo method, Type[] optionalParameterTypes) 1231public override int GetTypeMetadataToken(Type type) => GetTokenForHandle(TryGetTypeHandle(type)); 1244protected override EnumBuilder DefineEnumCore(string name, TypeAttributes visibility, Type underlyingType) 1252Type? returnType, Type[]? requiredReturnTypeCustomModifiers, Type[]? optionalReturnTypeCustomModifiers, Type[]? parameterTypes, 1253Type[][]? requiredParameterTypeCustomModifiers, Type[][]? optionalParameterTypeCustomModifiers) 1286CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet) 1301[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, Type[]? interfaces, PackingSize packingSize, int typesize) 1320protected override MethodInfo GetArrayMethodCore(Type arrayClass, string methodName, 1321CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes) 1344CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 1363internal int GetSignatureToken(CallingConventions callingConventions, Type? returnType, Type[]? parameterTypes, Type[]? optionalParameterTypes) => 1368internal int GetSignatureToken(CallingConvention callingConvention, Type? returnType, Type[]? parameterTypes) =>
System\Reflection\Emit\ParameterBuilderImpl.cs (3)
71private readonly Type _type 73public ParameterInfoWrapper(ParameterBuilderImpl pb, Type type) 85public override Type ParameterType => _type;
System\Reflection\Emit\PropertyBuilderImpl.cs (18)
14private readonly Type _propertyType; 15private readonly Type[]? _parameterTypes; 21internal readonly Type[]? _returnTypeRequiredCustomModifiers; 22internal readonly Type[]? _returnTypeOptionalCustomModifiers; 23internal readonly Type[][]? _parameterTypeRequiredCustomModifiers; 24internal readonly Type[][]? _parameterTypeOptionalCustomModifiers; 29internal PropertyBuilderImpl(string name, PropertyAttributes attributes, CallingConventions callingConvention, Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers, TypeBuilderImpl containingType) 45internal Type[]? ParameterTypes => _parameterTypes; 95public override Type PropertyType => _propertyType; 105public override Type? DeclaringType => _containingType; 107public override Type? ReflectedType => _containingType; 149public override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_DynamicModule); 151public override bool IsDefined(Type attributeType, bool inherit) => throw new NotSupportedException(SR.NotSupported_DynamicModule);
System\Reflection\Emit\SignatureHelper.cs (25)
27internal static BlobBuilder GetFieldSignature(Type fieldType, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, ModuleBuilderImpl module) 54internal static BlobBuilder GetTypeSpecificationSignature(Type type, ModuleBuilderImpl module) 62internal static BlobBuilder GetMethodSpecificationSignature(Type[] genericArguments, ModuleBuilderImpl module) 67foreach (Type argument in genericArguments) 75internal static BlobBuilder GetMethodSignature(ModuleBuilderImpl module, Type[]? parameters, Type? returnType, SignatureCallingConvention convention, 76int genParamCount = 0, bool isInstance = false, Type[]? optionalParameterTypes = null, Type[]? returnTypeRequiredModifiers = null, 77Type[]? returnTypeOptionalModifiers = null, Type[][]? parameterRequiredModifiers = null, Type[][]? parameterOptionalModifiers = null) 108Type[]? requiredModifiers, Type[]? optionalModifiers, ModuleBuilderImpl module) 121private static void WriteCustomModifiers(CustomModifiersEncoder encoder, Type[] customModifiers, bool isOptional, ModuleBuilderImpl module) 123foreach (Type modifier in customModifiers) 129private static void WriteParametersSignature(ModuleBuilderImpl module, Type[]? parameters, 130ParametersEncoder parameterEncoder, Type[][]? requiredModifiers = null, Type[][]? optionalModifiers = null) 168private static void WriteSignatureForType(SignatureTypeEncoder signature, Type type, ModuleBuilderImpl module) 172Type elementType = type.GetElementType()!; 196Type[] genericArguments = type.GetGenericArguments(); 200foreach (Type gType in genericArguments) 230private static void WriteSimpleSignature(SignatureTypeEncoder signature, Type type, ModuleBuilderImpl module)
System\Reflection\Emit\TypeBuilderImpl.cs (93)
20private Type? _typeParent; 26private Type? _enumUnderlyingType; 38internal List<Type>? _interfaces; 42internal Dictionary<Type, List<(MethodInfo ifaceMethod, MethodInfo targetMethod)>>? _methodOverrides; 54[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, ModuleBuilderImpl module, 55Type[]? interfaces, PackingSize packingSize, int typeSize, TypeBuilderImpl? enclosingType) 75_interfaces = new List<Type>(interfaces.Length); 78Type @interface = interfaces[i]; 90protected override void AddInterfaceImplementationCore([DynamicallyAccessedMembers((DynamicallyAccessedMemberTypes.All))] Type interfaceType) 94_interfaces ??= new List<Type>(); 172Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers) 243protected override EventBuilder DefineEventCore(string name, EventAttributes attributes, Type eventtype) 253protected override FieldBuilder DefineFieldCore(string fieldName, Type type, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers, FieldAttributes attributes) 303Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, Type[]? parameterTypes, 304Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers) 322Type baseType = methodInfoDeclaration.DeclaringType!; 342private bool IsInterfaceImplemented(Type interfaceType) 346foreach (Type iface in _interfaces) 357foreach (Type @interface in _typeParent.GetInterfaces()) 373[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, Type[]? interfaces, PackingSize packSize, int typeSize) 380CallingConventions callingConvention, Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, Type[]? parameterTypes, 381Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers, CallingConvention nativeCallConv, CharSet nativeCharSet) 410Type? returnType, Type[]? returnTypeRequiredCustomModifiers, Type[]? returnTypeOptionalCustomModifiers, Type[]? parameterTypes, 411Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers) 559protected override void SetParentCore([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent) 591public override Type? DeclaringType => _declaringType; 592public override Type? ReflectedType => _declaringType; 597public override Type[] GenericTypeParameters => _typeParameters ?? EmptyTypes; 598public override Type[] GetGenericArguments() => _typeParameters ?? EmptyTypes; 599public override Type GetGenericTypeDefinition() 608public override bool IsDefined(Type attributeType, bool inherit) => throw new NotImplementedException(); 610public override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new NotImplementedException(); 612public override Type GetElementType() => throw new NotSupportedException(SR.NotSupported_DynamicModule); 618public override Type UnderlyingSystemType => this; 620public override Type GetEnumUnderlyingType() 638public override Type? BaseType => _typeParent; 668CallingConventions callConvention, Type[] types, ParameterModifier[]? _) 698private static bool MatchesTheFilter(MethodBuilderImpl method, BindingFlags methodFlags, BindingFlags bindingFlags, CallingConventions callConv, Type[]? argumentTypes) 724Type[] parameterTypes = method.ParameterTypes ?? EmptyTypes; 732Type? argType = argumentTypes[i]; 733Type? paramType = parameterTypes[i]; 841CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 961public override Type? GetInterface(string name, bool ignoreCase) 966Type[] interfaces = GetInterfaces(); 968Type? match = null; 972Type interfaceType = interfaces[i]; 990public override Type[] GetInterfaces() 994List<Type> interfaces = _interfaces ?? []; 1066Type? returnType, Type[]? types, ParameterModifier[]? modifiers) 1102private List<PropertyInfo> GetPropertyCandidates(string name, BindingFlags bindingAttr, Type[]? types) 1128private Type[] GetNestedTypes(string name, BindingFlags bindingAttr) 1133Type[] candidates = GetNestedTypes(bindingAttr); 1134List<Type> nestedTypes = new List<Type>(); 1136foreach (Type type in candidates) 1148public override Type[] GetNestedTypes(BindingFlags bindingAttr) 1152List<Type> nestedTypes = new List<Type>(); 1166public override Type? GetNestedType(string name, BindingFlags bindingAttr) 1170Type[] types = GetNestedTypes(bindingAttr); 1172Type? match = null; 1173foreach (Type type in types) 1199Type[] nestedTypes = []; 1273public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType) 1321private static Type[] GetParameterTypes(ParameterInfo[] parameterInfos) 1323Type[] parameterTypes = new Type[parameterInfos.Length]; 1331private void ValidateInterfaceType(Type interfaceType) 1359Type[] nestedTypes = GetNestedTypes(bindingAttr); 1385public override bool IsAssignableFrom([NotNullWhen(true)] Type? c) 1405Type[] interfaces = tb.GetInterfaces(); 1424internal static bool AreTypesEqual(Type t1, Type? t2) 1442public override bool IsSubclassOf(Type c) 1444Type? p = this;
System.Reflection.Metadata (8)
System\Reflection\Metadata\BlobWriterImpl.cs (2)
156var type = value.GetType(); 229var type = value.GetType();
System\Reflection\Metadata\Decoding\ICustomAttributeTypeProvider.cs (3)
9/// Gets the TType representation for <see cref="Type"/>. 14/// Returns true if the given type represents <see cref="Type"/>. 20/// The serialized type name is in so-called "reflection notation" (i.e. as understood by <see cref="Type.GetType(string)"/>.)
System\Reflection\Metadata\Ecma335\Encoding\BlobEncoders.cs (1)
611/// Encodes literal of type <see cref="Type"/> (possibly null).
System\Reflection\Metadata\TypeName.cs (2)
224/// Managed pointer types are sometimes called byref types (<seealso cref="Type.IsByRef"/>) 241/// Unmanaged pointer types are often just called pointers (<seealso cref="Type.IsPointer"/>)
System.Reflection.MetadataLoadContext (491)
System\CoreRtBridge.cs (3)
17internal static RoType CastToRuntimeTypeInfo(this Type t) => (RoType)t; 19internal static Type[] GetGenericTypeParameters(this Type t)
System\Reflection\DefaultBinder.CanConvert.cs (6)
10private static bool CanChangePrimitive(Type source, Type target) 15private static bool CanPrimitiveWiden(Type source, Type target) 17Primitives widerCodes = s_primitiveConversions[(int)(Type.GetTypeCode(source))]; 18Primitives targetCode = (Primitives)(1 << (int)(Type.GetTypeCode(target)));
System\Reflection\DefaultBinder.cs (30)
14private readonly Type? _objectType; 22private bool IsImplementedByMetadataLoadContext(Type type) => type is RoType roType && roType.Loader == _loader; 47public sealed override MethodBase? SelectMethod(BindingFlags bindingAttr, MethodBase[] match, Type[] types, ParameterModifier[]? modifiers) 52Type[] realTypes = new Type[types.Length]; 77Type pCls = par[j].ParameterType; 83Type? type = types[j]; 147public sealed override PropertyInfo? SelectProperty(BindingFlags bindingAttr, PropertyInfo[] match, Type? returnType, 148Type[]? indexes, ParameterModifier[]? modifiers) 153foreach (Type index in indexes) 180Type pCls = par[j].ParameterType; 268public override object ChangeType(object value, Type type, CultureInfo? cultureInfo) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection); 274public static MethodBase? ExactBinding(MethodBase[] match, Type[] types) 294Type pCls = par[j].ParameterType; 319public static PropertyInfo? ExactPropertyBinding(PropertyInfo[] match, Type? returnType, Type[]? types) 334Type pCls = par[j].ParameterType; 353private static int FindMostSpecific(ParameterInfo[] p1, int[] paramOrder1, Type? paramArrayType1, 354ParameterInfo[] p2, int[] paramOrder2, Type? paramArrayType2, 355Type[] types, object[]? args) 368if (args != null && args[i] == Type.Missing) 371Type c1, c2; 430private static int FindMostSpecificType(Type c1, Type c2, Type t) 504private static int FindMostSpecificMethod(MethodBase m1, int[] paramOrder1, Type? paramArrayType1, 505MethodBase m2, int[] paramOrder2, Type? paramArrayType2, 506Type[] types, object[]? args) 582private static int GetHierarchyDepth(Type t) 586Type? currentType = t;
System\Reflection\MetadataLoadContext.KnownConstructors.cs (3)
38Type? attributeType = TryGetCoreType(attributeCoreType); 41Type?[] parameterTypes = new Type[count];
System\Reflection\Runtime\BindingFlagSupport\MemberPolicies.cs (10)
97Type parameterType1 = p1[i].ParameterType; 98Type parameterType2 = p2[i].ParameterType; 111Type parameterType1 = p1[i].ParameterType; 112Type parameterType2 = p2[i].ParameterType; 126private static bool GenericMethodAwareAreParameterTypesEqual(Type t1, Type t2) 159Type[] ga1 = t1.GenericTypeArguments; 160Type[] ga2 = t2.GenericTypeArguments; 188Type t = typeof(M); 214else if (t.Equals(typeof(Type)))
System\Reflection\Runtime\BindingFlagSupport\NestedTypePolicies.cs (10)
19internal sealed class NestedTypePolicies : MemberPolicies<Type> 21public sealed override IEnumerable<Type> GetDeclaredMembers(TypeInfo typeInfo) 26public sealed override IEnumerable<Type> CoreGetDeclaredMembers(RuntimeTypeInfo type, NameFilter? filter, RuntimeTypeInfo reflectedType) 34public sealed override void GetMemberAttributes(Type member, out MethodAttributes visibility, out bool isStatic, out bool isVirtual, out bool isNewSlot) 45public sealed override bool ImplicitlyOverrides(Type? baseMember, Type? derivedMember) => false; 47public sealed override bool IsSuppressedByMoreDerivedMember(Type member, Type[] priorMembers, int startIndex, int endIndex) 59public sealed override bool OkToIgnoreAmbiguity(Type m1, Type m2)
System\Reflection\Runtime\BindingFlagSupport\Shared.cs (1)
23public static bool QualifiesBasedOnParameterCount(this MethodBase methodBase, BindingFlags bindingFlags, CallingConventions callConv, Type[] argumentTypes)
System\Reflection\Runtime\SignatureTypeExtensions.cs (26)
18public static bool MatchesParameterTypeExactly(this Type pattern, ParameterInfo parameter) 33internal static bool MatchesExactly(this Type pattern, Type actual) 59Type[] patternGenericTypeArguments = pattern.GenericTypeArguments; 60Type[] actualGenericTypeArguments = actual.GenericTypeArguments; 66Type patternGenericTypeArgument = patternGenericTypeArguments[i]; 105internal static Type? TryResolveAgainstGenericMethod(this Type signatureType, MethodInfo genericMethod) 111private static Type? TryResolve(this Type signatureType, Type[] genericMethodParameters) 133Type[] genericTypeArguments = signatureType.GenericTypeArguments; 135Type?[] newGenericTypeArguments = new Type[count]; 138Type genericTypeArgument = genericTypeArguments[i]; 165private static Type? TryMakeArrayType(this Type type) 177private static Type? TryMakeArrayType(this Type type, int rank) 189private static Type? TryMakeByRefType(this Type type) 201private static Type? TryMakePointerType(this Type type) 213private static Type? TryMakeGenericType(this Type type, Type[] instantiation)
System\Reflection\TypeLoading\Assemblies\RoAssembly.cs (10)
64public sealed override Type[] GetTypes() => IsSingleModule ? ManifestModule.GetTypes() : base.GetTypes(); 80public sealed override Type[] GetExportedTypes() 83List<Type> list = new List<Type>(ExportedTypes); 87public sealed override IEnumerable<Type> ExportedTypes 100public sealed override Type? GetType(string name, bool throwOnError, bool ignoreCase) 175public sealed override Stream? GetManifestResourceStream(Type type, string name) 190sb.Append(Type.Delimiter); 213public sealed override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_ReflectionOnlyCA); 214public sealed override bool IsDefined(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_ReflectionOnlyCA);
System\Reflection\TypeLoading\Assemblies\RoAssembly.GetForwardedTypes.cs (8)
14public sealed override Type[] GetForwardedTypes() 16List<Type> types = new List<Type>(); 22Type? type = null; 57types.AddRange(new Type[numExceptions]); // add one null Type for each exception. 65private static void AddPublicNestedTypes(Type type, List<Type> types) 67foreach (Type nestedType in type.GetNestedTypes(BindingFlags.Public))
System\Reflection\TypeLoading\Constructors\RoConstructor.cs (4)
19public sealed override Type DeclaringType => GetRoDeclaringType(); 22public sealed override Type ReflectedType => DeclaringType; 38public sealed override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection); 39public sealed override bool IsDefined(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection);
System\Reflection\TypeLoading\CustomAttributes\CustomAttributeHelpers.cs (4)
15public static CustomAttributeNamedArgument ToCustomAttributeNamedArgument(this Type attributeType, string name, Type? argumentType, object? value) 59Type type = cat.ArgumentType; 110Type attributeType = ci.DeclaringType!;
System\Reflection\TypeLoading\CustomAttributes\Ecma\EcmaCustomAttributeData.cs (3)
48protected sealed override Type ComputeAttributeType() 74Type[] parameterTypes = sig.ParameterTypes.ToArray(); 75Type declaringType = mr.Parent.ResolveTypeDefRefOrSpec(_module, typeContext);
System\Reflection\TypeLoading\CustomAttributes\Ecma\EcmaCustomAttributeHelpers.cs (3)
123private static CustomAttributeTypedArgument ToApiForm(Type type, object? value) 137public static IList<CustomAttributeNamedArgument> ToApiForm(this IList<CustomAttributeNamedArgument<RoType>> cangs, Type attributeType) 152public static CustomAttributeNamedArgument ToApiForm(this CustomAttributeNamedArgument<RoType> cang, Type attributeType)
System\Reflection\TypeLoading\CustomAttributes\RoCustomAttributeData.cs (3)
15public sealed override Type AttributeType => _lazyAttributeType ??= ComputeAttributeType()!; 16protected abstract Type? ComputeAttributeType(); 17private volatile Type? _lazyAttributeType;
System\Reflection\TypeLoading\CustomAttributes\RoPseudoCustomAttributeData.cs (1)
38protected sealed override Type? ComputeAttributeType() => _constructor.DeclaringType;
System\Reflection\TypeLoading\Events\Ecma\EcmaEvent.cs (2)
21internal EcmaEvent(RoInstantiationProviderType declaringType, EventDefinitionHandle handle, Type reflectedType) 61protected sealed override Type ComputeEventHandlerType() => EventDefinition.Type.ResolveTypeDefRefOrSpec(_module, TypeContext);
System\Reflection\TypeLoading\Events\RoEvent.cs (9)
15private readonly Type _reflectedType; 17protected RoEvent(RoInstantiationProviderType declaringType, Type reflectedType) 30public sealed override Type DeclaringType => GetRoDeclaringType(); 33public sealed override Type ReflectedType => _reflectedType; 53public sealed override Type EventHandlerType => _lazyEventType ??= ComputeEventHandlerType(); 54protected abstract Type ComputeEventHandlerType(); 55private volatile Type? _lazyEventType; 79public sealed override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection); 80public sealed override bool IsDefined(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection);
System\Reflection\TypeLoading\Fields\Ecma\EcmaField.cs (4)
20internal EcmaField(RoInstantiationProviderType declaringType, FieldDefinitionHandle handle, Type reflectedType) 63protected sealed override Type ComputeFieldType() => FieldDefinition.DecodeSignature(_module, TypeContext); 65public sealed override Type[] GetOptionalCustomModifiers() => ModifiedType.GetOptionalCustomModifiers(); 66public sealed override Type[] GetRequiredCustomModifiers() => ModifiedType.GetRequiredCustomModifiers();
System\Reflection\TypeLoading\Fields\RoField.cs (14)
17private readonly Type _reflectedType; 19protected RoField(RoInstantiationProviderType declaringType, Type reflectedType) 32public sealed override Type DeclaringType => GetRoDeclaringType(); 35public sealed override Type ReflectedType => _reflectedType; 61Type int32Type = Loader.GetCoreType(CoreType.Int32); // Since we got the constructor, we know the Int32 exists. 85public sealed override Type FieldType 104public sealed override Type GetModifiedFieldType() 113Type type = ComputeFieldType(); 126protected abstract Type ComputeFieldType(); 127private volatile Type? _lazyFieldType; 133public abstract override Type[] GetOptionalCustomModifiers(); 134public abstract override Type[] GetRequiredCustomModifiers(); 143public sealed override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection); 144public sealed override bool IsDefined(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection);
System\Reflection\TypeLoading\General\Assignability.cs (43)
11public static bool IsAssignableFrom(Type toTypeInfo, Type fromTypeInfo, CoreTypes coreTypes) 47Type nullableUnderlyingType = toTypeInfo.GenericTypeArguments[0]; 55private static bool CanCastTo(this Type fromTypeInfo, Type toTypeInfo, CoreTypes coreTypes) 86Type toElementTypeInfo = toTypeInfo.GetElementType()!; 87Type fromElementTypeInfo = fromTypeInfo.GetElementType()!; 96Type toElementTypeInfo = toTypeInfo.GetElementType()!; 97Type fromElementTypeInfo = fromTypeInfo.GetElementType()!; 112Type toElementTypeInfo = toTypeInfo.GetElementType()!; 113Type fromElementTypeInfo = fromTypeInfo.GetElementType()!; 135foreach (Type constraintType in fromTypeInfo.GetGenericParameterConstraints()) 152foreach (Type ifc in fromTypeInfo.GetInterfaces()) 165Type walk = fromTypeInfo; 168Type? baseType = walk.BaseType; 182private static bool MatchesWithVariance(this Type fromTypeInfo, Type toTypeInfo, CoreTypes coreTypes) 193Type genericTypeDefinition = fromTypeInfo.GetGenericTypeDefinition(); 197Type[] fromTypeArguments = fromTypeInfo.GenericTypeArguments; 198Type[] toTypeArguments = toTypeInfo.GenericTypeArguments; 199Type[] genericTypeParameters = genericTypeDefinition.GetGenericTypeParameters(); 202Type fromTypeArgumentInfo = fromTypeArguments[i]; 203Type toTypeArgumentInfo = toTypeArguments[i]; 240private static bool IsElementTypeCompatibleWith(this Type fromTypeInfo, Type toTypeInfo, CoreTypes coreTypes) 245Type reducedFromType = fromTypeInfo.ReducedType(coreTypes); 246Type reducedToType = toTypeInfo.ReducedType(coreTypes); 253private static Type ReducedType(this Type t, CoreTypes coreTypes) 278private static bool IsGcReferenceTypeAndCastableTo(this Type fromTypeInfo, Type toTypeInfo, CoreTypes coreTypes) 292private static bool ProvablyAGcReferenceType(this Type t, CoreTypes coreTypes) 304private static bool ProvablyAGcReferenceTypeHelper(this Type t, CoreTypes coreTypes) 318foreach (Type constraintType in t.GetGenericParameterConstraints()) 333private static bool CanCastArrayToInterface(this Type fromTypeInfo, Type toTypeInfo, CoreTypes coreTypes) 340Type[] toTypeGenericTypeArguments = toTypeInfo.GenericTypeArguments; 343Type toElementTypeInfo = toTypeGenericTypeArguments[0]; 345Type toTypeGenericTypeDefinition = toTypeInfo.GetGenericTypeDefinition(); 346Type? fromElementTypeInfo = fromTypeInfo.GetElementType(); 347foreach (Type ifc in fromTypeInfo.GetInterfaces()) 351Type ifcGenericTypeDefinition = ifc.GetGenericTypeDefinition(); 363foreach (Type ifc in fromTypeInfo.GetInterfaces())
System\Reflection\TypeLoading\General\Ecma\EcmaHelpers.cs (4)
59public static PrimitiveTypeCode GetEnumUnderlyingPrimitiveTypeCode(this Type enumType, MetadataLoadContext loader) 61Type type = enumType.GetEnumUnderlyingType(); 118public static RoMethod? ToMethodOrNull(this MethodDefinitionHandle handle, RoInstantiationProviderType declaringType, Type reflectedType) 126public static RoMethod ToMethod(this MethodDefinitionHandle handle, RoInstantiationProviderType declaringType, Type reflectedType)
System\Reflection\TypeLoading\General\Helpers.cs (10)
41public static Type[]? CloneArrayToUnmodifiedTypes(this Type[]? original) 47return Type.EmptyTypes; 49Type[] copy = new Type[original.Length]; 250Type[]? genericMethodArguments = typeContext.GenericMethodArguments; 311Func<Assembly?, string, bool, Type?> typeResolver = 321Type? type = roAssembly.GetTypeCore(ns, simpleName, ignoreCase: ignoreCase2, out Exception? e); 329return (RoType?)Type.GetType(name, assemblyResolver: assemblyResolver, typeResolver: typeResolver, throwOnError: throwOnError, ignoreCase: ignoreCase); 341public static bool IsVisibleOutsideAssembly(this Type type)
System\Reflection\TypeLoading\General\Sentinels.cs (1)
41public sealed override MethodInfo MakeGenericMethod(params Type[] typeArguments) => throw null!;
System\Reflection\TypeLoading\General\TypeExtensions.net.cs (8)
12public static bool IsSignatureType(this Type type) => type.IsSignatureType; 13public static bool IsSZArray(this Type type) => type.IsSZArray; 14public static bool IsVariableBoundArray(this Type type) => type.IsVariableBoundArray; 15public static bool IsGenericMethodParameter(this Type type) => type.IsGenericMethodParameter; 16public static Type MakeSignatureGenericType(this Type genericTypeDefinition, Type[] typeArguments) => Type.MakeGenericSignatureType(genericTypeDefinition, typeArguments);
System\Reflection\TypeLoading\MethodBase\Ecma\EcmaMethodDecoder.cs (2)
82Type parameterType = position == -1 ? sig.ReturnType : sig.ParameterTypes[position]; 88Type parameterType = position == -1 ? sig.ReturnType : sig.ParameterTypes[position];
System\Reflection\TypeLoading\MethodBase\RoExceptionHandlingClause.cs (3)
8private readonly Type? _catchType; 16internal RoExceptionHandlingClause(Type? catchType, ExceptionHandlingClauseOptions flags, int filterOffset, int tryOffset, int tryLength, int handlerOffset, int handlerLength) 27public sealed override Type? CatchType => _flags == ExceptionHandlingClauseOptions.Clause ? _catchType : throw new InvalidOperationException(SR.NotAClause);
System\Reflection\TypeLoading\MethodBase\RoLocalVariableInfo.cs (3)
10private readonly Type _localType; 12internal RoLocalVariableInfo(int localIndex, bool isPinned, Type localType) 21public sealed override Type LocalType => _localType;
System\Reflection\TypeLoading\Methods\RoConstructedGenericMethod.cs (2)
52public sealed override MethodInfo MakeGenericMethod(params Type[] typeArguments) => throw new InvalidOperationException(SR.Format(SR.Arg_NotGenericMethodDefinition, this)); 77foreach (Type genericMethodArgument in _genericMethodArguments)
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.cs (4)
16protected RoDefinitionMethod(Type reflectedType) 36internal RoDefinitionMethod(RoInstantiationProviderType declaringType, Type reflectedType, TMethodDecoder decoder) 101public sealed override MethodInfo MakeGenericMethod(params Type[] typeArguments) 113Type typeArgument = typeArguments[i];
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.DllImport.cs (1)
36Type attributeType = ctor.DeclaringType!;
System\Reflection\TypeLoading\Methods\RoMethod.cs (13)
16private readonly Type _reflectedType; 18protected RoMethod(Type reflectedType) 27public sealed override Type DeclaringType => GetRoDeclaringType(); 30public sealed override Type ReflectedType => _reflectedType; 46public sealed override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection); 47public sealed override bool IsDefined(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection); 78Type[] pis = GetGenericArgumentsOrParametersNoCopy(); 98public sealed override Type ReturnType => ReturnParameter.ParameterType; 102public sealed override Type[] GetGenericArguments() => GetGenericArgumentsOrParametersNoCopy().CloneArray<Type>(); 111public abstract override MethodInfo MakeGenericMethod(params Type[] typeArguments); 125public sealed override Delegate CreateDelegate(Type delegateType) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection); 126public sealed override Delegate CreateDelegate(Type delegateType, object? target) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection);
System\Reflection\TypeLoading\Methods\RoSyntheticMethod.cs (1)
88public sealed override MethodInfo MakeGenericMethod(params Type[] typeArguments) => throw new InvalidOperationException(SR.Format(SR.Arg_NotGenericMethodDefinition, this));
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.cs (3)
115protected sealed override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => GetModuleType().InternalGetMethodImpl(name, bindingAttr, binder, callConvention, types, modifiers); 118public sealed override Type[] GetTypes() 124return TypeDefTable.ToArray<Type>(skip: 1); // 0x02000001 is the <Module> type which is always skipped by this api.
System\Reflection\TypeLoading\Modules\RoModule.cs (15)
67public sealed override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_ReflectionOnlyCA); 68public sealed override bool IsDefined(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_ReflectionOnlyCA); 73protected abstract override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers); 82public abstract override Type[] GetTypes(); 86public sealed override FieldInfo ResolveField(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) => throw new NotSupportedException(SR.NotSupported_ResolvingTokens); 87public sealed override MemberInfo ResolveMember(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) => throw new NotSupportedException(SR.NotSupported_ResolvingTokens); 88public sealed override MethodBase ResolveMethod(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) => throw new NotSupportedException(SR.NotSupported_ResolvingTokens); 91public sealed override Type ResolveType(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments) => throw new NotSupportedException(SR.NotSupported_ResolvingTokens); 93public sealed override Type? GetType(string className, bool throwOnError, bool ignoreCase) 101Type type = Assembly.GetType(className, throwOnError: throwOnError, ignoreCase: ignoreCase)!;
System\Reflection\TypeLoading\Modules\RoResourceModule.cs (3)
49protected sealed override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => null; 53public sealed override Type[] GetTypes() => Type.EmptyTypes;
System\Reflection\TypeLoading\Parameters\Ecma\EcmaFatMethodParameter.cs (1)
20internal EcmaFatMethodParameter(IRoMethodBase roMethodBase, int position, Type parameterType, ParameterHandle handle)
System\Reflection\TypeLoading\Parameters\RoFatMethodParameter.cs (1)
15protected RoFatMethodParameter(IRoMethodBase roMethodBase, int position, Type parameterType)
System\Reflection\TypeLoading\Parameters\RoMethodParameter.cs (6)
13private readonly Type _parameterType; 16protected RoMethodParameter(IRoMethodBase roMethodBase, int position, Type parameterType) 33public sealed override Type ParameterType => _parameterType; 44public sealed override Type[] GetOptionalCustomModifiers() => ModifiedType.GetOptionalCustomModifiers(); 45public sealed override Type[] GetRequiredCustomModifiers() => ModifiedType.GetRequiredCustomModifiers(); 47public sealed override Type GetModifiedParameterType()
System\Reflection\TypeLoading\Parameters\RoParameter.cs (5)
30public abstract override Type ParameterType { get; } 39public abstract override Type[] GetOptionalCustomModifiers(); 40public abstract override Type[] GetRequiredCustomModifiers(); 62public sealed override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection); 63public sealed override bool IsDefined(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection);
System\Reflection\TypeLoading\Parameters\RoPropertyIndexParameter.cs (4)
28public sealed override Type ParameterType => _backingParameter.ParameterType; 33public sealed override Type[] GetOptionalCustomModifiers() => _backingParameter.GetOptionalCustomModifiers(); 34public sealed override Type[] GetRequiredCustomModifiers() => _backingParameter.GetRequiredCustomModifiers(); 35public sealed override Type GetModifiedParameterType() => _backingParameter.GetModifiedParameterType();
System\Reflection\TypeLoading\Parameters\RoThinMethodParameter.cs (1)
15internal RoThinMethodParameter(IRoMethodBase roMethodBase, int position, Type parameterType)
System\Reflection\TypeLoading\Properties\Ecma\EcmaProperty.cs (5)
20internal EcmaProperty(RoInstantiationProviderType declaringType, PropertyDefinitionHandle handle, Type reflectedType) 60protected sealed override Type ComputePropertyType() => PropertyDefinition.DecodeSignature(_module, TypeContext).ReturnType; 64public sealed override Type GetModifiedPropertyType() 69public sealed override Type[] GetOptionalCustomModifiers() => ModifiedType.GetOptionalCustomModifiers(); 70public sealed override Type[] GetRequiredCustomModifiers() => ModifiedType.GetRequiredCustomModifiers();
System\Reflection\TypeLoading\Properties\RoProperty.cs (12)
16private readonly Type _reflectedType; 18protected RoProperty(RoInstantiationProviderType declaringType, Type reflectedType) 31public sealed override Type DeclaringType => GetRoDeclaringType(); 34public sealed override Type ReflectedType => _reflectedType; 54public sealed override Type PropertyType 77Type type = ComputePropertyType(); 90protected abstract Type ComputePropertyType(); 91private volatile Type? _lazyPropertyType; 163public abstract override Type[] GetOptionalCustomModifiers(); 164public abstract override Type[] GetRequiredCustomModifiers(); 168public sealed override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection); 169public sealed override bool IsDefined(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection);
System\Reflection\TypeLoading\RuntimeTypeInfo.BindingFlags.cs (10)
14protected sealed override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 54protected sealed override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 59protected sealed override MethodInfo? GetMethodImpl(string name, int genericParameterCount, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 64private MethodInfo? GetMethodImplCommon(string name, int genericParameterCount, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 103public sealed override Type[] GetNestedTypes(BindingFlags bindingAttr) => Query<Type>(bindingAttr).ToArray(); 104public sealed override Type? GetNestedType(string name, BindingFlags bindingAttr) => Query<Type>(name, bindingAttr).Disambiguate(); 108protected sealed override PropertyInfo? GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers)
System\Reflection\TypeLoading\RuntimeTypeInfo.GetMember.cs (1)
59if ((results = QuerySpecificMemberTypeIfRequested(type, optionalName, bindingAttr, predicate, MemberTypes.NestedType, out QueryResult<Type> nestedTypes)) != null)
System\Reflection\TypeLoading\RuntimeTypeInfo.TypeComponentsCache.cs (1)
92perNameCaches[MemberTypeIndex.NestedType] = new PerNameQueryCache<Type>(type, ignoreCase: ignoreCase, immediateTypeOnly: immediateTypeOnly);
System\Reflection\TypeLoading\Types\Ecma\EcmaDefinitionType.BindingFlags.cs (4)
32internal sealed override IEnumerable<MethodInfo> SpecializeMethods(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType) 46internal sealed override IEnumerable<EventInfo> SpecializeEvents(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType) 56internal sealed override IEnumerable<FieldInfo> SpecializeFields(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType) 66internal sealed override IEnumerable<PropertyInfo> SpecializeProperties(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType)
System\Reflection\TypeLoading\Types\Ecma\EcmaDefinitionType.cs (1)
44Type? declaringType = DeclaringType;
System\Reflection\TypeLoading\Types\RoArrayType.cs (1)
152internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType)
System\Reflection\TypeLoading\Types\RoByRefType.cs (1)
36internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => Array.Empty<MethodInfo>();
System\Reflection\TypeLoading\Types\RoConstructedGenericType.cs (12)
58public sealed override Type GetFunctionPointerReturnType() => throw new InvalidOperationException(SR.InvalidOperation_NotFunctionPointer); 59public sealed override Type[] GetFunctionPointerParameterTypes() => throw new InvalidOperationException(SR.InvalidOperation_NotFunctionPointer); 114protected sealed override TypeCode GetTypeCodeImpl() => Type.GetTypeCode(_genericTypeDefinition); 120public sealed override Type GetGenericTypeDefinition() => _genericTypeDefinition; 124public sealed override Type[] GetGenericArguments() => _genericTypeArguments.CloneArrayToUnmodifiedTypes(); 126public sealed override Type MakeGenericType(params Type[] typeArguments) => throw new InvalidOperationException(SR.Format(SR.Arg_NotGenericTypeDefinition, this)); 136public sealed override Type[] GetGenericParameterConstraints() => throw new InvalidOperationException(SR.Arg_NotGenericParameter); 140internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => _genericTypeDefinition.SpecializeMethods(filter, reflectedType, this); 141internal sealed override IEnumerable<EventInfo> GetEventsCore(NameFilter? filter, Type reflectedType) => _genericTypeDefinition.SpecializeEvents(filter, reflectedType, this); 142internal sealed override IEnumerable<FieldInfo> GetFieldsCore(NameFilter? filter, Type reflectedType) => _genericTypeDefinition.SpecializeFields(filter, reflectedType, this); 143internal sealed override IEnumerable<PropertyInfo> GetPropertiesCore(NameFilter? filter, Type reflectedType) => _genericTypeDefinition.SpecializeProperties(filter, reflectedType, this);
System\Reflection\TypeLoading\Types\RoConstructedGenericType.Key.cs (2)
33Type t1 = GenericTypeArguments[i]; 34Type t2 = other.GenericTypeArguments[i];
System\Reflection\TypeLoading\Types\RoDefinitionType.cs (17)
44Type? declaringType = DeclaringType; 81public sealed override Type GetGenericTypeDefinition() => IsGenericTypeDefinition ? this : throw new InvalidOperationException(SR.InvalidOperation_NotGenericType); 90public sealed override Type MakeGenericType(params Type[] typeArguments) 106Type typeArgument = typeArguments[i]; 186Type t = IsEnum ? GetEnumUnderlyingType() : this; 229public sealed override Type[] GetGenericParameterConstraints() => throw new InvalidOperationException(SR.Arg_NotGenericParameter); 231public sealed override Type GetFunctionPointerReturnType() => throw new InvalidOperationException(SR.InvalidOperation_NotFunctionPointer); 232public sealed override Type[] GetFunctionPointerParameterTypes() => throw new InvalidOperationException(SR.InvalidOperation_NotFunctionPointer); 234internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => SpecializeMethods(filter, reflectedType, this); 235internal sealed override IEnumerable<EventInfo> GetEventsCore(NameFilter? filter, Type reflectedType) => SpecializeEvents(filter, reflectedType, this); 236internal sealed override IEnumerable<FieldInfo> GetFieldsCore(NameFilter? filter, Type reflectedType) => SpecializeFields(filter, reflectedType, this); 237internal sealed override IEnumerable<PropertyInfo> GetPropertiesCore(NameFilter? filter, Type reflectedType) => SpecializeProperties(filter, reflectedType, this); 241internal abstract IEnumerable<MethodInfo> SpecializeMethods(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType); 242internal abstract IEnumerable<EventInfo> SpecializeEvents(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType); 243internal abstract IEnumerable<FieldInfo> SpecializeFields(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType); 244internal abstract IEnumerable<PropertyInfo> SpecializeProperties(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType);
System\Reflection\TypeLoading\Types\RoExceptionType.cs (4)
46internal sealed override IEnumerable<MethodInfo> SpecializeMethods(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType) => throw null!; 47internal sealed override IEnumerable<EventInfo> SpecializeEvents(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType) => throw null!; 48internal sealed override IEnumerable<FieldInfo> SpecializeFields(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType) => throw null!; 49internal sealed override IEnumerable<PropertyInfo> SpecializeProperties(NameFilter? filter, Type reflectedType, RoInstantiationProviderType declaringType) => throw null!;
System\Reflection\TypeLoading\Types\RoFunctionPointerType.cs (17)
23internal readonly Type _returnType; 24internal readonly Type[] _parameterTypes; 49public sealed override Type GetFunctionPointerReturnType() => _returnType.UnderlyingSystemType; 50public sealed override Type[] GetFunctionPointerParameterTypes() => _parameterTypes.CloneArrayToUnmodifiedTypes(); 78Type t = _returnType; 109public sealed override bool Equals([NotNullWhen(true)] Type? type) => Equals((object?)type); 124Type[] args = GetFunctionPointerParameterTypes(); 125Type[] otherArgs = other.GetFunctionPointerParameterTypes(); 158foreach (Type parameterType in _parameterTypes) 183public sealed override Type GetGenericTypeDefinition() => throw new InvalidOperationException(SR.InvalidOperation_NotGenericType); 188public sealed override Type MakeGenericType(params Type[] typeArguments) => throw new InvalidOperationException(SR.Format(SR.Arg_NotGenericTypeDefinition, this)); 192public sealed override Type[] GetGenericParameterConstraints() => throw new InvalidOperationException(SR.Arg_NotGenericParameter); 199internal sealed override IEnumerable<EventInfo> GetEventsCore(NameFilter? filter, Type reflectedType) => Array.Empty<EventInfo>(); 200internal sealed override IEnumerable<FieldInfo> GetFieldsCore(NameFilter? filter, Type reflectedType) => Array.Empty<FieldInfo>(); 201internal sealed override IEnumerable<PropertyInfo> GetPropertiesCore(NameFilter? filter, Type reflectedType) => Array.Empty<PropertyInfo>(); 211internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => Array.Empty<MethodInfo>();
System\Reflection\TypeLoading\Types\RoGenericParameterType.cs (11)
44public sealed override Type GetGenericTypeDefinition() => throw new InvalidOperationException(SR.InvalidOperation_NotGenericType); 49public sealed override Type MakeGenericType(params Type[] typeArguments) => throw new InvalidOperationException(SR.Format(SR.Arg_NotGenericTypeDefinition, this)); 55public sealed override Type[] GetGenericParameterConstraints() => GetGenericParameterConstraintsNoCopy().CloneArray<Type>(); 60public sealed override Type GetFunctionPointerReturnType() => throw new InvalidOperationException(SR.InvalidOperation_NotFunctionPointer); 61public sealed override Type[] GetFunctionPointerParameterTypes() => throw new InvalidOperationException(SR.InvalidOperation_NotFunctionPointer); 89internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => Array.Empty<MethodInfo>(); 90internal sealed override IEnumerable<EventInfo> GetEventsCore(NameFilter? filter, Type reflectedType) => Array.Empty<EventInfo>(); 91internal sealed override IEnumerable<FieldInfo> GetFieldsCore(NameFilter? filter, Type reflectedType) => Array.Empty<FieldInfo>(); 92internal sealed override IEnumerable<PropertyInfo> GetPropertiesCore(NameFilter? filter, Type reflectedType) => Array.Empty<PropertyInfo>();
System\Reflection\TypeLoading\Types\RoHasElementType.cs (9)
62public sealed override Type GetGenericTypeDefinition() => throw new InvalidOperationException(SR.InvalidOperation_NotGenericType); 67public sealed override Type MakeGenericType(params Type[] typeArguments) => throw new InvalidOperationException(SR.Format(SR.Arg_NotGenericTypeDefinition, this)); 71public sealed override Type[] GetGenericParameterConstraints() => throw new InvalidOperationException(SR.Arg_NotGenericParameter); 73public sealed override Type GetFunctionPointerReturnType() => throw new InvalidOperationException(SR.InvalidOperation_NotFunctionPointer); 74public sealed override Type[] GetFunctionPointerParameterTypes() => throw new InvalidOperationException(SR.InvalidOperation_NotFunctionPointer); 82internal sealed override IEnumerable<EventInfo> GetEventsCore(NameFilter? filter, Type reflectedType) => Array.Empty<EventInfo>(); 83internal sealed override IEnumerable<FieldInfo> GetFieldsCore(NameFilter? filter, Type reflectedType) => Array.Empty<FieldInfo>(); 84internal sealed override IEnumerable<PropertyInfo> GetPropertiesCore(NameFilter? filter, Type reflectedType) => Array.Empty<PropertyInfo>();
System\Reflection\TypeLoading\Types\RoModifiedFunctionPointerType.cs (14)
17private readonly Type[] _callingConventions; 25Type[] parameterUnmodifiedTypes = functionPointerType._parameterTypes; 38Type[] returnTypeOptionalModifiers = _returnType.GetOptionalCustomModifiers(); 42public override Type GetFunctionPointerReturnType() => _returnType; 43public override Type[] GetFunctionPointerParameterTypes() => Helpers.CloneArray(_parameterTypes); 44public override Type[] GetFunctionPointerCallingConventions() => Helpers.CloneArray(_callingConventions); 46private Type CDeclType => Loader.GetCoreType(CoreType.CallConvCdecl); 47private Type StdCallType => Loader.GetCoreType(CoreType.CallConvStdcall); 48private Type ThisCallType => Loader.GetCoreType(CoreType.CallConvThiscall); 49private Type FastCallType => Loader.GetCoreType(CoreType.CallConvFastcall); 51private Type[] CreateCallingConventions(Type[] returnTypeOptionalModifiers, RoFunctionPointerType functionPointerType) 53List<Type> builder = new(returnTypeOptionalModifiers.Length + 1); 73Type type = returnTypeOptionalModifiers[i];
System\Reflection\TypeLoading\Types\RoModifiedGenericType.cs (1)
20Type[] unmodifiedTypes = genericType.GetGenericTypeArgumentsNoCopy();
System\Reflection\TypeLoading\Types\RoModifiedType.cs (22)
18private List<Type>? _requiredModifiersBuilder; 19private List<Type>? _optionalModifiersBuilder; 20private Type[]? _requiredModifiers; 21private Type[]? _optionalModifiers; 58public void AddRequiredModifier(Type type) 61_requiredModifiersBuilder ??= new List<Type>(); 65public void AddOptionalModifier(Type type) 68_optionalModifiersBuilder ??= new List<Type>(); 75public override Type[] GetRequiredCustomModifiers() 93public override Type[] GetOptionalCustomModifiers() 111public override Type UnderlyingSystemType => _unmodifiedType; 116public override bool Equals(Type? other) => throw new NotSupportedException(SR.NotSupported_ModifiedType); 169public override Type GetGenericTypeDefinition() => throw new NotSupportedException(SR.NotSupported_ModifiedType); 176public override Type MakeGenericType(params Type[] typeArguments) => throw new NotSupportedException(SR.NotSupported_ModifiedType); 178public override Type GetFunctionPointerReturnType() => throw new InvalidOperationException(SR.InvalidOperation_NotFunctionPointer); 179public override Type[] GetFunctionPointerParameterTypes() => throw new InvalidOperationException(SR.InvalidOperation_NotFunctionPointer); 183public override Type[] GetGenericParameterConstraints() => throw new NotSupportedException(SR.NotSupported_ModifiedType); 193internal override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => throw new NotSupportedException(SR.NotSupported_ModifiedType); 194internal override IEnumerable<EventInfo> GetEventsCore(NameFilter? filter, Type reflectedType) => throw new NotSupportedException(SR.NotSupported_ModifiedType); 195internal override IEnumerable<FieldInfo> GetFieldsCore(NameFilter? filter, Type reflectedType) => throw new NotSupportedException(SR.NotSupported_ModifiedType); 196internal override IEnumerable<PropertyInfo> GetPropertiesCore(NameFilter? filter, Type reflectedType) => throw new NotSupportedException(SR.NotSupported_ModifiedType);
System\Reflection\TypeLoading\Types\RoPointerType.cs (1)
36internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => Array.Empty<MethodInfo>();
System\Reflection\TypeLoading\Types\RoStubType.cs (10)
56public sealed override Type GetGenericTypeDefinition() => throw null!; 61public sealed override Type MakeGenericType(params Type[] typeArguments) => throw null!; 65public sealed override Type[] GetGenericParameterConstraints() => throw null!; 66public sealed override Type GetFunctionPointerReturnType() => throw null!; 67public sealed override Type[] GetFunctionPointerParameterTypes() => throw null!; 78internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => throw null!; 79internal sealed override IEnumerable<EventInfo> GetEventsCore(NameFilter? filter, Type reflectedType) => throw null!; 80internal sealed override IEnumerable<FieldInfo> GetFieldsCore(NameFilter? filter, Type reflectedType) => throw null!; 81internal sealed override IEnumerable<PropertyInfo> GetPropertiesCore(NameFilter? filter, Type reflectedType) => throw null!;
System\Reflection\TypeLoading\Types\RoType.cs (40)
20public sealed override Type AsType() => this; 21public override Type UnderlyingSystemType => this; 58public override Type[] GetFunctionPointerCallingConventions() 69public abstract override Type GetFunctionPointerReturnType(); 70public abstract override Type[] GetFunctionPointerParameterTypes(); 73public override Type[] GetOptionalCustomModifiers() => EmptyTypes; 74public override Type[] GetRequiredCustomModifiers() => EmptyTypes; 79public sealed override Type[] GenericTypeParameters => GetGenericTypeParametersNoCopy().CloneArray<Type>(); 83public sealed override Type? GetElementType() => GetRoElementType(); 90public abstract override Type GetGenericTypeDefinition(); 91public sealed override Type[] GenericTypeArguments => GetGenericTypeArgumentsNoCopy().CloneArray<Type>(); 97public abstract override Type[] GetGenericParameterConstraints(); 103public override Type[] GetGenericArguments() => GetGenericArgumentsNoCopy().CloneArray(); 139public sealed override Type? DeclaringType => GetRoDeclaringType(); 148public sealed override Type? ReflectedType => DeclaringType; 159public sealed override Type? BaseType => GetRoBaseType(); 195public sealed override Type[] GetInterfaces() => GetInterfacesNoCopy().CloneArray<Type>(); 197public sealed override IEnumerable<Type> ImplementedInterfaces 201foreach (Type ifc in GetInterfacesNoCopy()) 248public sealed override InterfaceMapping GetInterfaceMap(Type interfaceType) => throw new NotSupportedException(SR.NotSupported_InterfaceMapping); 251public sealed override bool IsAssignableFrom(TypeInfo? typeInfo) => IsAssignableFrom((Type?)typeInfo); 252public sealed override bool IsAssignableFrom(Type? c) 314public sealed override Type MakeArrayType() => this.GetUniqueArrayType(); 315public sealed override Type MakeArrayType(int rank) 323public sealed override Type MakeByRefType() => this.GetUniqueByRefType(); 324public sealed override Type MakePointerType() => this.GetUniquePointerType(); 326public abstract override Type MakeGenericType(params Type[] typeArguments); 329public sealed override Type GetEnumUnderlyingType() => _lazyUnderlyingEnumType ??= ComputeEnumUnderlyingType(); 344Array ret = Type.GetTypeCode(GetEnumUnderlyingType()) switch 374public sealed override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_ReflectionOnlyCA); 375public sealed override bool IsDefined(Type attributeType, bool inherit) => throw new InvalidOperationException(SR.Arg_ReflectionOnlyCA); 381internal abstract IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType); 382internal abstract IEnumerable<EventInfo> GetEventsCore(NameFilter? filter, Type reflectedType); 383internal abstract IEnumerable<FieldInfo> GetFieldsCore(NameFilter? filter, Type reflectedType); 384internal abstract IEnumerable<PropertyInfo> GetPropertiesCore(NameFilter? filter, Type reflectedType); 388internal MethodInfo? InternalGetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers)
System\Reflection\TypeLoading\Types\RoType.GetInterface.cs (3)
11public sealed override Type? GetInterface(string name, bool ignoreCase) 20Type? match = null; 21foreach (Type ifc in ImplementedInterfaces)
System\Reflection\TypeLoading\Types\RoType.TypeClassification.cs (3)
49Type? baseType = BaseType; 54Type? enumType = coreTypes[CoreType.Enum]; 55Type? valueType = coreTypes[CoreType.ValueType];
System\ThrowHelper.cs (1)
21Type? declaringType = memberInfo.DeclaringType;
System.Reflection.TypeExtensions (45)
System\Reflection\TypeExtensions.cs (45)
11[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] this Type type, 12Type[] types) 20[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] this Type type) 28[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] this Type type, 43| DynamicallyAccessedMemberTypes.PublicNestedTypes)] this Type type) 51[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents)] this Type type, 60[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents)] this Type type, 70[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents)] this Type type) 78[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents)] this Type type, 87[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] this Type type, 96[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] this Type type, 106[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] this Type type) 114[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] this Type type, 122public static Type[] GetGenericArguments(this Type type) 129public static Type[] GetInterfaces( 130[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] this Type type) 144| DynamicallyAccessedMemberTypes.PublicNestedTypes)] this Type type, 153[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] this Type type, 169| DynamicallyAccessedMemberTypes.PublicNestedTypes)] this Type type) 177[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] this Type type, 186[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] this Type type, 195[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] this Type type, 205[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] this Type type, 207Type[] types) 215[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] this Type type) 223[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] this Type type, 231public static Type? GetNestedType( 232[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes)] this Type type, 241public static Type[] GetNestedTypes( 242[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes)] this Type type, 251[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] this Type type) 259[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] this Type type, 268[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] this Type type, 277[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] this Type type, 287[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] this Type type, 289Type? returnType) 297[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] this Type type, 299Type? returnType, 300Type[] types) 307public static bool IsAssignableFrom(this Type type, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] Type? c) 314public static bool IsInstanceOfType(this Type type, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? o) 325public static Type[] GetExportedTypes(this Assembly assembly) 340public static Type[] GetTypes(this Assembly assembly)
System.Resources.Extensions (53)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (1)
443Type type = value.GetType();
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (7)
82private Type?[] _typeTable; // Lazy array of Types for resource values. 568Type type = FindType(typeIndex); 865_typeTable = new Type[numTypes]; 969private Type FindType(int typeIndex) 985Type UseReflectionToGetTypeLocal(int typeIndex) => UseReflectionToGetType(typeIndex); 992private Type UseReflectionToGetType(int typeIndex) 1001_typeTable[typeIndex] = Type.GetType(typeName, true);
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.ITypeResolver.cs (1)
21Type GetType(TypeName typeName);
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.TypeResolver.cs (8)
25private readonly Dictionary<string, Type> _types = []; 38Type ITypeResolver.GetType(TypeName typeName) 42if (_types.TryGetValue(typeName.AssemblyQualifiedName, out Type? cachedType)) 47if (_binder?.BindToType(typeName.AssemblyName.FullName, typeName.FullName) is Type binderType) 79Type? type = _assemblyMatching != FormatterAssemblyStyle.Simple 88private static Type? GetSimplyNamedTypeFromAssembly(Assembly assembly, TypeName typeName) 103return Type.GetType(typeName.FullName, ResolveSimpleAssemblyName, new TopLevelAssemblyTypeResolver(assembly).ResolveType, throwOnError: false); 130public Type? ResolveType(Assembly? assembly, string simpleTypeName, bool ignoreCase)
System\Resources\Extensions\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (7)
14private readonly Type _elementType; 29Type expectedArrayType = arrayRecord.Rank switch 38Type elementType = _arrayOfClassRecords.GetType(); 132Type arrayRecordElementType = typeResolver.GetType(arrayRecord.TypeName.GetElementType()); 133Type elementType = arrayRecordElementType; 144Type expectedArrayType = arrayRecordElementType.MakeArrayType(arrayRecord.Rank); 148static bool HasBuiltInSupport(Type elementType)
System\Resources\Extensions\BinaryFormat\Deserializer\ClassRecordDeserializer.cs (2)
33Type type = deserializer.TypeResolver.GetType(classRecord.TypeName); 86Type type = value.GetType();
System\Resources\Extensions\BinaryFormat\Deserializer\ClassRecordFieldInfoDeserializer.cs (1)
30Type type,
System\Resources\Extensions\BinaryFormat\Deserializer\ClassRecordSerializationInfoDeserializer.cs (1)
31Type type,
System\Resources\Extensions\BinaryFormat\Deserializer\Deserializer.cs (4)
50/// <see cref="SerializationInfo.SetType(Type)"/> will get that type info serialized into the stream. 67private readonly Dictionary<Type, ISerializationSurrogate?>? _surrogates; 257ISerializationSurrogate? IDeserializer.GetSurrogate(Type type) 342Type type = _typeResolver.GetType(classRecord.TypeName);
System\Resources\Extensions\BinaryFormat\Deserializer\IDeserializer.cs (1)
71ISerializationSurrogate? GetSurrogate(Type type);
System\Resources\Extensions\BinaryFormat\Deserializer\PendingSerializationInfo.cs (2)
34Type type = @object.GetType(); 67[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type)
System\Resources\Extensions\BinaryFormat\SerializationEvents.cs (8)
14private static readonly ConcurrentDictionary<Type, SerializationEvents> s_cache = new(); 34[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type t) => 37private static SerializationEvents CreateSerializationEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 48Type attribute, 50[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? type) 55Type? baseType = type; 78[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 83[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type,
System\Resources\Extensions\BinaryFormat\SerializationInfoExtensions.cs (3)
12private static readonly Action<SerializationInfo, string, object, Type> s_updateValue = 16.CreateDelegate<Action<SerializationInfo, string, object, Type>>(); 23internal static void UpdateValue(this SerializationInfo si, string name, object value, Type type) =>
System\Resources\Extensions\DeserializingResourceReader.cs (4)
60public override Type? BindToType(string assemblyName, string typeName) 62Type? type = null; 71type = Type.GetType(typeName, throwOnError: false, ignoreCase: false); 115Type type = FindType(typeIndex);
System\Resources\Extensions\PreserializedResourceWriter.cs (3)
39private static readonly Dictionary<string, Type> s_primitiveTypes = new Dictionary<string, Type>(16, TypeNameComparer.Instance) 87if (s_primitiveTypes.TryGetValue(typeName, out Type? primitiveType))
System.Resources.Writer (2)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (1)
443Type type = value.GetType();
System\Resources\ResourceWriter.core.cs (1)
20public Func<Type, string>? TypeNameConverter { get; set; }
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
837[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Type))]
System.Runtime.CompilerServices.VisualC (2)
System\Runtime\CompilerServices\Attributes.cs (2)
117public RequiredAttributeAttribute(Type requiredContract) => RequiredContract = requiredContract; 119public Type RequiredContract { get; }
System.Runtime.InteropServices (38)
System\Runtime\InteropServices\ComAwareEventInfo.cs (6)
22public ComAwareEventInfo([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents)] Type type, string eventName) 74public override Type? DeclaringType => _innerEventInfo.DeclaringType; 76public override object[] GetCustomAttributes(Type attributeType, bool inherit) 88public override bool IsDefined(Type attributeType, bool inherit) 99public override Type? ReflectedType => _innerEventInfo.ReflectedType; 117Type sourceInterface = interfaceAttribute.SourceInterface;
System\Runtime\InteropServices\ManagedToNativeComInteropStubAttribute.cs (2)
9public ManagedToNativeComInteropStubAttribute(Type classType, string methodName) 15public Type ClassType { get; }
System\Runtime\InteropServices\Marshalling\ComImportInteropInterfaceDetailsStrategy.cs (19)
55private readonly ConditionalWeakTable<Type, Type> _forwarderInterfaceCache = new(); 62Type runtimeType = Type.GetTypeFromHandle(type)!; 68Type implementationType = _forwarderInterfaceCache.GetValue(runtimeType, runtimeType => 79implementation.SetCustomAttribute(new CustomAttributeBuilder(typeof(DynamicInterfaceCastableImplementationAttribute).GetConstructor(Array.Empty<Type>())!, Array.Empty<object>())); 81foreach (Type iface in implementation.GetInterfaces()) 86Type[] returnTypeOptionalModifiers = method.ReturnParameter.GetOptionalCustomModifiers(); 87Type[] returnTypeRequiredModifiers = method.ReturnParameter.GetRequiredCustomModifiers(); 89var parameterTypes = new Type[parameters.Length]; 90var parameterOptionalModifiers = new Type[parameters.Length][]; 91var parameterRequiredModifiers = new Type[parameters.Length][]; 122Type attributeType = EmitIgnoresAccessChecksToAttribute(moduleBuilder); 123return attributeType.GetConstructor(new Type[] { typeof(string) })!; 127private static Type EmitIgnoresAccessChecksToAttribute(ModuleBuilder moduleBuilder) 147new Type[] { typeof(string) }); 166private static readonly ConstructorInfo s_attributeUsageCtor = typeof(AttributeUsageAttribute).GetConstructor(new Type[] { typeof(AttributeTargets) })!; 173private sealed class ComImportDetails(Guid iid, Type implementation) : IIUnknownDerivedDetails 177public Type Implementation { get; } = implementation;
System\Runtime\InteropServices\Marshalling\ComObject.cs (1)
153VirtualMethodTableInfo IUnmanagedVirtualMethodTableProvider.GetVirtualMethodTableInfoForKey(Type type)
System\Runtime\InteropServices\Marshalling\GeneratedComInterfaceAttribute.cs (2)
32/// Gets or sets the <see cref="Type"/> used to control how string arguments are marshalled for all methods on the interface. 40public Type? StringMarshallingCustomType { get; set; }
System\Runtime\InteropServices\Marshalling\IComExposedDetails.cs (2)
23var type = Type.GetTypeFromHandle(handle);
System\Runtime\InteropServices\Marshalling\IIUnknownDerivedDetails.cs (3)
25public Type Implementation { get; } 34var type = Type.GetTypeFromHandle(handle);
System\Runtime\InteropServices\Marshalling\IUnknownDerivedAttribute.cs (1)
27public Type Implementation => typeof(TImpl);
System\Runtime\InteropServices\Marshalling\IUnmanagedVirtualMethodTableProvider.cs (1)
18public VirtualMethodTableInfo GetVirtualMethodTableInfoForKey(Type type);
System\Runtime\InteropServices\TypeLibImportClassAttribute.cs (1)
9public TypeLibImportClassAttribute(Type importClass) => Value = importClass.ToString();
System.Runtime.Serialization.Formatters (56)
System\Runtime\Serialization\Formatter.cs (4)
68protected abstract void WriteArray(object obj, string name, Type memberType); 88protected abstract void WriteObjectRef(object? obj, string name, Type memberType); 98Type varType = data.GetType(); 186protected abstract void WriteValueType(object obj, string name, Type memberType);
System\Runtime\Serialization\FormatterConverter.cs (1)
11public object Convert(object value, Type type)
System\Runtime\Serialization\Formatters\IFieldInfo.cs (1)
10Type[]? FieldTypes { get; set; }
System\Runtime\Serialization\FormatterServices.cs (20)
25[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 45Type? parentType = type.BaseType; 48bool classNamesUnique = GetParentTypes(parentType, out Type[]? parentTypes, out int parentTypeCount); 89[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] Type type) 127private static bool GetParentTypes(Type parentType, out Type[]? parentTypes, out int parentTypeCount) 135Type objectType = typeof(object); 136for (Type t1 = parentType; t1 != objectType; t1 = t1.BaseType!) 167[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) 173[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, 185public static void CheckTypeSecurity(Type t, TypeFilterLevel securityLevel) 197Type type) => RuntimeHelpers.GetUninitializedObject(type); 201Type type) => RuntimeHelpers.GetUninitializedObject(type); 291public static Type? GetTypeFromAssembly(Assembly assem, string name) 313internal static string GetClrAssemblyName(Type type, out bool hasTypeForwardedFrom) 318Type attributedType = type; 334internal static string GetClrTypeFullName(Type type) 341private static string GetClrTypeFullNameForArray(Type type) 351private static string GetClrTypeFullNameForNonArrayTypes(Type type) 361foreach (Type genericArgument in type.GetGenericArguments())
System\Runtime\Serialization\ISurrogateSelector.cs (1)
10ISerializationSurrogate? GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector);
System\Runtime\Serialization\MemberHolder.cs (2)
11internal readonly Type _memberType; 15[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type,
System\Runtime\Serialization\ObjectManager.cs (7)
389private static FieldInfo? GetNullableValueField(Type type) 681Type selectorType = CanCallGetType(obj) ? 783Type t = obj.GetType(); 797[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type t) 1626private static readonly Action<SerializationInfo, string, object, Type> s_updateValue = 1629.CreateDelegate<Action<SerializationInfo, string, object, Type>>(); 1631public static void UpdateValue(this SerializationInfo si, string name, object value, Type type) =>
System\Runtime\Serialization\SerializationBinder.cs (2)
8public virtual void BindToName(Type serializedType, out string? assemblyName, out string? typeName) 14public abstract Type? BindToType(string assemblyName, string typeName);
System\Runtime\Serialization\SerializationEventsCache.cs (8)
19internal SerializationEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? t) 28Type attribute, 30[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? t) 35Type? baseType = t; 98private static readonly ConcurrentDictionary<Type, SerializationEvents> s_cache = new ConcurrentDictionary<Type, SerializationEvents>(); 101[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type t) => 106private static SerializationEvents CreateSerializationEvents(Type t) => new SerializationEvents(t);
System\Runtime\Serialization\SerializationFieldInfo.cs (5)
35public override Type? DeclaringType => m_field.DeclaringType; 37public override Type? ReflectedType => m_field.ReflectedType; 41public override object[] GetCustomAttributes(Type attributeType, bool inherit) => m_field.GetCustomAttributes(attributeType, inherit); 43public override bool IsDefined(Type attributeType, bool inherit) => m_field.IsDefined(attributeType, inherit); 45public override Type FieldType => m_field.FieldType;
System\Runtime\Serialization\SurrogateSelector.cs (5)
15public virtual void AddSurrogate(Type type, StreamingContext context, ISerializationSurrogate surrogate) 145public virtual ISerializationSurrogate? GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector) 166public virtual void RemoveSurrogate(Type type, StreamingContext context) 177internal readonly Type _type; 180internal SurrogateKey(Type type, StreamingContext context)
System.Runtime.Serialization.Primitives (16)
System\Runtime\Serialization\ISerializationSurrogateProvider.cs (7)
19/// <returns>The <see cref="Type"/> to substitute for the type value. This type must be serializable by the DataContractSerializer. For example, 21Type GetSurrogateType(Type type); 27/// <param name="targetType">The <see cref="Type"/> that the substituted object should be assigned to.</param> 30object GetObjectToSerialize(object obj, Type targetType); 36/// <param name="targetType">The <see cref="Type"/> that the substituted object should be assigned to.</param> 39object GetDeserializedObject(object obj, Type targetType);
System\Runtime\Serialization\ISerializationSurrogateProvider2.cs (7)
23object? GetCustomDataToExport(MemberInfo memberInfo, Type dataContractType); 31object? GetCustomDataToExport(Type runtimeType, Type dataContractType); 36/// <param name="customDataTypes">A <see cref="Collection{T}"/> of <see cref="Type"/> to add known types to.</param> 37void GetKnownCustomDataTypes(Collection<Type> customDataTypes); 45/// <returns>The <see cref="Type"/> to use for the referenced type.</returns> 46Type? GetReferencedTypeOnImport(string typeName, string typeNamespace, object? customData);
System\Runtime\Serialization\KnownTypeAttribute.cs (2)
9public KnownTypeAttribute(Type type) 21public Type? Type { get; }
System.Runtime.Serialization.Schema (36)
System\Runtime\Serialization\Schema\CodeExporter.cs (19)
318private CodeTypeReference GetCodeTypeReference(Type type) 325private CodeTypeReference? GetCodeTypeReference(Type type, IList? parameters) 341else if (param is Tuple<Type, object[]?> typeParameters) 541Type? type = _dataContractSet.GetReferencedType(dataContract.XmlName, dataContract, out DataContract? referencedContract, out object[]? parameters, SupportsGenericTypeReference); 578type = (Type?)typeReference.UserData[s_codeUserDataActualTypeKey]; 655Type? type = _dataContractSet.GetReferencedType(GenericDictionaryName, GenericDictionaryContract, out DataContract? _, out object[]? _) ?? typeof(Dictionary<,>); 685Type? type = _dataContractSet.GetReferencedType(GenericListName, GenericListContract, out DataContract? _, out object[]? _); 700Type? type = GetReferencedTypeOnImport(dataContract); 711private Type? GetReferencedTypeOnImport(DataContract dataContract) 713Type? type = null; 826Type? actualType = (Type?)baseContractCodeDomInfo.TypeReference?.UserData[s_codeUserDataActualTypeKey]; 1051private static void ThrowIfReferencedBaseTypeSealed(Type baseType, DataContract dataContract) 1071Type baseType = enumDataContract.BaseContract!.UnderlyingType; 1158Type? actualType = (Type?)baseContractCodeDomInfo.TypeReference?.UserData[s_codeUserDataActualTypeKey]; 1434internal static string GetClrTypeFullName(Type type) 1612Dictionary<Type, object> previousCollectionTypes = new Dictionary<Type, object>();
System\Runtime\Serialization\Schema\ImportGlobals.cs (10)
96private static Type? s_typeOfXmlElement; 97internal static Type TypeOfXmlElement => s_typeOfXmlElement ??= typeof(XmlElement); 99private static Type? s_typeOfXmlNodeArray; 100internal static Type TypeOfXmlNodeArray => s_typeOfXmlNodeArray ??= typeof(XmlNode[]); 102private static Type? s_typeOfXmlQualifiedName; 103internal static Type TypeOfXmlQualifiedName => s_typeOfXmlQualifiedName ??= typeof(XmlQualifiedName); 105private static Type? s_typeOfXmlSchemaProviderAttribute; 106internal static Type TypeOfXmlSchemaProviderAttribute => s_typeOfXmlSchemaProviderAttribute ??= typeof(XmlSchemaProviderAttribute); 108private static Type? s_typeOfXmlSchemaType; 109internal static Type TypeOfXmlSchemaType => s_typeOfXmlSchemaType ??= typeof(XmlSchemaType);
System\Runtime\Serialization\Schema\ImportOptions.cs (6)
19private ICollection<Type>? _referencedTypes; 20private ICollection<Type>? _referencedCollectionTypes; 65public ICollection<Type> ReferencedCollectionTypes => _referencedCollectionTypes ??= new List<Type>(); 70public ICollection<Type> ReferencedTypes => _referencedTypes ??= new List<Type>();
System\Runtime\Serialization\Schema\SchemaImportHelper.cs (1)
59internal static bool IsTypeNullable(Type type)
System.Security.AccessControl (11)
artifacts\obj\System.Security.AccessControl\Debug\net10.0\System.Security.AccessControl.notsupported.cs (11)
165public System.Security.AccessControl.AuthorizationRuleCollection GetAccessRules(bool includeExplicit, bool includeInherited, System.Type targetType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } 166public System.Security.AccessControl.AuthorizationRuleCollection GetAuditRules(bool includeExplicit, bool includeInherited, System.Type targetType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } 372public abstract System.Type AccessRightType { get; } 374public abstract System.Type AccessRuleType { get; } 380public abstract System.Type AuditRuleType { get; } 388public System.Security.Principal.IdentityReference? GetGroup(System.Type targetType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } 389public System.Security.Principal.IdentityReference? GetOwner(System.Type targetType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } 422public override System.Type AccessRightType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 423public override System.Type AccessRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 424public override System.Type AuditRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 568public void RemoveType(System.Type t) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); }
System.Security.Cryptography (66)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (22)
92Type? socketsHttpHandlerType = Type.GetType("System.Net.Http.SocketsHttpHandler, System.Net.Http", throwOnError: false); 93Type? httpMessageHandlerType = Type.GetType("System.Net.Http.HttpMessageHandler, System.Net.Http", throwOnError: false); 94Type? httpClientType = Type.GetType("System.Net.Http.HttpClient, System.Net.Http", throwOnError: false); 95Type? httpRequestMessageType = Type.GetType("System.Net.Http.HttpRequestMessage, System.Net.Http", throwOnError: false); 96Type? httpResponseMessageType = Type.GetType("System.Net.Http.HttpResponseMessage, System.Net.Http", throwOnError: false); 97Type? httpResponseHeadersType = Type.GetType("System.Net.Http.Headers.HttpResponseHeaders, System.Net.Http", throwOnError: false); 98Type? httpContentType = Type.GetType("System.Net.Http.HttpContent, System.Net.Http", throwOnError: false); 99Type? taskOfHttpResponseMessageType = Type.GetType("System.Threading.Tasks.Task`1[[System.Net.Http.HttpResponseMessage, System.Net.Http]], System.Runtime", throwOnError: false); 109ConstructorInfo? socketsHttpHandlerCtor = socketsHttpHandlerType.GetConstructor(Type.EmptyTypes); 112ConstructorInfo? httpClientCtor = httpClientType.GetConstructor(new Type[] { httpMessageHandlerType }); 114ConstructorInfo? httpRequestMessageCtor = httpRequestMessageType.GetConstructor(Type.EmptyTypes); 115MethodInfo? sendMethod = httpClientType.GetMethod("Send", new Type[] { httpRequestMessageType, typeof(CancellationToken) }); 116MethodInfo? sendAsyncMethod = httpClientType.GetMethod("SendAsync", new Type[] { httpRequestMessageType, typeof(CancellationToken) }); 122MethodInfo? readAsStreamMethod = httpContentType.GetMethod("ReadAsStream", Type.EmptyTypes);
System\Security\Cryptography\AsymmetricKeyExchangeFormatter.cs (1)
16public abstract byte[] CreateKeyExchange(byte[] data, Type? symAlgType);
System\Security\Cryptography\CapiHelper.Unix.cs (2)
17Type hashAlgType => HashAlgorithmTypeToHashAlgorithmName(hashAlgType), 66private static HashAlgorithmName HashAlgorithmTypeToHashAlgorithmName(Type hashAlgType)
System\Security\Cryptography\CryptoConfig.cs (30)
36private static readonly ConcurrentDictionary<string, Type> appNameHT = new ConcurrentDictionary<string, Type>(StringComparer.OrdinalIgnoreCase); 115Type HMACMD5Type = typeof(System.Security.Cryptography.HMACMD5); 116Type HMACSHA1Type = typeof(System.Security.Cryptography.HMACSHA1); 117Type HMACSHA256Type = typeof(System.Security.Cryptography.HMACSHA256); 118Type HMACSHA384Type = typeof(System.Security.Cryptography.HMACSHA384); 119Type HMACSHA512Type = typeof(System.Security.Cryptography.HMACSHA512); 121Type RijndaelManagedType = typeof(System.Security.Cryptography.RijndaelManaged); 124Type AesManagedType = typeof(System.Security.Cryptography.AesManaged); 125Type SHA256DefaultType = typeof(System.Security.Cryptography.SHA256Managed); 126Type SHA384DefaultType = typeof(System.Security.Cryptography.SHA384Managed); 127Type SHA512DefaultType = typeof(System.Security.Cryptography.SHA512Managed); 128Type SHA1CryptoServiceProviderType = typeof(SHA1CryptoServiceProvider); 129Type MD5CryptoServiceProviderType = typeof(MD5CryptoServiceProvider); 130Type RSACryptoServiceProviderType = typeof(RSACryptoServiceProvider); 131Type DSACryptoServiceProviderType = typeof(DSACryptoServiceProvider); 132Type DESCryptoServiceProviderType = typeof(DESCryptoServiceProvider); 133Type TripleDESCryptoServiceProviderType = typeof(TripleDESCryptoServiceProvider); 134Type RC2CryptoServiceProviderType = typeof(RC2CryptoServiceProvider); 135Type AesCryptoServiceProviderType = typeof(AesCryptoServiceProvider); 138Type RNGCryptoServiceProviderType = typeof(RNGCryptoServiceProvider); 141Type ECDsaCngType = typeof(ECDsaCng); 303public static void AddAlgorithm(Type algorithm, params string[] names) 378appNameHT.TryGetValue(name, out Type? retvalType); 385retvalType = retvalObj as Type; 391retvalType = Type.GetType(retvalString, false, false); 422retvalType = Type.GetType(name, false, false); 462ConstructorInfo? rci = Type.DefaultBinder.BindToMethod( 478object retval = rci.Invoke(ConstructorDefault, Type.DefaultBinder, args, null); 483Type.DefaultBinder.ReorderArgumentArray(ref args, state);
System\Security\Cryptography\CryptoConfigForwarder.cs (2)
32Type t = Type.GetType(CryptoConfigTypeName, throwOnError: true)!;
System\Security\Cryptography\RSAOAEPKeyExchangeFormatter.cs (1)
62public override byte[] CreateKeyExchange(byte[] rgbData, Type? symAlgType)
System\Security\Cryptography\RSAPKCS1KeyExchangeFormatter.cs (1)
43public override byte[] CreateKeyExchange(byte[] rgbData, Type? symAlgType)
System\Security\Cryptography\XmlKeyHelper.cs (7)
273Type xDocument = Type.GetType("System.Xml.Linq.XDocument" + XmlLinqAssemblyString)!; 282Type xElement = Type.GetType("System.Xml.Linq.XElement" + XmlLinqAssemblyString)!; 286Type.EmptyTypes)!; 291Type xName = Type.GetType("System.Xml.Linq.XName" + XmlLinqAssemblyString)!;
System.Security.Cryptography.Xml (49)
System\Security\Cryptography\Xml\KeyInfo.cs (1)
134public IEnumerator GetEnumerator(Type requestedObjectType)
System\Security\Cryptography\Xml\SignedXml.cs (4)
1034Type ta = Type.GetType(signatureDescription.KeyAlgorithm!)!; 1116private static bool IsKeyTheCorrectAlgorithm(AsymmetricAlgorithm key, Type expectedType) 1118Type actualType = key.GetType();
System\Security\Cryptography\Xml\Transform.cs (4)
89public abstract Type[] InputTypes 94public abstract Type[] OutputTypes 99internal bool AcceptsType(Type inputType) 152public abstract object GetOutput(Type type);
System\Security\Cryptography\Xml\XmlDecryptionTransform.cs (5)
18private readonly Type[] _inputTypes = { typeof(Stream), typeof(XmlDocument) }; 19private readonly Type[] _outputTypes = { typeof(XmlDocument) }; 69public override Type[] InputTypes 74public override Type[] OutputTypes 273public override object GetOutput(Type type)
System\Security\Cryptography\Xml\XmlDsigBase64Transform.cs (5)
13private readonly Type[] _inputTypes = { typeof(Stream), typeof(XmlNodeList), typeof(XmlDocument) }; 14private readonly Type[] _outputTypes = { typeof(Stream) }; 22public override Type[] InputTypes 27public override Type[] OutputTypes 124public override object GetOutput(Type type)
System\Security\Cryptography\Xml\XmlDsigC14NTransform.cs (5)
11private readonly Type[] _inputTypes = { typeof(Stream), typeof(XmlDocument), typeof(XmlNodeList) }; 12private readonly Type[] _outputTypes = { typeof(Stream) }; 27public override Type[] InputTypes 32public override Type[] OutputTypes 76public override object GetOutput(Type type)
System\Security\Cryptography\Xml\XmlDsigEnvelopedSignatureTransform.cs (5)
11private readonly Type[] _inputTypes = { typeof(Stream), typeof(XmlNodeList), typeof(XmlDocument) }; 12private readonly Type[] _outputTypes = { typeof(XmlNodeList), typeof(XmlDocument) }; 36public override Type[] InputTypes 41public override Type[] OutputTypes 178public override object GetOutput(Type type)
System\Security\Cryptography\Xml\XmlDsigExcC14NTransform.cs (5)
11private readonly Type[] _inputTypes = { typeof(Stream), typeof(XmlDocument), typeof(XmlNodeList) }; 12private readonly Type[] _outputTypes = { typeof(Stream) }; 36public override Type[] InputTypes 41public override Type[] OutputTypes 113public override object GetOutput(Type type)
System\Security\Cryptography\Xml\XmlDsigXPathTransform.cs (5)
14private readonly Type[] _inputTypes = { typeof(Stream), typeof(XmlNodeList), typeof(XmlDocument) }; 15private readonly Type[] _outputTypes = { typeof(XmlNodeList) }; 25public override Type[] InputTypes 30public override Type[] OutputTypes 191public override object GetOutput(Type type)
System\Security\Cryptography\Xml\XmlDsigXsltTransform.cs (5)
15private readonly Type[] _inputTypes = { typeof(Stream), typeof(XmlDocument), typeof(XmlNodeList) }; 16private readonly Type[] _outputTypes = { typeof(Stream) }; 33public override Type[] InputTypes 41public override Type[] OutputTypes 143public override object GetOutput(Type type)
System\Security\Cryptography\Xml\XmlLicenseTransform.cs (5)
14private readonly Type[] _inputTypes = { typeof(XmlDocument) }; 15private readonly Type[] _outputTypes = { typeof(XmlDocument) }; 32public override Type[] InputTypes 37public override Type[] OutputTypes 114public override object GetOutput(Type type)
System.Security.Permissions (5)
System\Security\HostSecurityManager.cs (4)
19public virtual EvidenceBase GenerateAppDomainEvidence(Type evidenceType) { return null; } 20public virtual EvidenceBase GenerateAssemblyEvidence(Type evidenceType, Assembly assembly) { return null; } 21public virtual Type[] GetHostSuppliedAppDomainEvidenceTypes() { return null; } 22public virtual Type[] GetHostSuppliedAssemblyEvidenceTypes(Assembly assembly) { return null; }
System\Security\Permissions\ResourcePermissionBase.cs (1)
20protected Type PermissionAccessType { get; set; }
System.Security.Principal.Windows (8)
artifacts\obj\System.Security.Principal.Windows\Debug\net10.0\System.Security.Principal.Windows.notsupported.cs (8)
36public abstract bool IsValidTargetType(System.Type targetType); 40public abstract System.Security.Principal.IdentityReference Translate(System.Type targetType); 56public System.Security.Principal.IdentityReferenceCollection Translate(System.Type targetType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); } 57public System.Security.Principal.IdentityReferenceCollection Translate(System.Type targetType, bool forceSuccess) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); } 66public override bool IsValidTargetType(System.Type targetType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); } 70public override System.Security.Principal.IdentityReference Translate(System.Type targetType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); } 90public override bool IsValidTargetType(System.Type targetType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); } 95public override System.Security.Principal.IdentityReference Translate(System.Type targetType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); }
System.ServiceModel.Federation (2)
System\IdentityModel\Security\WrapperSecurityCommunicationObject.cs (2)
25internal Type GetCommunicationObjectInnerType() 30protected override Type GetCommunicationObjectType()
System.ServiceModel.NetNamedPipe.Tests (1)
NetNamedPipeBindingTest.cs (1)
19Type t = Assembly.GetAssembly(typeof(NamedPipeTransportBindingElement))
System.ServiceModel.Primitives.Tests (21)
Channels\CustomChannelTest.cs (10)
33Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) => 123Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) => 217Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) => 268Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) => 325Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) =>
Description\ContractDescriptionTest.cs (1)
184Assert.Equal<Type>(typeof(IHelloCallbackContract), contract.CallbackContractType);
Description\OperationBehaviorTest.cs (5)
101DataContractSerializer dcs = (DataContractSerializer)behavior.CreateSerializer(typeof(SurrogateTestType), nameof(SurrogateTestType), "ns", new List<Type>()); 151public object GetDeserializedObject(object obj, Type targetType) 163public object GetObjectToSerialize(object obj, Type targetType) 181public Type GetSurrogateType(Type type)
Security\SecurityUtilsTest.cs (1)
17Type t = Assembly.GetAssembly(typeof(WindowsClientCredential))
ServiceModel\MessageContractTest.4.4.0.cs (4)
151Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) => 251Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) =>
System.ServiceModel.Syndication (16)
System\ServiceModel\Syndication\Atom10FeedFormatter.cs (2)
38public Atom10FeedFormatter(Type feedTypeToCreate) : base() 72protected Type FeedType { get; }
System\ServiceModel\Syndication\Atom10ItemFormatter.cs (2)
22public Atom10ItemFormatter(Type itemTypeToCreate) : base() 64protected Type ItemType { get; }
System\ServiceModel\Syndication\AtomPub10CategoriesDocumentFormatter.cs (4)
14private readonly Type _inlineDocumentType; 16private readonly Type _referencedDocumentType; 22public AtomPub10CategoriesDocumentFormatter(Type inlineDocumentType, Type referencedDocumentType) : base()
System\ServiceModel\Syndication\AtomPub10ServiceDocumentFormatter.cs (2)
18private readonly Type _documentType; 25public AtomPub10ServiceDocumentFormatter(Type documentTypeToCreate) : base()
System\ServiceModel\Syndication\Rss20FeedFormatter.cs (2)
31public Rss20FeedFormatter(Type feedTypeToCreate) : base() 72protected Type FeedType { get; }
System\ServiceModel\Syndication\Rss20ItemFormatter.cs (2)
23public Rss20ItemFormatter(Type itemTypeToCreate) : base() 87protected Type ItemType { get; }
System\ServiceModel\Syndication\SyndicationFeedFormatter.cs (1)
500internal static SyndicationFeed CreateFeedInstance(Type feedType)
System\ServiceModel\Syndication\SyndicationItemFormatter.cs (1)
51internal static SyndicationItem CreateItemInstance(Type itemType)
System.Speech (1)
artifacts\obj\System.Speech\Debug\net10.0\System.Speech.notsupported.cs (1)
144public static System.Speech.Recognition.Grammar LoadLocalizedGrammarFromType(System.Type type, params object[] onInitParameters) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); }
System.Text.Json (557)
src\libraries\System.Text.Json\Common\JsonSerializableAttribute.cs (1)
28public JsonSerializableAttribute(Type type) { }
src\libraries\System.Text.Json\Common\JsonSourceGenerationOptionsAttribute.cs (1)
56public Type[]? Converters { get; set; }
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (25)
42public static Type? GetCompatibleGenericBaseClass(this Type type, Type? baseType) 53Type? baseTypeToCheck = type; 59Type genericTypeToCheck = baseTypeToCheck.GetGenericTypeDefinition(); 79public static Type? GetCompatibleGenericInterface(this Type type, Type? interfaceType) 90Type interfaceToCheck = type; 102foreach (Type typeToCheck in type.GetInterfaces()) 106Type genericInterfaceToCheck = typeToCheck.GetGenericTypeDefinition(); 117public static bool IsImmutableDictionaryType(this Type type) 135public static bool IsImmutableEnumerableType(this Type type) 160public static string? GetImmutableDictionaryConstructingTypeName(this Type type) 181public static string? GetImmutableEnumerableConstructingTypeName(this Type type) 213private static string GetBaseNameFromGenericType(Type genericType) 215Type genericTypeDef = genericType.GetGenericTypeDefinition(); 224public static bool IsKeyValuePair(this Type type) 229this Type type, 290Type parameterType = parameterInfo.ParameterType; 311if (Nullable.GetUnderlyingType(parameterType) is Type underlyingType && underlyingType.IsEnum) 324public static Type[] GetSortedTypeHierarchy(this Type type) 330var results = new List<Type>(); 331for (Type? current = type; current != null; current = current.BaseType)
System\ReflectionExtensions.cs (11)
15private static readonly Type s_nullableType = typeof(Nullable<>); 21public static bool IsNullableOfT(this Type type) => 24public static bool IsNullableType(this Type type) => !type.IsValueType || IsNullableOfT(type); 30public static bool IsAssignableFromInternal(this Type type, Type from) 43public static bool IsInSubtypeRelationshipWith(this Type type, Type other) => 98[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] this Type type, 99Type[] parameterTypes, 136if (member is Type type) 147Type genericTypeDef = member.DeclaringType.GetGenericTypeDefinition();
System\Text\Json\Document\JsonProperty.cs (3)
40/// This value's <see cref="Type"/> is not <see cref="JsonTokenType.PropertyName"/>. 60/// This value's <see cref="Type"/> is not <see cref="JsonTokenType.PropertyName"/>. 80/// This value's <see cref="Type"/> is not <see cref="JsonTokenType.PropertyName"/>.
System\Text\Json\Nodes\JsonValueOfT.cs (3)
79private static JsonValueKind? DetermineValueKindForType(Type type) 86if (Nullable.GetUnderlyingType(type) is Type underlyingType) 107return Type.GetTypeCode(type) switch
System\Text\Json\Schema\JsonSchemaExporter.cs (1)
27public static JsonNode GetJsonSchemaAsNode(this JsonSerializerOptions options, Type type, JsonSchemaExporterOptions? exporterOptions = null)
System\Text\Json\Serialization\Attributes\JsonConverterAttribute.cs (4)
25public JsonConverterAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type converterType) 36/// The type of the converter to create, or null if <see cref="CreateConverter(Type)"/> should be used to obtain the converter. 39public Type? ConverterType { get; } 47public virtual JsonConverter? CreateConverter(Type typeToConvert)
System\Text\Json\Serialization\Attributes\JsonDerivedTypeAttribute.cs (4)
16public JsonDerivedTypeAttribute(Type derivedType) 26public JsonDerivedTypeAttribute(Type derivedType, string typeDiscriminator) 37public JsonDerivedTypeAttribute(Type derivedType, int typeDiscriminator) 46public Type DerivedType { get; }
System\Text\Json\Serialization\Converters\CastingConverter.cs (6)
18internal override Type? KeyType => _sourceConverter.KeyType; 19internal override Type? ElementType => _sourceConverter.ElementType; 44public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 50internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value) 60public override T ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 63internal override T ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Collection\IAsyncEnumerableConverterFactory.cs (7)
20public override bool CanConvert(Type typeToConvert) => GetAsyncEnumerableInterface(typeToConvert) is not null; 22public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) 24Type? asyncEnumerableInterface = GetAsyncEnumerableInterface(typeToConvert); 27Type elementType = asyncEnumerableInterface.GetGenericArguments()[0]; 28Type converterType = typeof(IAsyncEnumerableOfTConverter<,>).MakeGenericType(typeToConvert, elementType); 32private static Type? GetAsyncEnumerableInterface(Type type)
System\Text\Json\Serialization\Converters\Collection\IAsyncEnumerableOfTConverter.cs (1)
15internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out TAsyncEnumerable value)
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactory.cs (8)
28public override bool CanConvert(Type typeToConvert) 35public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) 37Type converterType; 38Type[] genericArgs; 39Type? elementType = null; 40Type? dictionaryKeyType = null; 41Type? actualTypeToConvert; 181Type genericType;
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactoryHelpers.cs (16)
22public static MethodInfo GetImmutableEnumerableCreateRangeMethod(this Type type, Type elementType) 24Type? constructingType = GetImmutableEnumerableConstructingType(type); 46public static MethodInfo GetImmutableDictionaryCreateRangeMethod(this Type type, Type keyType, Type valueType) 48Type? constructingType = GetImmutableDictionaryConstructingType(type); 70private static Type? GetImmutableEnumerableConstructingType(Type type) 83private static Type? GetImmutableDictionaryConstructingType(Type type) 94public static bool IsNonGenericStackOrQueue(this Type type) 105Type? stackType = GetTypeIfExists(stackTypeName); 111Type? queueType = GetTypeIfExists(queueTypeName); 125private static Type? GetTypeIfExists(string name) => Type.GetType(name, false);
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (2)
19internal override Type ElementType => typeof(TElement); 63Type typeToConvert,
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (3)
59internal override Type ElementType => typeof(TValue); 61internal override Type KeyType => typeof(TKey); 74Type typeToConvert,
System\Text\Json\Serialization\Converters\Collection\MemoryConverter.cs (1)
16Type typeToConvert,
System\Text\Json\Serialization\Converters\Collection\MemoryConverterFactory.cs (5)
13public override bool CanConvert(Type typeToConvert) 20Type typeDef = typeToConvert.GetGenericTypeDefinition(); 24public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) 28Type converterType = typeToConvert.GetGenericTypeDefinition() == typeof(Memory<>) ? 31Type elementType = typeToConvert.GetGenericArguments()[0];
System\Text\Json\Serialization\Converters\Collection\ReadOnlyMemoryConverter.cs (1)
16Type typeToConvert,
System\Text\Json\Serialization\Converters\Collection\RootLevelListConverter.cs (2)
18internal override Type? ElementType => typeof(T); 26internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out List<T?>? value)
System\Text\Json\Serialization\Converters\FSharp\FSharpOptionConverter.cs (3)
14internal override Type? ElementType => typeof(TElement); 33internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out TOption? value) 83public override TOption? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\FSharp\FSharpTypeConverterFactory.cs (7)
21public override bool CanConvert(Type typeToConvert) => 29public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) 33Type elementType; 34Type converterFactoryType; 58Type[] genericArgs = typeToConvert.GetGenericArguments(); 59Type keyType = genericArgs[0]; 60Type valueType = genericArgs[1];
System\Text\Json\Serialization\Converters\FSharp\FSharpValueOptionConverter.cs (3)
14internal override Type? ElementType => typeof(TElement); 33internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out TValueOption value) 85public override TValueOption Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\JsonMetadataServicesConverter.cs (3)
23internal override Type? KeyType => Converter.KeyType; 24internal override Type? ElementType => Converter.ElementType; 48internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value)
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (1)
23public override JsonArray? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (1)
39public override JsonNode? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (2)
12public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) 33public override bool CanConvert(Type typeToConvert) => typeof(JsonNode).IsAssignableFrom(typeToConvert);
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (1)
48public override JsonObject? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Node\JsonValueConverter.cs (1)
23public override JsonValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (6)
20public sealed override object ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 26internal sealed override object ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 56Type runtimeType = value.GetType(); 81public override object? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 100public override object? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 111internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out object? value)
System\Text\Json\Serialization\Converters\Object\ObjectConverterFactory.cs (6)
29public override bool CanConvert(Type typeToConvert) 41public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) 44Type converterType; 70Type placeHolderType = JsonTypeInfo.ObjectType; 71Type[] typeArguments = new Type[JsonConstants.UnboxedParameterCountThreshold + 1];
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (1)
20internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, [MaybeNullWhen(false)] out T value)
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (1)
24internal sealed override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, [MaybeNullWhen(false)] out T value)
System\Text\Json\Serialization\Converters\Value\BooleanConverter.cs (2)
13public override bool Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 23internal override bool ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\ByteArrayConverter.cs (1)
10public override byte[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\ByteConverter.cs (2)
17public override byte Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 27internal override byte ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (2)
13public override char Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 47internal override char ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (2)
15public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 25internal override DateOnly ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\DateTimeConverter.cs (2)
11public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 21internal override DateTime ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\DateTimeOffsetConverter.cs (2)
11public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 21internal override DateTimeOffset ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\DecimalConverter.cs (2)
16public override decimal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 26internal override decimal ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\DoubleConverter.cs (2)
17public override double Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 27internal override double ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (3)
19private static readonly TypeCode s_enumTypeCode = Type.GetTypeCode(typeof(T)); 102public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 181internal override T ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\EnumConverterFactory.cs (6)
17public override bool CanConvert(Type type) 22public override JsonConverter CreateConverter(Type type, JsonSerializerOptions options) 31public static JsonConverter Create(Type enumType, EnumConverterOptions converterOptions, JsonNamingPolicy? namingPolicy, JsonSerializerOptions options) 33if (!Helpers.IsSupportedTypeCode(Type.GetTypeCode(enumType))) 39Type converterType = typeof(EnumConverter<>).MakeGenericType(enumType); 59if (!IsSupportedTypeCode(Type.GetTypeCode(typeof(T))))
System\Text\Json\Serialization\Converters\Value\GuidConverter.cs (2)
12public override Guid Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 22internal override Guid ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (2)
21public override Half Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 72internal override Half ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (2)
21public override Int128 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 66internal override Int128 ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\Int16Converter.cs (2)
17public override short Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 28internal override short ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\Int32Converter.cs (2)
17public override int Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 28internal override int ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\Int64Converter.cs (2)
17public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 27internal override long ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\JsonDocumentConverter.cs (1)
13public override JsonDocument Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\JsonElementConverter.cs (1)
11public override JsonElement Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (1)
26public sealed override T ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\MemoryByteConverter.cs (1)
13public override Memory<byte> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\NullableConverter.cs (3)
10internal override Type? ElementType => typeof(T); 28internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value) 62public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\NullableConverterFactory.cs (6)
14public override bool CanConvert(Type typeToConvert) 19public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) 23Type valueTypeToConvert = typeToConvert.GetGenericArguments()[0]; 35public static JsonConverter CreateValueConverter(Type valueTypeToConvert, JsonConverter valueConverter) 50private static Type GetNullableConverterType(Type valueTypeToConvert) => typeof(NullableConverter<>).MakeGenericType(valueTypeToConvert);
System\Text\Json\Serialization\Converters\Value\ReadOnlyMemoryByteConverter.cs (1)
13public override ReadOnlyMemory<byte> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\SByteConverter.cs (2)
17public override sbyte Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 27internal override sbyte ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\SingleConverter.cs (2)
18public override float Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 28internal override float ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\StringConverter.cs (2)
12public override string? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 30internal override string ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (2)
17public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 27internal override TimeOnly ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (2)
17public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 27internal override TimeSpan ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (2)
21public override UInt128 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 66internal override UInt128 ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\UInt16Converter.cs (2)
17public override ushort Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 28internal override ushort ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\UInt32Converter.cs (2)
17public override uint Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 28internal override uint ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\UInt64Converter.cs (2)
17public override ulong Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 27internal override ulong ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverter.cs (1)
17public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverterFactory.cs (3)
14public override bool CanConvert(Type type) 33public override JsonConverter CreateConverter(Type type, JsonSerializerOptions options) 39internal static JsonConverter CreateUnsupportedConverterForType(Type type, string? errorMessage = null)
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (2)
12public override Uri? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 28internal override Uri ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (2)
20public override Version? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 103internal override Version ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\JsonConverter.cs (9)
31public abstract Type? Type { get; } 38public abstract bool CanConvert(Type typeToConvert); 161internal virtual Type? ElementType => null; 163internal virtual Type? KeyType => null; 202internal abstract object? ReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options); 203internal abstract bool OnTryReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out object? value); 204internal abstract bool TryReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out object? value); 205internal abstract object? ReadAsPropertyNameAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options); 206internal abstract object? ReadAsPropertyNameCoreAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options);
System\Text\Json\Serialization\JsonConverter.MetadataHandling.cs (1)
83Type runtimeType = value.GetType();
System\Text\Json\Serialization\JsonConverterFactory.cs (10)
25/// Create a converter for the provided <see cref="System.Type"/>. 27/// <param name="typeToConvert">The <see cref="System.Type"/> being converted.</param> 33public abstract JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options); 35internal JsonConverter GetConverterInternal(Type typeToConvert, JsonSerializerOptions options) 53internal sealed override object? ReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 62Type typeToConvert, 74Type typeToConvert, 84internal sealed override object? ReadAsPropertyNameAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 91internal sealed override object? ReadAsPropertyNameCoreAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 142public sealed override Type? Type => null;
System\Text\Json\Serialization\JsonConverterOfT.cs (15)
14/// <typeparam name="T">The <see cref="System.Type"/> to convert.</typeparam> 48public override bool CanConvert(Type typeToConvert) 129internal virtual bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value) 142/// <param name="typeToConvert">The <see cref="System.Type"/> being converted.</param> 146public abstract T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options); 148internal bool TryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value, out bool isPopulatedValue) 282internal sealed override bool OnTryReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out object? value) 289internal sealed override bool TryReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out object? value) 296internal sealed override object? ReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 302internal sealed override object? ReadAsPropertyNameAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 308internal sealed override object? ReadAsPropertyNameCoreAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 497public sealed override Type Type { get; } = typeof(T); 587/// <param name="typeToConvert">The <see cref="System.Type"/> being converted.</param> 591public virtual T ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 603internal virtual T ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\JsonNumberEnumConverter.cs (2)
26public override bool CanConvert(Type typeToConvert) => typeToConvert == typeof(TEnum); 29public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\JsonResumableConverterOfT.cs (1)
17public sealed override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (4)
33private static JsonTypeInfo GetTypeInfo(JsonSerializerOptions? options, Type inputType) 53private static JsonTypeInfo GetTypeInfo(JsonSerializerContext context, Type inputType) 68private static void ValidateInputType(object? value, Type inputType) 77Type runtimeType = value.GetType();
System\Text\Json\Serialization\JsonSerializer.Read.Document.cs (3)
62public static object? Deserialize(this JsonDocument document, Type returnType, JsonSerializerOptions? options = null) 173/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method of the provided 176public static object? Deserialize(this JsonDocument document, Type returnType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Read.Element.cs (3)
54public static object? Deserialize(this JsonElement element, Type returnType, JsonSerializerOptions? options = null) 145/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method of the provided 148public static object? Deserialize(this JsonElement element, Type returnType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (2)
117Type underlyingIDictionaryType = jsonPropertyInfo.PropertyType.GetCompatibleGenericInterface(typeof(IDictionary<,>))!; 118Type[] genericArgs = underlyingIDictionaryType.GetGenericArguments();
System\Text\Json\Serialization\JsonSerializer.Read.Node.cs (3)
52public static object? Deserialize(this JsonNode? node, Type returnType, JsonSerializerOptions? options = null) 136/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method of the provided 139public static object? Deserialize(this JsonNode? node, Type returnType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Read.Span.cs (3)
58public static object? Deserialize(ReadOnlySpan<byte> utf8Json, Type returnType, JsonSerializerOptions? options = null) 133/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method on the provided <paramref name="context"/> 136public static object? Deserialize(ReadOnlySpan<byte> utf8Json, Type returnType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (6)
120Type returnType, 161Type returnType, 337/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method on the provided <paramref name="context"/> 342Type returnType, 384/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method on the provided <paramref name="context"/> 389Type returnType,
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (6)
119public static object? Deserialize([StringSyntax(StringSyntaxAttribute.Json)] string json, Type returnType, JsonSerializerOptions? options = null) 163public static object? Deserialize([StringSyntax(StringSyntaxAttribute.Json)] ReadOnlySpan<char> json, Type returnType, JsonSerializerOptions? options = null) 351/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method of the provided 357public static object? Deserialize([StringSyntax(StringSyntaxAttribute.Json)] string json, Type returnType, JsonSerializerContext context) 405/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method of the provided 411public static object? Deserialize([StringSyntax(StringSyntaxAttribute.Json)] ReadOnlySpan<char> json, Type returnType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (3)
112public static object? Deserialize(ref Utf8JsonReader reader, Type returnType, JsonSerializerOptions? options = null) 245/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method on the provided <paramref name="context"/> 271public static object? Deserialize(ref Utf8JsonReader reader, Type returnType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Write.ByteArray.cs (3)
54Type inputType, 123/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method of the provided 126public static byte[] SerializeToUtf8Bytes(object? value, Type inputType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Write.Document.cs (3)
51public static JsonDocument SerializeToDocument(object? value, Type inputType, JsonSerializerOptions? options = null) 114/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method of the provided 120public static JsonDocument SerializeToDocument(object? value, Type inputType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Write.Element.cs (3)
51public static JsonElement SerializeToElement(object? value, Type inputType, JsonSerializerOptions? options = null) 114/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method of the provided 120public static JsonElement SerializeToElement(object? value, Type inputType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Write.Node.cs (3)
52public static JsonNode? SerializeToNode(object? value, Type inputType, JsonSerializerOptions? options = null) 115/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method of the provided 121public static JsonNode? SerializeToNode(object? value, Type inputType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Write.Pipe.cs (2)
135Type inputType, 179Type inputType,
System\Text\Json\Serialization\JsonSerializer.Write.Stream.cs (4)
110Type inputType, 146Type inputType, 303Type inputType, 341Type inputType,
System\Text\Json\Serialization\JsonSerializer.Write.String.cs (7)
54/// encoding since the implementation internally uses UTF-8. See also <see cref="SerializeToUtf8Bytes(object?, Type, JsonSerializerOptions?)"/> 55/// and <see cref="SerializeAsync(IO.Stream, object?, Type, JsonSerializerOptions?, Threading.CancellationToken)"/>. 61Type inputType, 133/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method of the provided 140/// encoding since the implementation internally uses UTF-8. See also <see cref="SerializeToUtf8Bytes(object?, Type, JsonSerializerContext)"/> 141/// and <see cref="SerializeAsync(IO.Stream, object?, Type, JsonSerializerContext, Threading.CancellationToken)"/>. 143public static string Serialize(object? value, Type inputType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Write.Utf8JsonWriter.cs (3)
64Type inputType, 147/// The <see cref="JsonSerializerContext.GetTypeInfo(Type)"/> method of the provided 150public static void Serialize(Utf8JsonWriter writer, object? value, Type inputType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializerContext.cs (2)
108public abstract JsonTypeInfo? GetTypeInfo(Type type); 110JsonTypeInfo? IJsonTypeInfoResolver.GetTypeInfo(Type type, JsonSerializerOptions options)
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (16)
55public JsonTypeInfo GetTypeInfo(Type type) 83public bool TryGetTypeInfo(Type type, [NotNullWhen(true)] out JsonTypeInfo? typeInfo) 104Type type, 138internal bool TryGetTypeInfoCached(Type type, [NotNullWhen(true)] out JsonTypeInfo? typeInfo) 153internal JsonTypeInfo GetTypeInfoForRootType(Type type, bool fallBackToNearestAncestorType = false) 169Type runtimeType = rootValue.GetType(); 215private readonly ConcurrentDictionary<Type, CacheEntry> _cache = new(); 235public JsonTypeInfo? GetOrAddTypeInfo(Type type, bool fallBackToNearestAncestorType = false) 243public bool TryGetTypeInfo(Type type, [NotNullWhen(true)] out JsonTypeInfo? typeInfo) 255private CacheEntry GetOrAddCacheEntry(Type type) 264private static CacheEntry CreateCacheEntry(Type type, CachingContext context) 278private JsonTypeInfo? FallBackToNearestAncestor(Type type, CacheEntry entry) 291private CacheEntry? DetermineNearestAncestor(Type type, CacheEntry entry) 307Type? candidateType = null; 309for (Type? current = type.BaseType; current != null; current = current.BaseType) 327foreach (Type interfaceType in type.GetInterfaces())
System\Text\Json\Serialization\JsonSerializerOptions.Converters.cs (5)
41public JsonConverter GetConverter(Type typeToConvert) 64internal JsonConverter GetConverterInternal(Type typeToConvert) 70internal JsonConverter? GetConverterFromList(Type typeToConvert) 87internal JsonConverter? ExpandConverterFactory(JsonConverter? converter, Type typeToConvert) 97internal static void CheckConverterNullabilityIsSameAsPropertyType(JsonConverter converter, Type propertyType)
System\Text\Json\Serialization\JsonSerializerOptions.cs (1)
984private JsonTypeInfo? GetTypeInfoNoCaching(Type type)
System\Text\Json\Serialization\JsonSerializerOptionsUpdateHandler.cs (1)
18public static void ClearCache(Type[]? types)
System\Text\Json\Serialization\JsonStringEnumConverter.cs (4)
50public sealed override bool CanConvert(Type typeToConvert) => typeToConvert == typeof(TEnum); 53public sealed override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) 106public sealed override bool CanConvert(Type typeToConvert) 112public sealed override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (12)
15private static Dictionary<Type, JsonConverter>? s_defaultSimpleConverters; 41private static Dictionary<Type, JsonConverter> GetDefaultSimpleConverters() 44var converters = new Dictionary<Type, JsonConverter>(NumberOfSimpleConverters); 94private static JsonConverter GetBuiltInConverter(Type typeToConvert) 120internal static bool TryGetDefaultSimpleConverter(Type typeToConvert, [NotNullWhen(true)] out JsonConverter? converter) 133private static JsonConverter? GetCustomConverterForMember(Type typeToConvert, MemberInfo memberInfo, JsonSerializerOptions options) 144internal static JsonConverter GetConverterForType(Type typeToConvert, JsonSerializerOptions options, bool resolveJsonConverterAttribute = true) 175private static JsonConverter GetConverterFromAttribute(JsonConverterAttribute converterAttribute, Type typeToConvert, MemberInfo? memberInfo, JsonSerializerOptions options) 179Type declaringType = memberInfo?.DeclaringType ?? typeToConvert; 180Type? converterType = converterAttribute.ConverterType; 192ConstructorInfo? ctor = converterType.GetConstructor(Type.EmptyTypes); 204Type? underlyingType = Nullable.GetUnderlyingType(typeToConvert);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.cs (3)
51public virtual JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options) 86private static JsonTypeInfo CreateJsonTypeInfo(Type type, JsonSerializerOptions options) 96/// The modifier list will be rendered immutable after the first <see cref="GetTypeInfo(Type, JsonSerializerOptions)"/> invocation.
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (10)
46private static JsonTypeInfo CreateTypeInfoCore(Type type, JsonConverter converter, JsonSerializerOptions options) 108foreach (Type currentType in typeInfo.Type.GetSortedTypeHierarchy()) 142Type currentType, 202Type typeToConvert, 224Type typeToConvert, 258private static JsonNumberHandling? GetNumberHandlingForType(Type type) 264private static JsonObjectCreationHandling? GetObjectCreationHandlingForType(Type type) 270private static JsonUnmappedMemberHandling? GetUnmappedMemberHandling(Type type) 451private static Func<object>? DetermineCreateObjectDelegate(Type type, JsonConverter converter) 463defaultCtor ??= type.GetConstructor(BindingFlags.Public | BindingFlags.Instance, binder: null, Type.EmptyTypes, modifiers: null);
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (13)
46private readonly Type _compilationMappingAttributeType; 49private readonly Type? _fsharpOptionType; 50private readonly Type? _fsharpValueOptionType; 51private readonly Type? _fsharpListType; 52private readonly Type? _fsharpSetType; 53private readonly Type? _fsharpMapType; 65public static bool IsFSharpType(Type type) 101Type compilationMappingAttributeType = fsharpCoreAssembly.GetType(CompilationMappingAttributeTypeName)!; 118public FSharpKind DetectFSharpKind(Type type) 129Type genericType = type.GetGenericTypeDefinition(); 206private Attribute? GetFSharpCompilationMappingAttribute(Type type) 213private static Assembly? GetFSharpCoreAssembly(Type type) 217Type attributeType = attr.GetType();
System\Text\Json\Serialization\Metadata\IJsonTypeInfoResolver.cs (1)
20JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options);
System\Text\Json\Serialization\Metadata\JsonDerivedType.cs (6)
17public JsonDerivedType(Type derivedType) 28public JsonDerivedType(Type derivedType, int typeDiscriminator) 39public JsonDerivedType(Type derivedType, string typeDiscriminator) 45internal JsonDerivedType(Type derivedType, object? typeDiscriminator) 55public Type DerivedType { get; } 62internal void Deconstruct(out Type derivedType, out object? typeDiscriminator)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.cs (1)
34Type? declaringType = propertyInfo.DeclaringType;
System\Text\Json\Serialization\Metadata\JsonParameterInfo.cs (2)
30public Type DeclaringType => MatchingProperty.DeclaringType; 40public Type ParameterType => MatchingProperty.PropertyType;
System\Text\Json\Serialization\Metadata\JsonParameterInfoValues.cs (1)
25public Type ParameterType { get; init; } = null!;
System\Text\Json\Serialization\Metadata\JsonPolymorphismOptions.cs (1)
101internal static JsonPolymorphismOptions? CreateFromAttributeDeclarations(Type baseType)
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (5)
374internal JsonPropertyInfo(Type declaringType, Type propertyType, JsonTypeInfo? declaringTypeInfo, JsonSerializerOptions options) 402public Type DeclaringType { get; } 407public Type PropertyType { get; } 701Type potentialNumberType;
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (1)
19internal JsonPropertyInfo(Type declaringType, JsonTypeInfo? declaringTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Metadata\JsonPropertyInfoValuesOfT.cs (1)
34public Type DeclaringType { get; init; } = null!;
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (1)
15internal static readonly Type ObjectType = typeof(object);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (15)
42internal JsonTypeInfo(Type type, JsonConverter converter, JsonSerializerOptions options) 62public Type? ElementType { get; } 72public Type? KeyType { get; } 443public Type Type { get; } 938public static JsonTypeInfo CreateJsonTypeInfo(Type type, JsonSerializerOptions options) 961internal static JsonTypeInfo CreateJsonTypeInfo(Type type, JsonConverter converter, JsonSerializerOptions options) 973Type jsonTypeInfoType = typeof(JsonTypeInfo<>).MakeGenericType(type); 994public JsonPropertyInfo CreateJsonPropertyInfo(Type propertyType, string name) 1020internal JsonPropertyInfo CreatePropertyUsingReflection(Type propertyType, Type? declaringType) 1035Type propertyInfoType = typeof(JsonPropertyInfo<>).MakeGenericType(propertyType); 1037parameterTypes: [typeof(Type), typeof(JsonTypeInfo), typeof(JsonSerializerOptions)], 1048private protected abstract JsonPropertyInfo CreateJsonPropertyInfo(JsonTypeInfo declaringTypeInfo, Type? declaringType, JsonSerializerOptions options); 1071private protected readonly struct ParameterLookupKey(Type type, string name) : IEquatable<ParameterLookupKey> 1073public Type Type { get; } = type;
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (1)
150private protected override JsonPropertyInfo CreateJsonPropertyInfo(JsonTypeInfo declaringTypeInfo, Type? declaringType, JsonSerializerOptions options)
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolver.cs (1)
105public JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options) => null;
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverChain.cs (1)
13public JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options)
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverWithAddedModifiers.cs (1)
29public JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options)
System\Text\Json\Serialization\Metadata\MemberAccessor.cs (1)
12public abstract Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? constructorInfo);
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (14)
18private readonly ConcurrentDictionary<Type, DerivedJsonTypeInfo?> _typeToDiscriminatorId = new(); 22public PolymorphicTypeResolver(JsonSerializerOptions options, JsonPolymorphismOptions polymorphismOptions, Type baseType, bool converterCanHaveMetadata) 35foreach ((Type derivedType, object? typeDiscriminator) in polymorphismOptions.DerivedTypes) 112public Type BaseType { get; } 119public bool TryGetDerivedJsonTypeInfo(Type runtimeType, [NotNullWhen(true)] out JsonTypeInfo? jsonTypeInfo, out object? typeDiscriminator) 185public static bool IsSupportedPolymorphicBaseType(Type? type) => 193public static bool IsSupportedDerivedType(Type baseType, Type? derivedType) => 199private DerivedJsonTypeInfo? CalculateNearestAncestor(Type type) 213for (Type? candidate = type.BaseType; BaseType.IsAssignableFrom(candidate); candidate = candidate.BaseType) 227foreach (Type interfaceTy in type.GetInterfaces()) 267for (Type? candidate = typeInfo.Type.BaseType; candidate != null; candidate = candidate.BaseType) 279foreach (Type interfaceType in typeInfo.Type.GetInterfaces()) 312static JsonTypeInfo? ResolveAncestorTypeInfo(Type type, JsonSerializerOptions options)
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.cs (2)
14private readonly Cache<(string id, Type declaringType, MemberInfo? member)> _cache; 31public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? ctorInfo) =>
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (31)
21public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? constructorInfo) 39Type.EmptyTypes, 76Type? type = constructor.DeclaringType; 96Type paramType = parameters[i].ParameterType; 115private static DynamicMethod? CreateParameterizedConstructor(ConstructorInfo constructor, Type parameterType1, Type parameterType2, Type parameterType3, Type parameterType4) 117Type? type = constructor.DeclaringType; 160[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type collectionType) 186private static DynamicMethod CreateImmutableEnumerableCreateRangeDelegate(Type collectionType, Type elementType, Type enumerableType) 210private static DynamicMethod CreateImmutableDictionaryCreateRangeDelegate(Type collectionType, Type keyType, Type valueType, Type enumerableType) 233private static DynamicMethod CreatePropertyGetter(PropertyInfo propertyInfo, Type runtimePropertyType) 238Type? declaringType = propertyInfo.DeclaringType; 241Type declaredPropertyType = propertyInfo.PropertyType; 279private static DynamicMethod CreatePropertySetter(PropertyInfo propertyInfo, Type runtimePropertyType) 284Type? declaringType = propertyInfo.DeclaringType; 287Type declaredPropertyType = propertyInfo.PropertyType; 317private static DynamicMethod CreateFieldGetter(FieldInfo fieldInfo, Type runtimeFieldType) 319Type? declaringType = fieldInfo.DeclaringType; 322Type declaredFieldType = fieldInfo.FieldType; 351private static DynamicMethod CreateFieldSetter(FieldInfo fieldInfo, Type runtimeFieldType) 353Type? declaringType = fieldInfo.DeclaringType; 356Type declaredFieldType = fieldInfo.FieldType; 379private static DynamicMethod CreateGetterMethod(string memberName, Type memberType) => 387private static DynamicMethod CreateSetterMethod(string memberName, Type memberType) =>
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (5)
19public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? ctorInfo) 41Type type = typeof(T); 76Type type = typeof(T); 117Type collectionType = typeof(TCollection); 118Type elementType = JsonTypeInfo.ObjectType;
System\Text\Json\Serialization\WriteStackFrame.cs (1)
118public JsonTypeInfo InitializePolymorphicReEntry(Type runtimeType, JsonSerializerOptions options)
System\Text\Json\ThrowHelper.cs (1)
63public static void ThrowArgumentOutOfRangeException_JsonConverterFactory_TypeNotSupported(Type typeToConvert)
System\Text\Json\ThrowHelper.Node.cs (3)
75public static void ThrowInvalidOperationException_NodeUnableToConvert(Type sourceType, Type destinationType) 81public static void ThrowInvalidOperationException_NodeUnableToConvertElement(JsonValueKind valueKind, Type destinationType)
System\Text\Json\ThrowHelper.Serialization.cs (75)
20public static void ThrowArgumentException_DeserializeWrongType(Type type, object value) 32public static void ThrowNotSupportedException_SerializationNotSupported(Type propertyType) 38public static void ThrowNotSupportedException_TypeRequiresAsyncSerialization(Type propertyType) 44public static void ThrowNotSupportedException_DictionaryKeyTypeNotSupported(Type keyType, JsonConverter converter) 50public static void ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType) 56public static void ThrowInvalidCastException_DeserializeUnableToAssignValue(Type typeOfValue, Type declaredType) 62public static void ThrowInvalidOperationException_DeserializeUnableToAssignNull(Type declaredType) 68public static void ThrowJsonException_PropertyGetterDisallowNull(string propertyName, Type declaringType) 74public static void ThrowJsonException_PropertySetterDisallowNull(string propertyName, Type declaringType) 80public static void ThrowJsonException_ConstructorParameterDisallowNull(string parameterName, Type declaringType) 152public static void ThrowArgumentException_CannotSerializeInvalidType(string paramName, Type typeToConvert, Type? declaringType, string? propertyName) 165public static void ThrowInvalidOperationException_CannotSerializeInvalidType(Type typeToConvert, Type? declaringType, MemberInfo? memberInfo) 178public static void ThrowInvalidOperationException_SerializationConverterNotCompatible(Type converterType, Type type) 184public static void ThrowInvalidOperationException_ResolverTypeNotCompatible(Type requestedType, Type actualType) 208public static void ThrowInvalidOperationException_SerializationConverterOnAttributeInvalid(Type classType, MemberInfo? memberInfo) 220public static void ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(Type classTypeAttributeIsOn, MemberInfo? memberInfo, Type typeToConvert) 267public static void ThrowInvalidOperationException_SerializerPropertyNameConflict(Type type, string propertyName) 333public static void ThrowInvalidOperationException_SerializerConverterFactoryReturnsNull(Type converterType) 339public static void ThrowInvalidOperationException_SerializerConverterFactoryReturnsJsonConverterFactorty(Type converterType) 346Type parentType, 361public static void ThrowInvalidOperationException_ConstructorParameterIncompleteBinding(Type parentType) 373public static void ThrowInvalidOperationException_JsonIncludeOnInaccessibleProperty(string memberName, Type declaringType) 379public static void ThrowInvalidOperationException_IgnoreConditionOnValueTypeInvalid(string clrPropertyName, Type propertyDeclaringType) 392public static void ThrowInvalidOperationException_ConverterCanConvertMultipleTypes(Type runtimePropertyType, JsonConverter jsonConverter) 418public static void ThrowInvalidOperationException_JsonTypeInfoOnDeserializingCallbacksNotSupported(Type type) 424public static void ThrowInvalidOperationException_CreateObjectConverterNotCompatible(Type type) 481Type propertyType = state.Current.JsonPropertyInfo?.PropertyType ?? state.Current.JsonTypeInfo.Type; 524public static void ThrowInvalidOperationException_SerializationDuplicateAttribute(Type attribute, MemberInfo memberInfo) 526string location = memberInfo is Type type ? type.ToString() : $"{memberInfo.DeclaringType}.{memberInfo.Name}"; 531public static void ThrowInvalidOperationException_SerializationDuplicateTypeAttribute(Type classType, Type attribute) 537public static void ThrowInvalidOperationException_SerializationDuplicateTypeAttribute<TAttribute>(Type classType) 543public static void ThrowInvalidOperationException_ExtensionDataConflictsWithUnmappedMemberHandling(Type classType, JsonPropertyInfo jsonPropertyInfo) 575Type propertyType = state.Current.JsonPropertyInfo?.PropertyType ?? state.Current.JsonTypeInfo.Type; 603Type propertyType = state.Current.JsonPropertyInfo?.PropertyType ?? state.Current.JsonTypeInfo.Type; 623Type type = typeInfo.Type; 650public static void ThrowNotSupportedException_CannotPopulateCollection(Type type, ref Utf8JsonReader reader, scoped ref ReadStack state) 694public static void ThrowJsonException_UnmappedJsonProperty(Type type, string unmappedPropertyName) 748public static void ThrowJsonException_MetadataInvalidReferenceToValueType(Type propertyType) 754public static void ThrowJsonException_MetadataInvalidPropertyInArrayMetadata(scoped ref ReadStack state, Type propertyType, in Utf8JsonReader reader) 765public static void ThrowJsonException_MetadataPreservedArrayValuesNotFound(scoped ref ReadStack state, Type propertyType) 776public static void ThrowJsonException_MetadataCannotParsePreservedObjectIntoImmutable(Type propertyType) 782public static void ThrowInvalidOperationException_MetadataReferenceOfTypeCannotBeAssignedToType(string referenceId, Type currentType, Type typeToConvert) 813public static void ThrowNotSupportedException_NoMetadataForType(Type type, IJsonTypeInfoResolver? resolver) 818public static NotSupportedException GetNotSupportedException_AmbiguousMetadataForType(Type type, Type match1, Type match2) 824public static void ThrowNotSupportedException_ConstructorContainsNullParameterNames(Type declaringType) 830public static void ThrowInvalidOperationException_NoMetadataForType(Type type, IJsonTypeInfoResolver? resolver) 835public static Exception GetInvalidOperationException_NoMetadataForTypeProperties(IJsonTypeInfoResolver? resolver, Type type) 841public static void ThrowInvalidOperationException_NoMetadataForTypeProperties(IJsonTypeInfoResolver? resolver, Type type) 853public static void ThrowNotSupportedException_BaseConverterDoesNotSupportMetadata(Type derivedType) 859public static void ThrowNotSupportedException_DerivedConverterDoesNotSupportMetadata(Type derivedType) 865public static void ThrowNotSupportedException_RuntimeTypeNotSupported(Type baseType, Type runtimeType) 871public static void ThrowNotSupportedException_RuntimeTypeDiamondAmbiguity(Type baseType, Type runtimeType, Type derivedType1, Type derivedType2) 877public static void ThrowInvalidOperationException_TypeDoesNotSupportPolymorphism(Type baseType) 883public static void ThrowInvalidOperationException_DerivedTypeNotSupported(Type baseType, Type derivedType) 889public static void ThrowInvalidOperationException_DerivedTypeIsAlreadySpecified(Type baseType, Type derivedType) 895public static void ThrowInvalidOperationException_TypeDicriminatorIdIsAlreadySpecified(Type baseType, object typeDiscriminator) 907public static void ThrowInvalidOperationException_PropertyConflictsWithMetadataPropertyName(Type type, string propertyName) 913public static void ThrowInvalidOperationException_PolymorphicTypeConfigurationDoesNotSpecifyDerivedTypes(Type baseType) 919public static void ThrowInvalidOperationException_UnsupportedEnumIdentifier(Type enumType, string? enumName)
System.Text.Json.SourceGeneration (6)
Helpers\KnownTypeSymbols.cs (1)
345private INamedTypeSymbol? GetOrResolveType(Type type, ref Option<INamedTypeSymbol?> field)
Helpers\RoslynExtensions.cs (1)
21public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type)
JsonSourceGenerator.Parser.cs (1)
1848public required ITypeSymbol Type { get; init; }
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
src\libraries\System.Text.Json\Common\JsonSerializableAttribute.cs (1)
28public JsonSerializableAttribute(Type type) { }
src\libraries\System.Text.Json\Common\JsonSourceGenerationOptionsAttribute.cs (1)
56public Type[]? Converters { get; set; }
System.Text.RegularExpressions (88)
System\Text\RegularExpressions\RegexAssemblyCompiler.cs (13)
66Type runnerType = regexRunnerTypeBuilder.CreateType()!; 72Type regexRunnerFactoryType = regexRunnerFactoryTypeBuilder.CreateType()!; 76ConstructorBuilder defaultCtorBuilder = regexTypeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, Type.EmptyTypes); 85_ilg = regexTypeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new Type[] { typeof(TimeSpan) }).GetILGenerator(); 92private void GenerateCreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type type) 95_ilg!.Emit(OpCodes.Newobj, type.GetConstructor(Type.EmptyTypes)!); 102[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type regexRunnerFactoryType, 113_ilg!.Emit(OpCodes.Call, typeof(Regex).GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, Type.EmptyTypes, Array.Empty<ParameterModifier>())!); 121_ilg!.Emit(OpCodes.Newobj, regexRunnerFactoryType.GetConstructor(Type.EmptyTypes)!); 196_ilg!.Emit(OpCodes.Newobj, typeof(Hashtable).GetConstructor(Type.EmptyTypes)!); 245[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type inheritFromClass) 257private static ILGenerator DefineMethod(TypeBuilder typeBuilder, string methname, Type[]? parameterTypes, Type? returnType, out MethodBuilder builder)
System\Text\RegularExpressions\RegexCompiler.cs (71)
68private static MethodInfo SpanIndexOfCharMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOf", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 69private static MethodInfo SpanIndexOfSpanMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOf", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char)); 71private static MethodInfo SpanIndexOfAnyCharCharMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAny", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 72private static MethodInfo SpanIndexOfAnyCharCharCharMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAny", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 73private static MethodInfo SpanIndexOfAnySpanMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAny", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char)); 74private static MethodInfo SpanIndexOfAnySearchValuesMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAny", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(SearchValues<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char)); 76private static MethodInfo SpanIndexOfAnyExceptCharMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAnyExcept", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 77private static MethodInfo SpanIndexOfAnyExceptCharCharMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAnyExcept", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 78private static MethodInfo SpanIndexOfAnyExceptCharCharCharMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAnyExcept", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 79private static MethodInfo SpanIndexOfAnyExceptSpanMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAnyExcept", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char)); 80private static MethodInfo SpanIndexOfAnyExceptSearchValuesMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAnyExcept", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(SearchValues<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char)); 81private static MethodInfo SpanIndexOfAnyInRangeMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAnyInRange", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 82private static MethodInfo SpanIndexOfAnyExceptInRangeMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAnyExceptInRange", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 83private static MethodInfo SpanLastIndexOfCharMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOf", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 84private static MethodInfo SpanLastIndexOfAnyCharCharMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOfAny", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 85private static MethodInfo SpanLastIndexOfAnyCharCharCharMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOfAny", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 86private static MethodInfo SpanLastIndexOfAnySpanMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOfAny", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char)); 87private static MethodInfo SpanLastIndexOfAnySearchValuesMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOfAny", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(SearchValues<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char)); 88private static MethodInfo SpanLastIndexOfSpanMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOf", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char)); 89private static MethodInfo SpanLastIndexOfAnyExceptCharMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOfAnyExcept", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 90private static MethodInfo SpanLastIndexOfAnyExceptCharCharMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOfAnyExcept", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 91private static MethodInfo SpanLastIndexOfAnyExceptCharCharCharMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOfAnyExcept", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 92private static MethodInfo SpanLastIndexOfAnyExceptSpanMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOfAnyExcept", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char)); 93private static MethodInfo SpanLastIndexOfAnyExceptSearchValuesMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOfAnyExcept", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(SearchValues<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char)); 94private static MethodInfo SpanLastIndexOfAnyInRangeMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOfAnyInRange", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 95private static MethodInfo SpanLastIndexOfAnyExceptInRangeMethod => field ??= typeof(MemoryExtensions).GetMethod("LastIndexOfAnyExceptInRange", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0)])!.MakeGenericMethod(typeof(char)); 98private static MethodInfo SpanStartsWithSpanMethod => field ??= typeof(MemoryExtensions).GetMethod("StartsWith", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char)); 104private static MethodInfo MemoryMarshalGetArrayDataReferenceSearchValuesMethod => field ??= typeof(MemoryMarshal).GetMethod("GetArrayDataReference", [Type.MakeGenericMethodParameter(0).MakeArrayType()])!.MakeGenericMethod(typeof(SearchValues<char>))!;
System\Text\RegularExpressions\RegexLWCGCompiler.cs (4)
28private static readonly Type[] s_paramTypes = [typeof(RegexRunner), typeof(ReadOnlySpan<char>)]; 71private DynamicMethod DefineDynamicMethod(string methname, Type? returntype, Type hostType, Type[] paramTypes)
System.Text.RegularExpressions.Generator (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
System.Threading.AccessControl (9)
artifacts\obj\System.Threading.AccessControl\Debug\net10.0\System.Threading.AccessControl.notsupported.cs (9)
34public override System.Type AccessRightType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 35public override System.Type AccessRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 36public override System.Type AuditRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 77public override System.Type AccessRightType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 78public override System.Type AccessRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 79public override System.Type AuditRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 120public override System.Type AccessRightType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 121public override System.Type AccessRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } 122public override System.Type AuditRuleType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } }
System.Transactions.Local (1)
System\Transactions\TransactionsEtwProvider.cs (1)
969internal void OleTxTransactionManagerCreate(Type tmType, string? nodeName)
System.Windows.Controls.Ribbon (54)
Microsoft\Windows\Controls\GenericValueConverters.cs (2)
28public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 55public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
Microsoft\Windows\Controls\KeyTipControl.cs (1)
19Type ownerType = typeof(KeyTipControl);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonScrollButtonVisibilityConverter.cs (2)
37public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 112public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonWindowSmallIconConverter.cs (2)
26public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 42public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
Microsoft\Windows\Controls\Ribbon\Ribbon.cs (1)
93Type ownerType = typeof(Ribbon);
Microsoft\Windows\Controls\Ribbon\RibbonApplicationMenu.cs (1)
78Type ownerType = typeof(RibbonApplicationMenu);
Microsoft\Windows\Controls\Ribbon\RibbonApplicationMenuItem.cs (1)
36Type ownerType = typeof(RibbonApplicationMenuItem);
Microsoft\Windows\Controls\Ribbon\RibbonApplicationSplitMenuItem.cs (1)
34Type ownerType = typeof(RibbonApplicationSplitMenuItem);
Microsoft\Windows\Controls\Ribbon\RibbonButton.cs (1)
42Type ownerType = typeof(RibbonButton);
Microsoft\Windows\Controls\Ribbon\RibbonCheckBox.cs (1)
42Type ownerType = typeof(RibbonCheckBox);
Microsoft\Windows\Controls\Ribbon\RibbonComboBox.cs (1)
47Type ownerType = typeof(RibbonComboBox);
Microsoft\Windows\Controls\Ribbon\RibbonContentPresenter.cs (1)
40Type ownerType = typeof(RibbonContentPresenter);
Microsoft\Windows\Controls\Ribbon\RibbonContextMenu.cs (5)
45Type ownerType = typeof(RibbonContextMenu); 407public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 437public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 465public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 476public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Microsoft\Windows\Controls\Ribbon\RibbonContextualTabGroupItemsControl.cs (1)
31Type ownerType = typeof(RibbonContextualTabGroupItemsControl);
Microsoft\Windows\Controls\Ribbon\RibbonControl.cs (1)
46Type ownerType = typeof(RibbonControl);
Microsoft\Windows\Controls\Ribbon\RibbonControlGroup.cs (1)
34Type ownerType = typeof(RibbonControlGroup);
Microsoft\Windows\Controls\Ribbon\RibbonControlLengthConverter.cs (5)
45public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 48TypeCode tc = Type.GetTypeCode(sourceType); 70public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 116public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 131ConstructorInfo ci = typeof(RibbonControlLength).GetConstructor(new Type[] { typeof(double), typeof(RibbonControlLengthUnitType) });
Microsoft\Windows\Controls\Ribbon\RibbonFilterMenuButton.cs (1)
36Type ownerType = typeof(RibbonFilterMenuButton);
Microsoft\Windows\Controls\Ribbon\RibbonGallery.cs (2)
59Type ownerType = typeof(RibbonGallery); 1130bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
Microsoft\Windows\Controls\Ribbon\RibbonGalleryCategory.cs (2)
49Type ownerType = typeof(RibbonGalleryCategory); 477bool IWeakEventListener.ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
Microsoft\Windows\Controls\Ribbon\RibbonGalleryItem.cs (1)
40Type ownerType = typeof(RibbonGalleryItem);
Microsoft\Windows\Controls\Ribbon\RibbonGroup.cs (1)
58Type ownerType = typeof(RibbonGroup);
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (2)
51Type ownerType = typeof(RibbonMenuButton); 1484Type type = typeof(MenuBase);
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (1)
50Type ownerType = typeof(RibbonMenuItem);
Microsoft\Windows\Controls\Ribbon\RibbonQuickAccessToolBar.cs (1)
101Type ownerType = typeof(RibbonQuickAccessToolBar);
Microsoft\Windows\Controls\Ribbon\RibbonRadioButton.cs (1)
42Type ownerType = typeof(RibbonRadioButton);
Microsoft\Windows\Controls\Ribbon\RibbonSeparator.cs (1)
35Type ownerType = typeof(RibbonSeparator);
Microsoft\Windows\Controls\Ribbon\RibbonSplitButton.cs (1)
41Type ownerType = typeof(RibbonSplitButton);
Microsoft\Windows\Controls\Ribbon\RibbonSplitMenuItem.cs (1)
33Type ownerType = typeof(RibbonSplitMenuItem);
Microsoft\Windows\Controls\Ribbon\RibbonTab.cs (1)
41Type ownerType = typeof(RibbonTab);
Microsoft\Windows\Controls\Ribbon\RibbonTabHeader.cs (1)
35Type ownerType = typeof(RibbonTabHeader);
Microsoft\Windows\Controls\Ribbon\RibbonTabHeaderItemsControl.cs (1)
32Type ownerType = typeof(RibbonTabHeaderItemsControl);
Microsoft\Windows\Controls\Ribbon\RibbonTextBox.cs (1)
44Type ownerType = typeof(RibbonTextBox);
Microsoft\Windows\Controls\Ribbon\RibbonToggleButton.cs (1)
43Type ownerType = typeof(RibbonToggleButton);
Microsoft\Windows\Controls\Ribbon\RibbonToolTip.cs (1)
37Type ownerType = typeof(RibbonToolTip);
Microsoft\Windows\Controls\Ribbon\RibbonTwoLineText.cs (1)
41Type ownerType = typeof(RibbonTwoLineText);
Microsoft\Windows\Controls\Ribbon\RibbonWindow.cs (1)
48Type ownerType = typeof(RibbonWindow);
Microsoft\Windows\Controls\Ribbon\StringCollectionConverter.cs (3)
27public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 38public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 99public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System.Windows.Extensions (1)
artifacts\obj\System.Windows.Extensions\Debug\net10.0\System.Windows.Extensions.notsupported.cs (1)
79public static System.Xaml.Permissions.XamlAccessLevel PrivateAccessTo(System.Type type) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_System_Windows_Extensions); }
System.Windows.Forms (522)
misc\MultitargetUtil.cs (2)
15public static string? GetAssemblyQualifiedName(Type type, Func<Type, string>? typeNameConverter)
System\Resources\AssemblyNamesTypeResolutionService.cs (6)
14private ConcurrentDictionary<string, Type>? _cachedTypes; 72public Type? GetType(string name) => GetType(name, true); 74public Type? GetType(string name, bool throwOnError) => GetType(name, throwOnError, false); 76public Type? GetType(string name, bool throwOnError, bool ignoreCase) 80if (_cachedTypes.TryGetValue(name, out Type? result) && result is not null) 88result = Type.GetType(name, false, ignoreCase);
System\Resources\ResXDataNode.cs (15)
47private Func<Type?, string>? _typeNameConverter; 76public ResXDataNode(string name, object? value, Func<Type?, string>? typeNameConverter) 83Type valueType = (value is null) ? typeof(object) : value.GetType(); 105public ResXDataNode(string name, ResXFileRef fileRef, Func<Type?, string>? typeNameConverter) 119Type? nodeType = null; 238Type valueType = value?.GetType() ?? typeof(object); 291Func<Type?, string>? typeNameConverter) 347Type type = ResolveTypeName(typeName); 380Type ResolveTypeName(string typeName) 382if (ResolveType(typeName, typeResolver) is not Type type) 528Type? objectType = null; 559Type? type = _nodeInfo.MimeType == ResXResourceWriter.BinSerializedObjectMimeType 664private static Type? ResolveType(string typeName, ITypeResolutionService? typeResolver) 666Type? resolvedType = null; 686return resolvedType ?? Type.GetType(typeName, throwOnError: false);
System\Resources\ResxFileRef.Converter.cs (5)
16public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 19public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 26Type destinationType) 105Type? toCreate = Type.GetType(parts[1], true);
System\Resources\ResXResourceReader.cs (2)
421Type readerType = typeof(ResXResourceReader); 422Type writerType = typeof(ResXResourceWriter);
System\Resources\ResXResourceSet.cs (2)
28public override Type GetDefaultReader() => typeof(ResXResourceReader); 33public override Type GetDefaultWriter() => typeof(ResXResourceWriter);
System\Resources\ResXResourceWriter.cs (6)
95private readonly Func<Type?, string>? _typeNameConverter; // no public property to be consistent with ResXDataNode class. 108public ResXResourceWriter(string fileName, Func<Type?, string> typeNameConverter) 119public ResXResourceWriter(Stream stream, Func<Type?, string> typeNameConverter) 131public ResXResourceWriter(TextWriter textWriter, Func<Type?, string> typeNameConverter) 398Type? typeObject = Type.GetType(type);
System\Resources\ResXSerializationBinder.cs (8)
22private readonly Func<Type?, string>? _typeNameConverter; 25/// The custom type resolution service used to bind names to a specific <see cref="Type"/>. Only 31/// The type name converter to use for binding a <see cref="Type"/> to a custom name. This is passed in through 32/// constructors on <see cref="ResXDataNode"/> such as <see cref="ResXDataNode(string, object?, Func{Type?, string}?)"/> 34internal ResXSerializationBinder(Func<Type?, string>? typeNameConverter) => _typeNameConverter = typeNameConverter; 36public override Type? BindToType( 46Type? type = _typeResolver.GetType(parsed.AssemblyQualifiedName); 73public override void BindToName(Type serializedType, out string? assemblyName, out string? typeName)
System\Windows\Forms\Accessibility\AccessibleObject.cs (4)
2906MethodInfo? IReflect.GetMethod(string name, BindingFlags bindingAttr, Binder? binder, Type[] types, ParameterModifier[]? modifiers) 2934Type? returnType, 2935Type[] types, 2997Type IReflect.UnderlyingSystemType => typeof(IAccessible);
System\Windows\Forms\ActiveX\AxHost.AxPropertyDescriptor.cs (3)
67public override Type ComponentType 96public override Type PropertyType => _baseDescriptor.PropertyType; 111public override object? GetEditor(Type editorBaseType)
System\Windows\Forms\ActiveX\AxHost.ConnectionPointCookie.cs (2)
18public ConnectionPointCookie(object source, object sink, Type eventInterface) 23internal ConnectionPointCookie(object? source, object sink, Type eventInterface, bool throwException)
System\Windows\Forms\ActiveX\AxHost.cs (1)
2489object? ICustomTypeDescriptor.GetEditor(Type editorBaseType)
System\Windows\Forms\ActiveX\AxHost.StateConverter.cs (3)
18public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 22public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 38public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (4)
1435static Type? GetDefaultEventsInterface(Type controlType) 1437Type? eventInterface = null; 1450eventInterface ??= Type.GetType(eventName, throwOnError: false);
System\Windows\Forms\ActiveX\Control.AxSourcingSite.cs (1)
35public unsafe object? GetService(Type service)
System\Windows\Forms\Application.cs (4)
36private static Type? s_mainType; 196Type? type = GetAppMainType(); 1095Type? type = GetAppMainType(); 1113private static Type? GetAppMainType()
System\Windows\Forms\Application.ModalApplicationContext.cs (1)
8internal static readonly Type s_typeOfModalApplicationContext = typeof(ModalApplicationContext);
System\Windows\Forms\ComponentModel\COM2Interop\COM2AboutBoxPropertyDescriptor.cs (2)
41public override Type PropertyType => typeof(string); 46public override object? GetEditor(Type editorBaseType)
System\Windows\Forms\ComponentModel\COM2Interop\COM2ColorConverter.cs (1)
14public override Type ManagedType => typeof(Color);
System\Windows\Forms\ComponentModel\COM2Interop\COM2DataTypeToManagedDataTypeConverter.cs (1)
19public abstract Type ManagedType { get; }
System\Windows\Forms\ComponentModel\COM2Interop\COM2EnumConverter.cs (3)
16public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 19public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destType) 25public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\ComponentModel\COM2Interop\COM2ExtendedTypeConverter.cs (5)
22public Com2ExtendedTypeConverter([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type baseType) 29public TypeConverter? GetWrappedConverter(Type t) 53public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 58public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 68public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\ComponentModel\COM2Interop\COM2ExtendedUITypeEditor.cs (1)
20public Com2ExtendedUITypeEditor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type baseType)
System\Windows\Forms\ComponentModel\COM2Interop\COM2FontConverter.cs (1)
21public override Type ManagedType => typeof(Font);
System\Windows\Forms\ComponentModel\COM2Interop\COM2IDispatchConverter.cs (3)
28public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) => false; 30public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 33public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\ComponentModel\COM2Interop\COM2IManagedPerPropertyBrowsingHandler.cs (3)
76Type? type = null; 79type = Type.GetType(typeName); 113? Type.GetType(string.Concat(typeName.AsSpan(0, lastDot), assemblyName))
System\Windows\Forms\ComponentModel\COM2Interop\Com2IPerPropertyBrowsingHandler.Com2IPerPropertyBrowsingEnum.cs (1)
88Type? targetType = Target.PropertyType;
System\Windows\Forms\ComponentModel\COM2Interop\Com2IPerPropertyBrowsingHandler.Com2IPerPropertyEnumConverter.cs (1)
22public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destType)
System\Windows\Forms\ComponentModel\COM2Interop\COM2PictureConverter.cs (2)
21private Type _pictureType = typeof(Bitmap); 31public override Type ManagedType => _pictureType;
System\Windows\Forms\ComponentModel\COM2Interop\Com2PropertyDescriptor.Com2PropDescMainConverter.cs (1)
32public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (11)
36private readonly Type? _propertyType; 81Type? propertyType, 281public sealed override Type ComponentType => typeof(IDispatch.Interface); 370public override Type? PropertyType 491&& Type.GetType(converterTypeName) is { } converterType 518private object? GetBaseTypeEditor(Type editorBaseType) 530&& Type.GetType(editorTypeName) is { } attributeEditorBaseType 532&& Type.GetType(attribute.EditorTypeName) is { } type) 564public override object? GetEditor(Type editorBaseType) 682public void GetTypeConverterAndTypeEditor([NotNull] ref TypeConverter? typeConverter, Type editorBaseType, ref object? typeEditor) 725Type localConverterType = localConverter.GetType();
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (7)
53private static Dictionary<string, Type>? s_builtEnums; 313private static unsafe Type? GetValueTypeFromTypeDesc(ref TYPEDESC typeDesc, ITypeInfo* typeInfo, ref Guid typeGuid) 686private static unsafe Type? ProcessTypeInfoEnum(ITypeInfo* enumTypeInfo) 783if (s_builtEnums.TryGetValue(enumName, out Type? typeValue)) 788Type enumType = typeof(int); 800Type t = enumBuilder.CreateTypeInfo().AsType(); 875private static Type? VTToType(VARENUM vt) => vt switch
System\Windows\Forms\ComponentModel\COM2Interop\Com2TypeInfoProcessor.PropInfo.cs (1)
22public Type? ValueType { get; set; }
System\Windows\Forms\ComponentModel\COM2Interop\ComNativeDescriptor.ComTypeDescriptor.cs (1)
47object? ICustomTypeDescriptor.GetEditor(Type editorBaseType) => GetEditor(_instance, editorBaseType);
System\Windows\Forms\ComponentModel\COM2Interop\ComNativeDescriptor.cs (4)
66[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, 103internal static object? GetEditor(object component, Type baseEditorType) 335Type editorType, 340Type type = propertyValue.GetType();
System\Windows\Forms\ComponentModel\COM2Interop\ComNativeDescriptor.NullTypeDescriptor.cs (1)
28object? ICustomTypeDescriptor.GetEditor(Type editorBaseType) => null;
System\Windows\Forms\Controls\Buttons\FlatButtonAppearanceConverter.cs (1)
12public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) =>
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
355private readonly Dictionary<Type, TypeConverter> _converters;
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (4)
325public Type BoundColumnValueType(int boundColumnIndex) 909private static DataGridViewColumn GetDataGridViewColumnFromType(Type type) 1469Type valueType = value.GetType(); 1470Type columnType = _owner.Columns[columnIndex].ValueType!;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (10)
2591Type? editControlType = dataGridViewCell.EditType; 2595Type? editingCellInterface = dataGridViewCell.GetType().GetInterface("System.Windows.Forms.IDataGridViewEditingCell"); 2628Type? editingCellInterface = dataGridViewCell.GetType().GetInterface("System.Windows.Forms.IDataGridViewEditingCell"); 2651Type? editingCtrlInterface = editControlType.GetInterface("System.Windows.Forms.IDataGridViewEditingControl"); 2652if (!editControlType.IsSubclassOf(Type.GetType("System.Windows.Forms.Control")!) || editingCtrlInterface is null) 6808internal TypeConverter GetCachedTypeConverter(Type type) 11795Type? formattedValueType, 12745Type? valueType, 21900Type? editControlType = dataGridViewCell.EditType; 21901Type? editingCellInterface = null;
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (3)
116public Type DefaultHeaderCellType 120if (Properties.TryGetValue(s_propDefaultHeaderCellType, out Type? type)) 233Type cellType = DefaultHeaderCellType;
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (8)
30private static readonly Type s_defaultFormattedValueType = typeof(string); 31private static readonly Type s_defaultValueType = typeof(object); 32private static readonly Type s_cellType = typeof(DataGridViewButtonCell); 55public override Type? EditType => null; 84public override Type FormattedValueType => 113public override Type ValueType 117Type? valueType = base.ValueType; 130Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonColumn.cs (2)
13private static readonly Type s_columnType = typeof(DataGridViewButtonColumn); 188Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (7)
55private static readonly Type s_stringType = typeof(string); // cache the string type for performance 191public virtual Type? EditType => typeof(DataGridViewTextBoxEditingControl); 235public virtual Type? FormattedValueType => ValueType; 704public virtual Type? ValueType 708if (!Properties.TryGetValue(s_propCellValueType, out Type? cellValueType) && OwningColumn is not null) 1118Type editingControlType = DataGridView.EditingControl.GetType(); 3707Type valueType,
System\Windows\Forms\Controls\DataGridView\DataGridViewCellConverter.cs (2)
14public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 24public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\DataGridView\DataGridViewCellFormattingEventArgs.cs (1)
12Type? desiredType,
System\Windows\Forms\Controls\DataGridView\DataGridViewCellParsingEventArgs.cs (1)
12Type? desiredType,
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyleConverter.cs (2)
17public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 34public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (8)
35private static readonly Type s_defaultCheckStateType = typeof(CheckState); 36private static readonly Type s_defaultBooleanType = typeof(bool); 37private static readonly Type s_cellType = typeof(DataGridViewCheckBoxCell); 196public override Type? EditType 259public override Type FormattedValueType => ThreeState ? s_defaultCheckStateType : s_defaultBooleanType; 388public override Type? ValueType 392Type? valueType = base.ValueType; 410Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (3)
161public Type? CellType => CellTemplate?.GetType(); 787public Type? ValueType 789get => Properties.GetValueOrDefault<Type>(s_propDataGridViewColumnValueType);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnConverter.cs (3)
13public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 30public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 42ctor = dataGridViewColumn.GetType().GetConstructor([typeof(Type)]);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (2)
30private static readonly Type s_cellType = typeof(DataGridViewColumnHeaderCell); 98Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (10)
39private static readonly Type s_defaultFormattedValueType = typeof(string); 41private static readonly Type s_defaultEditType = typeof(DataGridViewComboBoxEditingControl); 42private static readonly Type s_defaultValueType = typeof(object); 43private static readonly Type s_cellType = typeof(DataGridViewComboBoxCell); 292private Type DisplayType 341public override Type EditType => s_defaultEditType; 368public override Type FormattedValueType => s_defaultFormattedValueType; 486public override Type ValueType 500Type? baseValueType = base.ValueType; 636Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxColumn.cs (2)
15private static readonly Type s_columnType = typeof(DataGridViewComboBoxColumn); 499Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (7)
16private static readonly Type s_defaultFormattedValueType = typeof(string); 17private static readonly Type s_defaultValueType = typeof(object); 18private static readonly Type s_cellType = typeof(DataGridViewHeaderCell); 84public override Type FormattedValueType => s_defaultFormattedValueType; 155public override Type? ValueType 157get => Properties.GetValueOrDefault<Type?>(s_propValueType, s_defaultValueType); 193Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (8)
15private static readonly Type s_defaultTypeImage = typeof(Image); 16private static readonly Type s_defaultTypeIcon = typeof(Icon); 17private static readonly Type s_cellType = typeof(DataGridViewImageCell); 66public override Type? EditType 80public override Type FormattedValueType 175public override Type? ValueType 179Type? baseValueType = base.ValueType; 205Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (2)
13private static readonly Type s_columnType = typeof(DataGridViewImageColumn); 239Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (7)
16private static readonly Type s_defaultFormattedValueType = typeof(string); 17private static readonly Type s_defaultValueType = typeof(object); 18private static readonly Type s_cellType = typeof(DataGridViewLinkCell); 103public override Type? EditType 112public override Type? FormattedValueType => s_defaultFormattedValueType; 360public override Type ValueType => base.ValueType ?? s_defaultValueType; 365Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkColumn.cs (2)
13private static readonly Type s_columnType = typeof(DataGridViewLinkColumn); 370Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (2)
15private static readonly Type s_rowType = typeof(DataGridViewRow); 1040Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewRowConverter.cs (2)
13public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 23public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (2)
24private static readonly Type s_cellType = typeof(DataGridViewRowHeaderCell); 54Type thisType = GetType();
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (7)
32private static readonly Type s_defaultFormattedValueType = typeof(string); 33private static readonly Type s_defaultValueType = typeof(object); 34private static readonly Type s_cellType = typeof(DataGridViewTextBoxCell); 55public override Type FormattedValueType 80public override Type ValueType 84Type? valueType = base.ValueType; 103Type thisType = GetType();
System\Windows\Forms\Controls\Labels\LinkArea.LinkAreaConverter.cs (3)
23public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 37public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 86public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\Labels\LinkConverter.cs (3)
19public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 33public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 82public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\ListControl\ListControlConvertEventArgs.cs (1)
8public ListControlConvertEventArgs(object? value, Type? desiredType, object? listItem)
System\Windows\Forms\Controls\ListView\ColumnHeader.cs (1)
433Type clonedType = GetType();
System\Windows\Forms\Controls\ListView\ColumnHeaderConverter.cs (3)
17public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 34public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 42Type t = TypeDescriptor.GetReflectionType(value);
System\Windows\Forms\Controls\ListView\ListViewGroupConverter.cs (3)
21public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 35public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 88public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\ListView\ListViewItem.cs (1)
901Type clonedType = GetType();
System\Windows\Forms\Controls\ListView\ListViewItemConverter.cs (2)
24public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 41public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\ListView\ListViewSubItemConverter.cs (2)
14public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 24public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (1)
446if (this.TryGetOwnerAs(out MonthCalendar? owner) && owner.GetType().BaseType is Type baseType)
System\Windows\Forms\Controls\MonthCalendar\SelectionRangeConverter.cs (3)
23public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 37public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 92public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (18)
551protected virtual Type DefaultTabType => typeof(PropertiesTab); 954Type oldType = GetUnwrappedObject(i)!.GetType(); 963Type newType = newObject.GetType(); 1018Type? tabType = _selectedTab?.TabType; 1047HashSet<Type>? typesWithEvents = _selectedObjects.Length > 10 ? new() : null; 1058Type objectType = currentObject.GetType(); 1459Type tabType, 1639protected virtual PropertyTab? CreatePropertyTab(Type tabType) => null; 1641private PropertyTab? CreateTab(Type tabType, IDesignerHost? host) 2150private static IEnumerable<Type> GetCommonTabs(object[] components, PropertyTabScope tabScope) 2154return Array.Empty<Type>(); 2159return Array.Empty<Type>(); 2162List<Type> tabClasses = []; 2178return Array.Empty<Type>(); 3040Type? typeChanged = e.TypeChanged; 3438foreach (Type tabType in GetCommonTabs(_selectedObjects, PropertyTabScope.Component)) 3469internal void ReleaseTab(Type tabType, object component) 3602internal void RemoveTab(Type tabType)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.PropertyGridServiceProvider.cs (1)
23public object? GetService(Type serviceType)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.PropertyTabCollection.cs (3)
57public void AddTabType(Type propertyTabType) 67public void AddTabType(Type propertyTabType, PropertyTabScope tabScope) 122public void RemoveTabType(Type propertyTabType)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.TabInfo.cs (1)
13public Type TabType => Tab.GetType();
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\ArrayElementGridEntry.cs (1)
23public override Type? PropertyType => ParentGridEntry?.PropertyType?.GetElementType();
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CategoryGridEntry.cs (1)
96public override Type PropertyType => typeof(void);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (5)
745public virtual Type? PropertyType => PropertyValue?.GetType(); 1151private object? FindPropertyValue(string propertyName, Type propertyType) 1261Type? objectType = PropertyType; 1498public virtual object? GetService(Type serviceType) 2199Type? type = PropertyType;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.cs (4)
28public override Type ComponentType => _descriptors[0].ComponentType; 80public override Type PropertyType => _descriptors[0].PropertyType; 116Type type = value.GetType(); 192public override object? GetEditor(Type editorBaseType) => _descriptors[0].GetEditor(editorBaseType);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.MergedAttributeCollection.cs (3)
15private Dictionary<Type, Attribute>? _foundAttributes; 22public override Attribute? this[[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields)] Type attributeType] => GetCommonAttribute(attributeType); 24private Attribute? GetCommonAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields)] Type attributeType)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.cs (5)
96Type? componentType = PropertyDescriptor.ComponentType; 107Type ownerType = owner.GetType(); 184public override Type? PropertyType => PropertyDescriptor.PropertyType; 252Type? propertyType = PropertyType; 740Type? propertyType = ParentGridEntry.PropertyType;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.ExceptionConverter.cs (1)
16public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
1376public new object? GetService(Type classService)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
338Type? createType = _gridView.SelectedGridEntry.PropertyType;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\SingleSelectRootGridEntry.cs (1)
212public override object? GetService(Type serviceType)
System\Windows\Forms\Controls\TabControl\TabControl.cs (1)
1080protected virtual object[] GetItems(Type baseType)
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (2)
99private Type? _validatingType; 1441public Type? ValidatingType
System\Windows\Forms\Controls\TextBox\TextBoxAutoCompleteSourceConverter.cs (1)
10public TextBoxAutoCompleteSourceConverter(Type type) : base(type)
System\Windows\Forms\Controls\TextBox\TypeValidationEventArgs.cs (2)
11public TypeValidationEventArgs(Type? validatingType, bool isValidInput, object? returnValue, string? message) 22public Type? ValidatingType { get; }
System\Windows\Forms\Controls\ToolStrips\OpacityConverter.cs (2)
19public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 99public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (3)
51private Type _currentRendererType = typeof(Type); 1530_currentRendererType = (_renderer is not null) ? _renderer.GetType() : typeof(Type);
System\Windows\Forms\Controls\ToolStrips\ToolStripContainer.ToolStripContainerTypedControlCollection.cs (3)
13private readonly Type _contentPanelType = typeof(ToolStripContentPanel); 14private readonly Type _panelType = typeof(ToolStripPanel); 34Type controlType = value.GetType();
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.StubSite.cs (1)
67object? IServiceProvider.GetService(Type service)
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (6)
432internal static Type s_systemRendererType = typeof(ToolStripSystemRenderer); 433internal static Type s_professionalRendererType = typeof(ToolStripProfessionalRenderer); 437private static Type? t_currentRendererType; 439private static Type CurrentRendererType 449private static Type s_defaultRendererType => s_professionalRendererType; 494Type currentType = CurrentRendererType;
System\Windows\Forms\Controls\ToolStrips\ToolStripRendererSwitcher.cs (3)
16private Type _currentRendererType = typeof(Type); 67_currentRendererType = (_renderer is not null) ? _renderer.GetType() : typeof(Type);
System\Windows\Forms\Controls\TreeView\TreeNode.cs (1)
1346Type clonedType = GetType();
System\Windows\Forms\Controls\TreeView\TreeNodeConverter.cs (2)
22public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 39public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\TreeView\TreeViewImageIndexConverter.cs (1)
50public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\TreeView\TreeViewImageKeyConverter.cs (1)
22public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Controls\WebBrowser\HtmlElement.HtmlElementShim.cs (1)
21private static readonly Type[] s_dispInterfaceTypes =
System\Windows\Forms\ConvertEventArgs.cs (2)
8public ConvertEventArgs(object? value, Type? desiredType) 16public Type? DesiredType { get; }
System\Windows\Forms\DataBinding\Binding.BindToObject.cs (2)
143internal Type? BindToType 151Type? type = _bindingManager?.BindType;
System\Windows\Forms\DataBinding\Binding.cs (4)
481Type controlClass = BindableComponent.GetType(); 579private object? GetDataSourceNullValue(Type? type) => 675Type? type = _bindToObject.BindToType; 751Type type = _propInfo!.PropertyType;
System\Windows\Forms\DataBinding\BindingManagerBase.cs (2)
70internal abstract Type BindType { get; } 95[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type listType,
System\Windows\Forms\DataBinding\BindingSource.cs (8)
50private Type? _itemType; 517private static IList CreateBindingList(Type type) 519Type genericType = typeof(BindingList<>); 520Type bindingType = genericType.MakeGenericType([type]); 528private static object? CreateInstanceOfType(Type type) 662private static IList GetListFromType(Type type) 1083object? dataSourceInstance = _dataSource is Type dataSourceType ? GetListFromType(dataSourceType) : _dataSource; 1127Type type = ListBindingHelper.GetListItemType(_dataSource, _dataMember);
System\Windows\Forms\DataBinding\CurrencyManager.cs (2)
32protected Type? finalType; 134internal override Type BindType => ListBindingHelper.GetListItemType(List);
System\Windows\Forms\DataBinding\ListBindingConverter.cs (6)
14private static Type[]? s_ctorTypes; // the list of type of our ctor parameters. 20private static Type[] ConstructorParamaterTypes 47public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 64public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 149Type[] ctorParams = new Type[lastItem + 1];
System\Windows\Forms\DataBinding\ListBindingHelper.cs (22)
42if (dataSource is null || dataSource is Type || string.IsNullOrEmpty(dataMember)) 91Type type; 95if (list is Type listAsType) 124else if (list is Type type) 155else if (list is Type) 201public static Type? GetListItemType(object? list) 209if (list is Type listAsType && typeof(IListSource).IsAssignableFrom(listAsType)) 220Type listType = (list is Type type) ? type : list.GetType(); 221object? listInstance = (list is Type) ? null : list; 243private static object? CreateInstanceOfType(Type type) 273public static Type GetListItemType(object? dataSource, string? dataMember) 305private static string GetListNameFromType(Type type) 312Type? elementType = type.GetElementType(); 353Type subType = listAccessors[startIndex].PropertyType; 440private static Type GetListItemTypeByEnumerable(IEnumerable iEnumerable) 491private static bool IsListBasedType(Type type) 511foreach (Type curInterface in type.GetInterfaces()) 539private static PropertyInfo? GetTypedIndexer(Type type) 566private static PropertyDescriptorCollection GetListItemPropertiesByType(Type type) 574Type targetType = enumerable.GetType(); 592Type type = indexer.PropertyType;
System\Windows\Forms\DataBinding\PropertyManager.cs (1)
68internal override Type BindType => _dataSource!.GetType();
System\Windows\Forms\DataBinding\RelatedPropertyManager.cs (1)
89internal override Type BindType => _fieldInfo.PropertyType;
System\Windows\Forms\Design\ComponentEditorForm.ComponentEditorPageSite.cs (1)
27internal ComponentEditorPageSite(Control parent, Type pageClass, IComponent component, ComponentEditorForm form)
System\Windows\Forms\Design\ComponentEditorForm.cs (2)
17private readonly Type[] _pageTypes; 43public ComponentEditorForm(object component, Type[] pageTypes) : base()
System\Windows\Forms\Design\IWindowsFormsEditorService.cs (1)
23/// <see cref="PropertyGrid.PropertyGridServiceProvider"/> in the <see cref="SingleSelectRootGridEntry.GetService(Type)"/>
System\Windows\Forms\Design\WindowsFormsComponentEditor.cs (2)
35Type[]? pageControlTypes = GetComponentEditorPages(); 48protected virtual Type[]? GetComponentEditorPages() => null;
System\Windows\Forms\Dialogs\CommonDialogs\SpecialFolderEnumConverter.cs (1)
13Type type) : base(type)
System\Windows\Forms\FeatureSupport.cs (4)
27Type? c = null; 30c = Type.GetType(featureClassName); 51Type? c = null; 54c = Type.GetType(featureClassName);
System\Windows\Forms\Form.cs (6)
6148private static Type? FindClosestStockType(Type type) 6150Type[] stockTypes = [typeof(MenuStrip)]; 6154foreach (Type t in stockTypes) 6188Type? closestMatchingSourceType = FindClosestStockType(sourceToolStrip.GetType()); 6191Type? closestMatchingTargetType = FindClosestStockType(thisToolstrip.GetType());
System\Windows\Forms\ImageIndexConverter.cs (1)
68public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\ImageKeyConverter.cs (2)
48public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 83public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Input\Cursor.cs (1)
83public Cursor(Type type, string resource)
System\Windows\Forms\Input\CursorConverter.cs (3)
24public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 38public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 83public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Input\KeysConverter.cs (3)
130public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 137public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 220public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Internal\Formatter.cs (20)
14private static readonly Type s_stringType = typeof(string); 15private static readonly Type s_booleanType = typeof(bool); 16private static readonly Type s_checkStateType = typeof(CheckState); 31Type targetType, 55Type oldTargetType = targetType; 88Type targetType, 137Type sourceType = value.GetType(); 239Type targetType, 240Type sourceType, 249Type oldTargetType = targetType; 277Type targetType, 278Type sourceType, 379private static object ChangeType(object value, Type type, IFormatProvider? formatInfo) 419private static string GetCantConvertMessage(object? value, Type targetType) 443public static object? InvokeStringParseMethod(object? value, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type targetType, IFormatProvider? formatInfo) 501public static object? NullData(Type type, object? dataSourceNullValue) 530public static Type NullableUnwrap(Type type) 537Type? underlyingType = Nullable.GetUnderlyingType(type); 551public static object? GetDefaultDataSourceNullValue(Type? type)
System\Windows\Forms\Internal\TypedControlCollection.cs (3)
14private readonly Type _typeOfControl; 17public TypedControlCollection(Control owner, Type typeOfControl, bool isReadOnly) 24public TypedControlCollection(Control owner, Type typeOfControl)
System\Windows\Forms\Internal\TypeExtensions.cs (12)
11/// Helper methods for comparing <see cref="Type"/>s and <see cref="TypeName"/>s. 15private static readonly Type s_forwardedFromAttributeType = typeof(TypeForwardedFromAttribute); 24public static bool TryGetForwardedFromName(this Type type, [NotNullWhen(true)] out string? name) 29Type attributedType = type; 46/// The entry point for matching <paramref name="type"/> to <paramref name="typeName"/>. The top level <see cref="Type"/> 50public static bool MatchExceptAssemblyVersion(this Type type, TypeName typeName) 67private static bool MatchLessAssemblyVersion(this Type type, TypeName typeName) 115Type[] genericTypes = type.GetGenericArguments(); 243public static TypeName ToTypeName(this Type type) 254static string GetTypeFullName(Type type) 258Type[] genericArguments = type.GetGenericArguments(); 262Type generic = genericArguments[i];
System\Windows\Forms\Layout\Containers\SplitContainer.SplitContainerTypedControlCollection.cs (1)
16public SplitContainerTypedControlCollection(SplitContainer splitContainer, Type type, bool isReadOnly)
System\Windows\Forms\MDI\MdiWindowListItemConverter.cs (1)
10public MdiWindowListItemConverter(Type type) : base(type)
System\Windows\Forms\Nrbf\WinFormsSerializationRecordExtensions.cs (1)
88Type serializedType = resolver.GetType(serializedTypeName);
System\Windows\Forms\OLE\Clipboard.cs (5)
301/// unavailable in the specified format, or is of a wrong <see cref="Type"/>. 307/// if the format is not present or the value is of a wrong <see cref="Type"/>. 312/// available at the compile time, for example do not call the <see cref="Type.GetType(string)"/> method. 390Func<TypeName, Type> resolver, 400/// <inheritdoc cref="TryGetData{T}(string, Func{TypeName, Type}, out T)"/>
System\Windows\Forms\OLE\DataObject.Composition.BinaryFormatUtilities.cs (5)
69Func<TypeName, Type>? resolver, 104Type type = typeof(T); 161Func<TypeName, Type>? resolver, 178Type type = typeof(T); 200private static bool TypeNameIsAssignableToType(TypeName typeName, Type type, ITypeResolver resolver)
System\Windows\Forms\OLE\DataObject.Composition.Binder.cs (17)
22/// the <see cref="Type"/> parameter specified by the user is resolved automatically. 31private readonly Func<TypeName, Type>? _resolver; 37private static readonly Type[] s_intrinsicTypes = 108private static Dictionary<TypeName, Type>? s_knownTypes; 110private readonly Dictionary<TypeName, Type> _userTypes = new(TypeNameComparer.Default); 116/// <param name="type"><see cref="Type"/> that the user expects to read from the binary formatted stream.</param> 128public Binder(Type type, Func<TypeName, Type>? resolver, bool legacyMode) 159foreach (Type type in s_intrinsicTypes) 227public override Type? BindToType(string assemblyName, string typeName) 232if (GetCachedType(assemblyName, typeName, typeName: null) is Type type) 252private Type UseResolver(TypeName typeName) 261Type resolved = _resolver(typeName) 270private Type? GetCachedType(string assemblyName, string fullTypeName, TypeName? typeName) 276return s_knownTypes.TryGetValue(typeName, out Type? type) 283public Type GetType(TypeName typeName) 293return GetCachedType(fullName, typeName.FullName, typeName) is Type type ? type : UseResolver(typeName);
System\Windows\Forms\OLE\DataObject.Composition.cs (4)
88public object? GetData(Type format) => _winFormsDataObject.GetData(format); 91public bool GetDataPresent(Type format) => _winFormsDataObject.GetDataPresent(format); 96public void SetData(Type format, object? data) => _winFormsDataObject.SetData(format, data); 103Func<TypeName, Type> resolver,
System\Windows\Forms\OLE\DataObject.Composition.NativeToWinFormsAdapter.cs (12)
97Func<TypeName, Type>? resolver, 130Func<TypeName, Type>? resolver, 241/// <see langword="true"/> if the managed object of <see cref="Type"/> <typeparamref name="T"/> was successfully 255Func<TypeName, Type>? resolver, 292Func<TypeName, Type>? resolver, 355Func<TypeName, Type>? resolver, 480Type type = typeof(T); 488Func<TypeName, Type>? resolver, 554public object? GetData(Type format) => GetData(format.FullName!); 555public bool GetDataPresent(Type format) => GetDataPresent(format.FullName!); 625public void SetData(Type format, object? data) { } 632Func<TypeName, Type> resolver,
System\Windows\Forms\OLE\DataObject.cs (7)
243public virtual object? GetData(Type format) => format is null ? null : GetData(format.FullName!); 249public virtual bool GetDataPresent(Type format) => format is not null && GetDataPresent(format.FullName!); 260public virtual void SetData(Type format, object? data) => _innerData.SetData(format, data); 269Func<TypeName, Type> resolver, 298/// <inheritdoc cref="ITypedDataObject.TryGetData{T}(string, Func{TypeName, Type}, bool, out T)" /> 302Func<TypeName, Type>? resolver, 376Func<TypeName, Type>? resolver,
System\Windows\Forms\OLE\DataObject.DataStore.cs (4)
83public object? GetData(Type format) => GetData(format.FullName!); 106public void SetData(Type format, object? data) 125public bool GetDataPresent(Type format) => GetDataPresent(format.FullName!); 201Func<TypeName, Type> resolver,
System\Windows\Forms\OLE\DataObjectExtensions.cs (2)
52/// <inheritdoc cref="ITypedDataObject.TryGetData{T}(string, Func{Reflection.Metadata.TypeName, Type}, bool, out T)"/> 59Func<Reflection.Metadata.TypeName, Type> resolver,
System\Windows\Forms\OLE\IDataObject.cs (5)
12/// interface instead. This interface will ensure that only data of a specified <see cref="Type"/> 14/// in the clipboard or drag and drop scenarios, the APIs that specify a <see cref="Type"/>, 34object? GetData(Type format); 53bool GetDataPresent(Type format); 84void SetData(Type format, object? data);
System\Windows\Forms\OLE\ITypedDataObject.cs (9)
10/// Provides a format-independent mechanism for reading data of a specified <see cref="Type"/>. 16/// data of the specified <see cref="Type"/> is exchanged. Otherwise the APIs that specify a <see cref="Type"/> parameter 18/// interface, implement this interface as well. Otherwise the APIs that specify a <see cref="Type"/> parameter 28/// <inheritdoc cref="TryGetData{T}(string, Func{TypeName, Type}, bool, out T)"/> 35/// <inheritdoc cref="TryGetData{T}(string, Func{TypeName, Type}, bool, out T)"/> 44/// <inheritdoc cref="TryGetData{T}(string, Func{TypeName, Type}, bool, out T)"/> 54/// A user-provided function that defines a closure of <see cref="Type"/>s that can be retrieved from 82Func<TypeName, Type> resolver,
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanelCellPositionTypeConverter.cs (3)
13public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 23public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 64public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.StyleConverter.cs (2)
14public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 24public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettingsTypeConverter.cs (4)
18public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 32public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 63public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 175Type sizeTypeType = typeof(SizeType);
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutStyle.cs (1)
80internal Type GetTypeWithConstructor() => this.GetType();
System.Windows.Forms.Analyzers.CSharp.Tests (1)
Analyzers\Verifiers\CSharpIncrementalSourceGeneratorVerifier.cs (1)
31protected override IEnumerable<Type> GetSourceGenerators()
System.Windows.Forms.Design (449)
System\ComponentModel\Design\ArrayEditor.cs (2)
17public ArrayEditor(Type type) : base(type) 24protected override Type CreateCollectionItemType()
System\ComponentModel\Design\BinaryEditor.cs (1)
20internal object? GetService(Type serviceType)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (10)
63Type[] newItemTypes = NewItemTypes; 85Type type = item.Value.GetType(); 293private void CreateAndAddInstance(Type type) 1125public SelectionWrapper(Type collectionType, Type collectionItemType, Control control, ICollection collection) 1178public override Type ComponentType { get; } 1188public override Type PropertyType { get; } 1264object? ICustomTypeDescriptor.GetEditor(Type editorBaseType) => null; 1363public TypeMenuItem(Type itemType, EventHandler handler) : base(itemType.Name, null, handler) 1368public Type ItemType { get; }
System\ComponentModel\Design\CollectionEditor.CollectionForm.cs (5)
36protected Type CollectionItemType => _editor.CollectionItemType; 41protected Type CollectionType => _editor.CollectionType; 124protected Type[] NewItemTypes => _editor.NewItemTypes; 139protected object CreateInstance(Type itemType) => _editor.CreateInstance(itemType); 177protected override object? GetService(Type serviceType) => _editor.GetService(serviceType);
System\ComponentModel\Design\CollectionEditor.cs (10)
17private Type? _collectionItemType; 18private Type[]? _newItemTypes; 26public CollectionEditor(Type type) => CollectionType = type; 31protected Type CollectionItemType => _collectionItemType ??= CreateCollectionItemType(); 36protected Type CollectionType { get; } 46protected Type[] NewItemTypes => _newItemTypes ??= CreateNewItemTypes(); 91protected virtual object CreateInstance(Type itemType) 174protected virtual Type CreateCollectionItemType() 192protected virtual Type[] CreateNewItemTypes() => [CollectionItemType]; 346protected object? GetService(Type serviceType) => Context?.GetService(serviceType);
System\ComponentModel\Design\CollectionEditor.PropertyGridSite.cs (1)
31public object? GetService(Type type)
System\ComponentModel\Design\ComponentDesigner.cs (1)
557protected virtual object? GetService(Type serviceType) => _component?.Site?.GetService(serviceType);
System\ComponentModel\Design\DesignerActionList.cs (2)
22public object? GetService(Type serviceType) => Component?.Site?.GetService(serviceType); 69private static object? GetCustomAttribute(MemberInfo info, Type attributeType)
System\ComponentModel\Design\DesignerActionPanel.CheckBoxPropertyLine.cs (1)
74public override Type LineType => typeof(CheckBoxPropertyLine);
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (2)
430object? IServiceProvider.GetService(Type serviceType) 483public override Type LineType => typeof(EditorPropertyLine);
System\ComponentModel\Design\DesignerActionPanel.HeaderLine.cs (1)
27public override Type LineType => typeof(HeaderLine);
System\ComponentModel\Design\DesignerActionPanel.LineInfo.cs (1)
13public abstract Type LineType { get; }
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (1)
127public override Type LineType => typeof(MethodLine);
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (1)
132public override Type LineType => typeof(PanelHeaderLine);
System\ComponentModel\Design\DesignerActionPanel.PropertyLine.cs (1)
50Type valueType = newValue.GetType();
System\ComponentModel\Design\DesignerActionPanel.SeparatorLine.cs (1)
45public override Type LineType => typeof(SeparatorLine);
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (1)
369public override Type LineType => typeof(TextBoxPropertyLine);
System\ComponentModel\Design\DesignerActionPanel.TextLine.cs (1)
83public override Type LineType => typeof(TextLine);
System\ComponentModel\Design\DesignerActionPanel.TypeDescriptorContext.cs (1)
27public object? GetService(Type serviceType) => _serviceProvider.GetService(serviceType);
System\ComponentModel\Design\DesignerHost.cs (23)
27private static readonly Type[] s_defaultServices = [typeof(IDesignerHost), typeof(IContainer), typeof(IComponentChangeService), typeof(IDesignerLoaderHost2)]; 80foreach (Type t in s_defaultServices) 89foreach (Type t in s_defaultServices) 134Type type = TypeDescriptor.GetProvider(component).GetReflectionType(typeof(object)); 397Type reflectType = TypeDescriptor.GetReflectionType(component); 456foreach (Type t in s_defaultServices) 465foreach (Type t in s_defaultServices) 497protected override object? GetService(Type service) 928IComponent IDesignerHost.CreateComponent(Type componentType) => 931IComponent IDesignerHost.CreateComponent(Type componentType, string name) 1039Type? IDesignerHost.GetType(string typeName) 1048return Type.GetType(typeName); 1207MethodInfo? IReflect.GetMethod(string name, BindingFlags bindingAttr, Binder? binder, Type[] types, ParameterModifier[]? modifiers) => 1226PropertyInfo? IReflect.GetProperty(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[] types, ParameterModifier[]? modifiers) => 1263Type IReflect.UnderlyingSystemType => typeof(IDesignerHost).UnderlyingSystemType; 1265void IServiceContainer.AddService(Type serviceType, object serviceInstance) 1271void IServiceContainer.AddService(Type serviceType, object serviceInstance, bool promote) 1277void IServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback) 1283void IServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback, bool promote) 1289void IServiceContainer.RemoveService(Type serviceType) 1295void IServiceContainer.RemoveService(Type serviceType, bool promote) 1301object? IServiceProvider.GetService(Type serviceType) => GetService(serviceType);
System\ComponentModel\Design\DesignerHost.Site.cs (7)
100void IServiceContainer.AddService(Type serviceType, object serviceInstance) 108void IServiceContainer.AddService(Type serviceType, object serviceInstance, bool promote) 116void IServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback) 124void IServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback, bool promote) 132void IServiceContainer.RemoveService(Type serviceType) 140void IServiceContainer.RemoveService(Type serviceType, bool promote) 148object? IServiceProvider.GetService(Type service)
System\ComponentModel\Design\DesignSurface.cs (9)
51public DesignSurface(Type rootComponentType) : this(null, rootComponentType) 61public DesignSurface(IServiceProvider? parentProvider, Type rootComponentType) : this(parentProvider) 238public void BeginLoad(Type rootComponentType) 249protected internal virtual IComponent? CreateComponent(Type componentType) 271protected internal virtual object? CreateInstance(Type type) 386public object? GetService(Type serviceType) 407private object OnCreateService(IServiceContainer container, Type serviceType) 542private readonly Type _type; 544public DefaultDesignerLoader(Type type)
System\ComponentModel\Design\DesignSurfaceManager.cs (3)
302public object? GetService(Type serviceType) => _serviceContainer?.GetService(serviceType); 317private static object? OnCreateService(IServiceContainer container, Type serviceType) 404object? IServiceProvider.GetService(Type serviceType)
System\ComponentModel\Design\DesignSurfaceServiceContainer.cs (4)
11private readonly HashSet<Type> _fixedServices = []; 24internal void AddFixedService(Type serviceType, object serviceInstance) 33internal void RemoveFixedService(Type serviceType) 42public override void RemoveService(Type serviceType, bool promote)
System\ComponentModel\Design\EventBindingService.cs (2)
60protected object? GetService(Type serviceType) => _provider.GetService(serviceType); 153Type[] args = evInfo.EventHandlerType.GetGenericArguments();
System\ComponentModel\Design\EventBindingService.EventPropertyDescriptor.cs (5)
46public override Type ComponentType => Event.ComponentType; 70public override Type PropertyType => Event.EventType; 298public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 311public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 341public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\ComponentModel\Design\HostDesigntimeLicenseContext.cs (1)
19public override object? GetService(Type serviceClass) => _provider.GetService(serviceClass);
System\ComponentModel\Design\IMultitargetHelperService.cs (1)
15string GetAssemblyQualifiedName(Type type);
System\ComponentModel\Design\InheritanceService.cs (6)
61protected virtual void AddInheritedComponents(Type? type, IComponent component, IContainer container) 87Type reflect = TypeDescriptor.GetReflectionType(type); 94Type reflectionType = GetReflectionTypeFromTypeHelper(field.FieldType); 275private static Type? GetReflectionTypeFromTypeHelper(Type? type) 292private static TypeDescriptionProvider? GetTargetFrameworkProviderForType(Type type)
System\ComponentModel\Design\InheritedPropertyDescriptor.cs (4)
51Type? collectionType = null; 112public override Type ComponentType => _propertyDescriptor.ComponentType; 134public override Type PropertyType => _propertyDescriptor.PropertyType; 294public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\ComponentModel\Design\MenuCommandService.cs (2)
33private Type? _verbSourceType; 392protected object? GetService(Type serviceType)
System\ComponentModel\Design\ReferenceService.cs (1)
282object[] IReferenceService.GetReferences(Type baseType)
System\ComponentModel\Design\SelectionService.cs (1)
102private object? GetService(Type serviceType) => _provider?.GetService(serviceType);
System\ComponentModel\Design\Serialization\BasicDesignerLoader.cs (1)
343protected object? GetService(Type serviceType)
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs (1)
296Type? type = manager.GetType(typeName);
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.LocalDesignerSerializationManager.cs (3)
34protected override object CreateInstance(Type type, ICollection? arguments, string? name, bool addToContainer) 51protected override Type? GetType(string? name) 53Type? t = base.GetType(name);
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.LocalServices.cs (1)
35object? IServiceProvider.GetService(Type serviceType)
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.PassThroughSerializationManager.cs (5)
56object IDesignerSerializationManager.CreateInstance(Type type, ICollection? arguments, string? name, bool addToContainer) 83object? IDesignerSerializationManager.GetSerializer(Type? objectType, Type serializerType) 88Type? IDesignerSerializationManager.GetType(string typeName) 108object? IServiceProvider.GetService(Type serviceType)
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (8)
155private static bool HasRootDesignerAttribute(Type t) 163Type? attributeBaseType = Type.GetType(designerAttribute.DesignerBaseTypeName); 232Type? baseType = null; 236Type? t = LoaderHost.GetType(CodeDomSerializerBase.GetTypeNameFromCodeTypeReference(manager, typeReference)); 269Type? serializerType = LoaderHost.GetType(serializerAttribute.SerializerTypeName!); 738private object? OnCreateService(IServiceContainer container, Type serviceType) 1012string INameCreationService.CreateName(IContainer? container, Type dataType)
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.ModifierConverter.cs (3)
20public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 27public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 40public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.ModifiersInheritedExtenderProvider.cs (1)
79Type baseType = baseComponent.GetType();
System\ComponentModel\Design\Serialization\CodeDomLocalizationProvider.cs (4)
86private static LocalizationCodeDomSerializer? GetCodeDomSerializer(IDesignerSerializationManager manager, object? currentSerializer, Type? objectType) 140Type? objectType) 194object? IDesignerSerializationProvider.GetSerializer(IDesignerSerializationManager manager, object? currentSerializer, Type? objectType, Type serializerType)
System\ComponentModel\Design\Serialization\CodeDomSerializationProvider.cs (5)
21object? IDesignerSerializationProvider.GetSerializer(IDesignerSerializationManager manager, object? currentSerializer, Type? objectType, Type serializerType) 48private static object? GetCodeDomSerializer(Type? objectType) 104private static object? GetMemberCodeDomSerializer(Type? objectType) 122private static object? GetTypeCodeDomSerializer(Type? objectType)
System\ComponentModel\Design\Serialization\CodeDomSerializer.cs (2)
29public virtual string? GetTargetComponentName(CodeStatement? statement, CodeExpression? expression, Type? targetType) 140if (value is Type type)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (34)
33protected virtual object DeserializeInstance(IDesignerSerializationManager manager, Type type, object?[]? parameters, string? name, bool addToContainer) 62Type? t = manager.GetType(typeref.BaseType); 112Type type = instance.GetType(); 141protected static Type GetReflectionTypeFromTypeHelper(IDesignerSerializationManager manager, Type type) 178private static bool TryGetTargetFrameworkProviderForType(IServiceProvider provider, Type type, [NotNullWhen(true)] out TypeDescriptionProvider? targetProvider) 191protected static Type GetReflectionTypeHelper(IDesignerSerializationManager manager, object instance) 296protected static AttributeCollection GetAttributesFromTypeHelper(IDesignerSerializationManager manager, Type type) 543if (lhs is Type type) 568Type fieldType = f.FieldType; 705Type? type = manager.GetType(GetTypeNameFromCodeTypeReference(manager, objectCreateEx.CreateType)); 730Type[] paramTypes = new Type[delegateParams.Length]; 803if (target is Type t) 865if (targetObject is Type t) 884Type? castType = manager.GetType(GetTypeNameFromCodeTypeReference(manager, castExpr.TargetType)); 934Type? targetType = manager.GetType(GetTypeNameFromCodeTypeReference(manager, castEx.TargetType)); 953Type? arrayType = manager.GetType(GetTypeNameFromCodeTypeReference(manager, arrayCreateEx.CreateType)); 1495Type? targetAsType = target as Type; 1571if (rhs is Type rhsType && rhsType.UnderlyingSystemType is not null) 1768Type desiredSerializerType = typeof(CodeDomSerializer); 1774Type? realSerializerType = vsManager is not null 1794Type? realSerializerType = vsManager is not null 1815Type? serializerType = vsManager is not null 1830Type? t = value?.GetType(); 1841protected CodeDomSerializer? GetSerializer(IDesignerSerializationManager manager, Type valueType) 1997Type expressionType = descriptor.MemberInfo!.DeclaringType!; 2035Type targetType = value.GetType(); 2066Type targetType = GetReflectionTypeHelper(manager, value); 2692Type? type = GetType(manager, fieldReferenceEx.FieldName, names); 2742Type? type = GetType(manager, variableReferenceEx.VariableName, names); 2790internal static Type? GetType(IDesignerSerializationManager manager, string name, Dictionary<string, string>? names) 2792Type? type = null;
System\ComponentModel\Design\Serialization\CollectionCodeDomSerializer.cs (12)
167Type collectionType = context?.ExpressionType ?? collection.GetType(); 234Type? finalType = null; 237Type objType = provider.GetReflectionType(obj); 239Type? candidateType = null; 247Type type = parameter.ParameterType; 296protected virtual object? SerializeCollection(IDesignerSerializationManager manager, CodeExpression? targetExpression, Type targetType, ICollection originalCollection, ICollection valuesToSerialize) 357Type elementType = provider.GetRuntimeType(addRangeMethodToUse.GetParameters()[0].ParameterType.GetElementType()!); 366Type elementType = provider.GetRuntimeType(addMethodToUse.GetParameters()[0].ParameterType); 386private CodeArrayCreateExpression? SerializeArray(IDesignerSerializationManager manager, Type targetType, Array array, ICollection valuesToSerialize) 397Type elementType = targetType.GetElementType()!; 471Type elementType, 556Type elementType,
System\ComponentModel\Design\Serialization\ComponentCodeDomSerializer.cs (4)
12private Type[]? _containerConstructor; 17private Type[] GetContainerConstructor(IDesignerSerializationManager manager) 87protected override object DeserializeInstance(IDesignerSerializationManager manager, Type type, object?[]? parameters, string? name, bool addToContainer) 320Type? reflectionType = null;
System\ComponentModel\Design\Serialization\ContainerCodeDomSerializer.cs (1)
25protected override object DeserializeInstance(IDesignerSerializationManager manager, Type type, object?[]? parameters, string? name, bool addToContainer)
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (23)
30private HashSet<Type>? _defaultProviderTable; 33private Dictionary<Type, object>? _serializers; 219protected virtual object CreateInstance(Type type, ICollection? arguments, string? name, bool addToContainer) 295Type?[] types = new Type?[argArray.Length]; 424public object? GetSerializer(Type? objectType, Type serializerType) 454Type? baseType = GetRuntimeType(typeName); 459Type? type = GetRuntimeType(designerAttribute.SerializerTypeName); 488Type? defaultSerializerType; 539protected virtual object? GetService(Type serviceType) 545protected virtual Type? GetType(string? typeName) 547Type? type = GetRuntimeType(typeName); 567public Type? GetRuntimeType(string? typeName) 575return _typeResolver is null ? Type.GetType(typeName!) : _typeResolver.GetType(typeName!); 741object IDesignerSerializationManager.CreateInstance(Type type, ICollection? arguments, string? name, bool addToContainer) 846object? IDesignerSerializationManager.GetSerializer(Type? objectType, Type serializerType) 854Type? IDesignerSerializationManager.GetType(string typeName) 857Type? type = null; 946object? IServiceProvider.GetService(Type serviceType) 1005public override Type ComponentType 1015public override Type PropertyType
System\ComponentModel\Design\Serialization\ExpressionContext.cs (3)
26public ExpressionContext(CodeExpression expression, Type expressionType, object owner, object? presetValue) 34public ExpressionContext(CodeExpression expression, Type expressionType, object owner) : this(expression, expressionType, owner, null) 47public Type ExpressionType { get; }
System\ComponentModel\Design\Serialization\PropertyMemberCodeDomSerializer.cs (2)
60if (propertyValue is not null and not Type && (!propertyValue.GetType().IsValueType)) 64Type type = TypeDescriptor.GetProvider(propertyValue).GetReflectionType(typeof(object));
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.cs (5)
32public override string? GetTargetComponentName(CodeStatement? statement, CodeExpression? expression, Type? type) 135protected override object DeserializeInstance(IDesignerSerializationManager manager, Type type, object?[]? parameters, string? name, bool addToContainer) 167private static Type? GetCastType(IDesignerSerializationManager manager, object? value) 178Type castTo = value.GetType(); 350Type? castTo = GetCastType(manager, value);
System\ComponentModel\Design\Serialization\TypeCodeDomSerializer.cs (3)
55Type? baseType = null; 60Type? t = manager.GetType(GetTypeNameFromCodeTypeReference(manager, typeRef)); 277Type? type = manager.GetType(typeName);
System\ComponentModel\Design\SiteNestedContainer.cs (2)
92protected override object? GetService(Type serviceType) 126internal object? GetServiceInternal(Type serviceType) => GetService(serviceType);
System\ComponentModel\Design\UndoEngine.cs (2)
283protected object GetRequiredService(Type serviceType) 303protected object? GetService(Type serviceType)
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (1)
360protected object? GetService(Type serviceType) => UndoEngine.GetService(serviceType);
System\Drawing\BitmapSelector.cs (4)
54private static Stream? GetResourceStreamHelper(Assembly assembly, Type type, string name) 69assembly.GetType(typeName) is Type type && DoesAssemblyHaveCustomAttribute(assembly, type); 71private static bool DoesAssemblyHaveCustomAttribute(Assembly assembly, Type attributeType) => 107internal static Stream? GetResourceStream(Type type, string originalName)
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
120private static Color[] GetConstants(Type enumType)
System\Drawing\Design\IconEditor.cs (1)
19private static readonly Type[] s_imageExtenders = [];
System\Drawing\Design\ImageEditor.cs (6)
18private static readonly Type[] s_imageExtenders = [typeof(BitmapEditor), typeof(MetafileEditor)]; 23protected virtual Type[] GetImageExtenders() => s_imageExtenders; 74foreach (Type extender in GetImageExtenders()) 82Type myClass = GetType(); 91&& editor.GetType() is Type editorClass 129foreach (Type extender in GetImageExtenders())
System\Drawing\Design\ToolboxItem.cs (11)
44public ToolboxItem(Type? toolType) : this() 258Type? createType = GetType(host, AssemblyName, TypeName, true); 437public Type? GetType(IDesignerHost? host) => GetType(host, AssemblyName, TypeName, false); 446protected virtual Type? GetType(IDesignerHost? host, AssemblyName? assemblyName, string typeName, bool reference) 448Type? type = null; 466type ??= Type.GetType(typeName); 537type ??= Type.GetType(typeName, false); 546public virtual void Initialize(Type? type) 556Type? parentType = type; 639private static AssemblyName? GetNonRetargetedAssemblyName(Type type, AssemblyName policiedAssemblyName) 743protected void ValidatePropertyType(string propertyName, object? value, Type expectedType, bool allowNull)
System\Resources\Tools\ITargetAwareCodeDomProvider.cs (1)
36bool SupportsProperty(Type type, string propertyName, bool isWritable);
System\Resources\Tools\StronglyTypedResourceBuilder.cs (6)
178Type? type = Type.GetType(typeName); 186Type type = (entry.Value is null) ? typeof(object) : entry.Value.GetType(); 279Type.GetType(node.GetValueTypeName(names: null)!), 398&& !targetAwareProvider.SupportsProperty(typeof(Type), "Assembly", isWritable: false); 686Type? type = data.Type;
System\Resources\Tools\StronglyTypedResourceBuilder.ResourceData.cs (2)
10internal ResourceData(Type? type, string? valueAsString) 16internal Type? Type { get; }
System\Windows\Forms\Design\BaseContextMenuStrip.cs (1)
260private readonly Type _itemType;
System\Windows\Forms\Design\CollectionEditVerbManager.cs (1)
132object IServiceProvider.GetService(Type serviceType)
System\Windows\Forms\Design\ColumnHeaderCollectionEditor.cs (1)
14public ColumnHeaderCollectionEditor(Type type)
System\Windows\Forms\Design\CommandSet.cs (1)
565protected virtual object? GetService(Type serviceType)
System\Windows\Forms\Design\ComponentTray.cs (11)
754Type compType = host.GetType(tool.TypeName); 765Type designerType = GetDesignerType(compType, typeof(IDesigner)); 769private Type GetDesignerType(Type t, Type designerBaseType) 771Type designerType = null; 778Type attributeBaseType = Type.GetType(da.DesignerBaseTypeName); 791designerType = Type.GetType(da.DesignerTypeName); 1000protected override object GetService(Type serviceType) 2868protected override object GetService(Type serviceType)
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (8)
317private static Type ToTargetType(object context, Type runtimeType) 322private static Type[] ToTargetTypes(object context, Type[] runtimeTypes) 324Type[] types = new Type[runtimeTypes.Length]; 343Type[] paramTypes, 400Type[] paramTypes = [typeof(bool)];
System\Windows\Forms\Design\ControlDesigner.CanResetSizePropertyDescriptor.cs (2)
18public override Type ComponentType => _basePropDesc.ComponentType; 24public override Type PropertyType => _basePropDesc.PropertyType;
System\Windows\Forms\Design\ControlDesigner.DesignerControlCollectionCodeDomSerializer.cs (1)
20Type targetType,
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (13)
80Type columnType = comboBoxItem.ColumnType; 202public static ComponentDesigner? GetComponentDesignerForType(ITypeResolutionService? typeResolutionService, Type type) 211Type? daType = Type.GetType(attribute.DesignerBaseTypeName); 222Type? designerType = typeResolutionService is not null 224: Type.GetType(designerAttribute.DesignerTypeName); 674foreach (Type type in columnTypes) 814private void SetDefaultDataGridViewColumnType(Type type) 835private int TypeToSelectedIndex(Type type) 900public ListBoxItem(Type propertyType, string propertyName) 906public Type PropertyType { get; } 915public ComboBoxItem(Type columnType) 922public Type ColumnType { get; }
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (9)
108private void ColumnTypeChanged(ListBoxItem item, Type newType) 339Type srcType = srcColumn.GetType(); 340Type destType = destColumn.GetType(); 1256object? ICustomTypeDescriptor.GetEditor(Type type) => TypeDescriptor.GetEditor(DataGridViewColumn, type); 1342public override Type ComponentType => typeof(ListBoxItem); 1346public override Type PropertyType => typeof(Type); 1372Type? type = value as Type;
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (6)
16private Type? _selectedType; 20private static readonly Type s_dataGridViewColumnType = typeof(DataGridViewColumn); 38public Type? SelectedType => _selectedType; 77public void Start(IWindowsFormsEditorService edSvc, ITypeDiscoveryService discoveryService, Type defaultType) 85foreach (Type t in columnTypes) 125private int TypeToSelectedIndex(Type type)
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.ListBoxItem.cs (3)
10private readonly Type _columnType; 12public ListBoxItem(Type columnType) => _columnType = columnType; 16public Type ColumnType => _columnType;
System\Windows\Forms\Design\DataGridViewComponentPropertyGridSite.cs (1)
39public object? GetService(Type t)
System\Windows\Forms\Design\DataGridViewDesigner.cs (2)
628Type propType = backEndProps[i].PropertyType; 630Type columnType;
System\Windows\Forms\Design\DataGridViewRowCollectionCodeDomSerializer.cs (1)
26protected override object SerializeCollection(IDesignerSerializationManager manager, CodeExpression? targetExpression, Type targetType, ICollection originalCollection, ICollection valuesToSerialize)
System\Windows\Forms\Design\DataMemberFieldConverter.cs (2)
11public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) => 19public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Windows\Forms\Design\DesignBindingPicker.cs (12)
132private static readonly Type s_runtimeType = typeof(object).GetType().GetType(); 730if (dataSource is Type) 1017Type? type = GetType(descriptor.TypeName, true, true); 1046else if (_selectedItem.DataSource is Type && _selectedItem.DataSource is Type type_ && 1065Type? dataSourceType = GetType(dataSourceDescriptor.TypeName, false, false); 1156Type? dsType = GetType(dataSourceDescriptor.TypeName, true, true); 1365Type? type = (dataSource as Type); 1396private Type? GetType(string name, bool throwOnError, bool ignoreCase) 1404return Type.GetType(name, throwOnError, ignoreCase); 1418Type? dsType = GetType(dataSourceDescriptor.TypeName, true, true);
System\Windows\Forms\Design\DesignerUtils.cs (2)
708List<Type> final = new(types.Count); 709foreach (Type t in types)
System\Windows\Forms\Design\DocumentDesigner.AxToolboxItem.cs (7)
20private Type? _axctlType; 161private Type? GetAxTypeFromReference(object reference, IDesignerHost host) 188private Type? GetAxTypeFromAssembly(Assembly a) 190Type[] types = a.GetTypes(); 194Type t = types[i]; 222Type? type = Type.GetType($"EnvDTE.ProjectItem, {AssemblyRef.EnvDTE}");
System\Windows\Forms\Design\DocumentDesigner.cs (1)
1022private object OnCreateService(IServiceContainer container, Type serviceType)
System\Windows\Forms\Design\DocumentDesigner.DocumentInheritanceService.cs (1)
37Type memberType;
System\Windows\Forms\Design\EditorServiceContext.cs (1)
100object? IServiceProvider.GetService(Type serviceType)
System\Windows\Forms\Design\EventHandlerService.cs (2)
13private Type? _lastHandlerType; 41public object? GetHandler(Type handlerType)
System\Windows\Forms\Design\IEventHandlerService.cs (1)
37object? GetHandler(Type handlerType);
System\Windows\Forms\Design\ImageCollectionEditor.cs (2)
22public ImageCollectionEditor(Type type) 63protected override object CreateInstance(Type type)
System\Windows\Forms\Design\ImageListImageEditor.cs (5)
18internal static Type[] s_imageExtenders = [typeof(BitmapEditor)]; 22protected override Type[] GetImageExtenders() => s_imageExtenders; 45foreach (Type extender in GetImageExtenders()) 47Type myClass = GetType(); 56&& editor.GetType() is Type editorClass
System\Windows\Forms\Design\ItemTypeToolStripMenuItem.cs (3)
15private readonly Type _itemType; 19public ItemTypeToolStripMenuItem(Type t) => _itemType = t; 21public Type ItemType
System\Windows\Forms\Design\LabelDesigner.cs (2)
68Type? type = Type.GetType("System.Windows.Forms.Label");
System\Windows\Forms\Design\ListControlStringCollectionEditor.cs (1)
15public ListControlStringCollectionEditor(Type type)
System\Windows\Forms\Design\ListViewGroupCollectionEditor.cs (2)
19public ListViewGroupCollectionEditor(Type type) : base(type) 25protected override object CreateInstance(Type itemType)
System\Windows\Forms\Design\ListViewItemCollectionEditor.cs (1)
19public ListViewItemCollectionEditor(Type type) : base(type)
System\Windows\Forms\Design\ListViewSubItemCollectionEditor.cs (2)
23public ListViewSubItemCollectionEditor(Type type) : base(type) 27protected override object CreateInstance(Type type)
System\Windows\Forms\Design\MaskDescriptor.cs (1)
36public abstract Type? ValidatingType { get; }
System\Windows\Forms\Design\MaskDescriptorTemplate.cs (3)
13public MaskDescriptorTemplate(string? mask, string name, string? sample, Type? validatingType, CultureInfo culture) 18public MaskDescriptorTemplate(string? mask, string name, string? sample, Type? validatingType, CultureInfo? culture, bool skipValidation) 44public override Type? ValidatingType { get; }
System\Windows\Forms\Design\MaskDesignerDialog.cs (2)
308public Type? ValidatingType { get; private set; } 376foreach (Type t in descriptors)
System\Windows\Forms\Design\OleDragDropHandler.ComponentDataObject.cs (3)
158public virtual object? GetData(Type t) 185public bool GetDataPresent(Type format) 294public void SetData(Type format, object? data)
System\Windows\Forms\Design\OleDragDropHandler.cs (1)
1066protected object? GetService(Type t)
System\Windows\Forms\Design\SelectionUIHandler.cs (1)
181protected abstract object? GetService(Type serviceType);
System\Windows\Forms\Design\StandardMenuStripVerb.cs (1)
451private string NameFromText(string text, Type itemType, INameCreationService nameCreationService, bool adjustCapitalization)
System\Windows\Forms\Design\StringArrayEditor.cs (2)
11public StringArrayEditor(Type type) 16protected override Type CreateCollectionItemType() => CollectionType.GetElementType() ?? typeof(string[]);
System\Windows\Forms\Design\StringCollectionEditor.cs (1)
15public StringCollectionEditor(Type type)
System\Windows\Forms\Design\StyleCollectionEditor.cs (1)
18public StyleCollectionEditor(Type type) : base(type)
System\Windows\Forms\Design\TableLayoutControlCollectionCodeDomSerializer.cs (1)
20protected override object SerializeCollection(IDesignerSerializationManager manager, CodeExpression? targetExpression, Type targetType, ICollection originalCollection, ICollection valuesToSerialize)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
2224protected override object SerializeCollection(IDesignerSerializationManager manager, CodeExpression targetExpression, Type targetType, ICollection originalCollection, ICollection valuesToSerialize)
System\Windows\Forms\Design\TabPageCollectionEditor.cs (1)
34protected override object CreateInstance(Type itemType)
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (3)
49Type t = senderItem.ItemType; 54private void InsertItem(Type t) 63private void InsertToolStripItem(Type t)
System\Windows\Forms\Design\ToolStripContainerDesigner.cs (2)
170Type? toolType = tool.GetType(_designerHost); 343Type toolType = component.GetType();
System\Windows\Forms\Design\ToolStripDesigner.cs (4)
507private ToolStripItem AddNewItem(Type t) 562internal ToolStripItem AddNewItem(Type t, string text, bool enterKeyPressed, bool tabKeyPressed) 1637internal static string NameFromText(string text, Type componentType, IServiceProvider serviceProvider, bool adjustCapitalization) 1656internal static string NameFromText(string text, Type componentType, IServiceProvider serviceProvider)
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (20)
19private static readonly Type s_toolStripItemType = typeof(ToolStripItem); 21private static Dictionary<Type, ToolboxItem> t_cachedToolboxItems; 32private static Dictionary<Type, Bitmap> t_cachedWinformsImages; 42private static readonly Type[] s_newItemTypesForToolStrip = 45private static readonly Type[] s_newItemTypesForStatusStrip = 48private static readonly Type[] s_newItemTypesForMenuStrip = 51private static readonly Type[] s_newItemTypesForToolStripDropDownMenu = 109private static ToolboxItem GetCachedToolboxItem(Type itemType) 132private static Bitmap GetKnownToolboxBitmap(Type itemType) 147public static Bitmap GetToolboxBitmap(Type itemType) 169public static string GetToolboxDescription(Type itemType) 191public static Type[] GetStandardItemTypes(IComponent component) 235public static Type[] GetCustomItemTypes(IComponent component, IServiceProvider serviceProvider) 246public static Type[] GetCustomItemTypes(IComponent component, ITypeDiscoveryService discoveryService) 257Type[] stockItemTypeList = GetStandardItemTypes(component); 260List<Type> creatableTypes = new(itemTypes.Count); 261foreach (Type t in itemTypes) 291foreach (Type stockType in stockItemTypeList) 321Type[] standardTypes = GetStandardItemTypes(component); 345Type[] customTypes = GetCustomItemTypes(component, serviceProvider);
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (9)
286Type t = senderItem.ItemType; 299private void MorphToolStripItem(Type t) 310private void InsertItem(Type t) 325private void InsertStripItem(Type t) 340private void InsertMenuItem(Type t) 370private void InsertIntoDropDown(ToolStripDropDown parent, Type t) 432private void InsertIntoMainMenu(MenuStrip parent, Type t) 471private void InsertIntoStatusStrip(StatusStrip parent, Type t) 510private void InsertToolStripItem(Type t)
System\Windows\Forms\Design\ToolStripItemDesigner.cs (2)
323internal virtual void CommitEdit(Type type, string text, bool commit, bool enterKeyPressed, bool tabKeyPressed) 713internal virtual ToolStripItem MorphCurrentItem(Type t)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (4)
425internal override void CommitEdit(Type type, string text, bool commit, bool enterKeyPressed, bool tabKeyPressed) 765private ToolStripItem CreateDummyItem(Type t, int dummyIndex) 840private ToolStripItem CreateNewItem(Type t, int dummyIndex, string newText) 1649internal override ToolStripItem MorphCurrentItem(Type t)
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (2)
172Type? toolType = tool.GetType(_designerHost); 305Type toolType = component.GetType();
System\Windows\Forms\Design\ToolStripTemplateNode.cs (4)
85private Type _itemType; 377public Type ToolStripItemType 777Type selectedType; 791Type[] supportedTypes = ToolStripDesignerUtils.GetStandardItemTypes(_component);
System\Windows\Forms\Design\TreeNodeCollectionEditor.cs (1)
15public TreeNodeCollectionEditor(Type type) : base(type)
System.Windows.Forms.Design.Tests (202)
CodeDomHelpers.cs (2)
117Type result = Type.GetType(reference.BaseType);
ControlDesignerTests.cs (3)
229mockServiceProvider.Setup(s => s.GetService(It.IsAny<Type>())).Returns((object?)null); 295mockServiceProvider.Setup(s => s.GetService(It.IsAny<Type>())).Returns((object?)null); 305var expectedGlyphs = new (Type glyphType, SelectionRules rules)[]
EnsureDesignerTests.cs (2)
16IEnumerable<Type> designers = typeof(ComponentDesigner).Assembly 20foreach (Type designer in designers)
EnsureEditorsTests.cs (10)
20Type[] nonTypeForwardedEditors = 28IEnumerable<Type> editors = typeof(ComponentDesigner).Assembly 33foreach (Type editor in editors) 69public void EnsureUITypeEditorForType(Type type, Type expectedEditorType) 147public void EnsureUITypeEditorForProperty(Type type, string propertyName, Type expectedEditorType) 163public void EnsureUITypeEditorForMethod(Type type, string methodName, Type expectedEditorType) 165Type reflectType = TypeDescriptor.GetReflectionType(type);
System\ComponentModel\Design\ArrayEditorTests.cs (8)
25public void ArrayEditor_Ctor_Type(Type type, Type expectedItemType) 120public void ArrayEditor_GetDisplayText_Invoke_ReturnsExpected(Type type, object value, string expected) 208public void ArrayEditor_SetItems_NullCollectionItemType_ThrowsArgumentNullException(Type type) 218public SubArrayEditor(Type type) : base(type) 222public new Type CollectionItemType => base.CollectionItemType; 224public new Type CollectionType => base.CollectionType; 230public new Type[] NewItemTypes => base.NewItemTypes;
System\ComponentModel\Design\CollectionEditorTests.cs (29)
28public void CollectionEditor_Ctor_Type(Type type, Type expectedItemType) 126public void CollectionEditor_CreateCollectionItemType_Invoke_ReturnsExpected(Type type, Type expected) 129Type itemType = editor.CreateCollectionItemType(); 351public void CollectionEditor_CreateInstance_InvokeWithoutContext_ReturnsExpected(Type type, object expected) 365[InlineData(typeof(object), new Type[] { typeof(object) })] 366[InlineData(typeof(int[]), new Type[] { typeof(object) })] 367[InlineData(typeof(IList<int>), new Type[] { typeof(int) })] 368[InlineData(typeof(ClassWithItem), new Type[] { typeof(int) })] 369[InlineData(typeof(ClassWithPrivateItem), new Type[] { typeof(object) })] 370[InlineData(typeof(ClassWithStaticItem), new Type[] { typeof(object) })] 371[InlineData(typeof(ClassWithItems), new Type[] { typeof(int) })] 372[InlineData(typeof(ClassWithPrivateItems), new Type[] { typeof(object) })] 373[InlineData(typeof(ClassWithStaticItems), new Type[] { typeof(object) })] 374public void CollectionEditor_CreateNewItemTypes_Invoke_ReturnsExpected(Type type, Type[] expected) 377Type[] itemTypes = editor.CreateNewItemTypes(); 802public void CollectionEditor_GetDisplayText_Invoke_ReturnsExpected(Type type, object value, string expected) 837public void CollectionEditor_GetService_WithContext_CallsContextGetService(Type serviceType) 874public void CollectionEditor_GetService_InvokeWithoutContext_ReturnsNull(Type serviceType) 1020public SubCollectionEditor(Type type) : base(type) 1024public new Type CollectionItemType => base.CollectionItemType; 1026public new Type CollectionType => base.CollectionType; 1032public new Type[] NewItemTypes => base.NewItemTypes; 1042public new Type CreateCollectionItemType() => base.CreateCollectionItemType(); 1044public new object CreateInstance(Type itemType) => base.CreateInstance(itemType); 1046public new Type[] CreateNewItemTypes() => base.CreateNewItemTypes(); 1054public new object GetService(Type serviceType) => base.GetService(serviceType);
System\ComponentModel\Design\CollectionFormTests.cs (9)
758public void CollectionForm_GetService_WithContext_CallsContextGetService(Type serviceType) 796public void CollectionForm_GetService_InvokeWithoutContext_ReturnsNull(Type serviceType) 827public SubCollectionEditor(Type type) : base(type) 836public CustomSetItemsCollectionEditor(Type type) : base(type) 851public new Type CollectionItemType => base.CollectionItemType; 853public new Type CollectionType => base.CollectionType; 863public new Type[] NewItemTypes => base.NewItemTypes; 869public new object CreateInstance(Type itemType) => base.CreateInstance(itemType); 875public new object GetService(Type serviceType) => base.GetService(serviceType);
System\ComponentModel\Design\ComponentDesignerTests.cs (14)
1951public void ComponentDesigner_GetService_InvokeWithComponentWithSite_ReturnsNull(Type serviceType) 1984public void ComponentDesigner_GetService_InvokeWithComponentWithoutSite_ReturnsNull(Type serviceType) 1994public void ComponentDesigner_GetService_InvokeWithoutComponent_ReturnsNull(Type serviceType) 2169.Callback<Type, object>((t, s) => set = Assert.IsAssignableFrom<DesignerCommandSet>(s)) 2381yield return new object[] { null, new Dictionary<Type, object>(), null }; 2383yield return new object[] { InheritanceAttribute.Default, new Dictionary<Type, object>(), null }; 2385yield return new object[] { InheritanceAttribute.Inherited, new Dictionary<Type, object>(), InheritanceAttribute.Inherited }; 2387yield return new object[] { InheritanceAttribute.InheritedReadOnly, new Dictionary<Type, object>(), InheritanceAttribute.InheritedReadOnly }; 2389yield return new object[] { InheritanceAttribute.NotInherited, new Dictionary<Type, object>(), null }; 2404yield return new object[] { new Dictionary<Type, object>(), InheritanceAttribute.Default }; 2405yield return new object[] { new Dictionary<Type, object> { { typeof(InheritanceAttribute), null } }, InheritanceAttribute.Default }; 2406yield return new object[] { new Dictionary<Type, object> { { typeof(InheritanceAttribute), new object() } }, InheritanceAttribute.Default }; 2408yield return new object[] { new Dictionary<Type, object> { { typeof(InheritanceAttribute), attribute } }, attribute }; 2940public new object GetService(Type serviceType) => base.GetService(serviceType);
System\ComponentModel\Design\DesignerHostTests.cs (9)
243.Setup(s => s.CreateName(It.IsAny<IContainer>(), It.IsAny<Type>())) 616.Setup(s => s.CreateName(It.IsAny<IContainer>(), It.IsAny<Type>())) 672.Setup(s => s.CreateName(It.IsAny<IContainer>(), It.IsAny<Type>())) 750.Setup(p => p.GetTypeDescriptor(It.IsAny<Type>(), It.IsAny<object>())) 847.Setup(p => p.GetTypeDescriptor(It.IsAny<Type>(), It.IsAny<object>())) 2361public void DesignerHost_GetService_IServiceContainer_ReturnsExpected(Type serviceType) 2383public void DesignerHost_GetType_InvokeWithTypeResolutionService_ReturnsExpected(string typeName, Type expected) 3109Assert.Equal(typeof(IDesignerHost).GetMethod(nameof(IDesignerHost.Activate)), reflect.GetMethod(nameof(IDesignerHost.Activate), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public, null, Array.Empty<Type>(), Array.Empty<ParameterModifier>())); 3126Assert.Equal(typeof(IDesignerHost).GetProperty(nameof(IDesignerHost.Container)), reflect.GetProperty(nameof(IDesignerHost.Container), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public, null, typeof(IContainer), Array.Empty<Type>(), Array.Empty<ParameterModifier>()));
System\ComponentModel\Design\DesignSurfaceTests.cs (16)
169Assert.Throws<ArgumentNullException>("rootComponentType", () => new DesignSurface((Type)null)); 278public void DesignSurface_ServiceContainer_GetFixedService_ReturnsExpected(Type serviceType) 287public void DesignSurface_ServiceContainer_RemoveFixedService_ThrowsInvalidOperationException(Type serviceType) 301public void DesignSurface_ServiceContainer_RemoveNonFixedServiceType_ThrowsArgumentNullException(Type serviceType) 333public void DesignSurface_View_GetWithInvalidSupportedTechnologies_ThrowsNotSupportedException(Type rootComponentType) 944Assert.Throws<ArgumentNullException>("rootComponentType", () => surface.BeginLoad((Type)null)); 1048public void DesignSurface_CreateComponent_NonIComponent_ReturnsNull(Type type) 1059public void DesignSurface_CreateComponent_TypeWithNoMatchingConstructor_ThrowsMissingMethodException(Type type) 1115public void DesignSurface_CreateInstance_TypeWithNoMatchingConstructor_ThrowsMissingMethodException(Type type) 1537public void DesignSurface_GetService_IServiceContainer_ReturnsExpected(Type serviceType) 1545public void DesignSurface_GetService_GetFixedService_ReturnsExpected(Type serviceType) 1560public void DesignSurface_GetService_Disposed_ReturnsNull(Type serviceType) 1723public SubDesignSurface(Type rootComponentType) : base(rootComponentType) 1727public SubDesignSurface(IServiceProvider parentProvider, Type rootComponentType) : base(parentProvider, rootComponentType) 1736public new IComponent CreateComponent(Type componentType) => base.CreateComponent(componentType); 1741public new object CreateInstance(Type type) => base.CreateInstance(type);
System\ComponentModel\Design\Serialization\DesignerSerializationManagerTests.cs (42)
414public void DesignerSerializationManager_AddSerializationProvider_NonNullProvider_GetSerializerReturnsExpected(Type objectType, object expected) 971public void DesignerSerializationManager_GetService_WithProvider_ReturnsExpected(Type serviceType) 1000public void DesignerSerializationManager_GetService_NoProvider_ReturnsNull(Type serviceType) 1024public void DesignerSerializationManager_IDesignerSerializationManagerGetService_WithProvider_ReturnsExpected(Type serviceType) 1053public void DesignerSerializationManager_IDesignerSerializationManagerGetService_NoProvider_ReturnsNull(Type serviceType) 1071public void DesignerSerializationManager_GetRuntimeType_ValidProvider_ReturnsExpected(string typeName, Type resolvedType) 1137public void DesignerSerializationManager_GetRuntimeType_NoProvider_ReturnsExpected(string typeName, Type expected) 1152foreach (Type objectType in new Type[] { null, typeof(int) }) 1179public void DesignerSerializationManager_GetSerializer_CustomIDesignerSerializationProvider_ReturnsExpected(Type objectType, Type serializerType, object expected) 1190public void DesignerSerializationManager_GetSerializerWithSession_CustomIDesignerSerializationProvider_ReturnsExpected(Type objectType, Type serializerType, object expected) 1209public void DesignerSerializationManager_GetSerializer_CustomDesignerSerializerNoSession_ReturnsExpected(Type objectType, Type expectedSerializerType) 1241public void DesignerSerializationManager_GetSerializer_CustomDesignerSerializerWithSession_ReturnsExpected(Type objectType, Type expectedSerializerType) 1289public void DesignerSerializationManager_GetSerializer_NullSerializerType_ThrowsArgumentNullException(Type objectType) 1297public void DesignerSerializationManager_IDesignerSerializationManagerGetSerializer_CustomIDesignerSerializationProvider_ReturnsExpected(Type objectType, Type serializerType, object expected) 1309public void DesignerSerializationManager_IDesignerSerializationManagerGetSerializerWithSession_CustomIDesignerSerializationProvider_ReturnsExpected(Type objectType, Type serializerType, object expected) 1323public void DesignerSerializationManager_IDesignerSerializationManagerGetSerializer_CustomDesignerSerializerNoSession_ReturnsExpected(Type objectType, Type expectedSerializerType) 1356public void DesignerSerializationManager_IDesignerSerializationManagerGetSerializer_CustomDesignerSerializerWithSession_ReturnsExpected(Type objectType, Type expectedSerializerType) 1409public void DesignerSerializationManager_IDesignerSerializationManagerGetSerializer_NullSerializerType_ThrowsArgumentNullException(Type objectType) 1429public void DesignerSerializationManager_GetType_ValidProvider_ReturnsExpected(string typeName, Type resolvedType, int typeDescriptionProviderServiceCount, bool supportedType, Type expected) 1542public void DesignerSerializationManager_GetType_NoProvider_ReturnsExpected(string typeName, Type expected) 1557public void DesignerSerializationManager_IDesignerSerializationManagerGetType_ValidProvider_ReturnsExpected(string typeName, Type resolvedType, int typeDescriptionProviderServiceCount, bool supportedType, Type expected) 1618public void DesignerSerializationManager_IDesignerSerializationManagerGetType_NoProvider_ReturnsExpected(string typeName, Type expected) 1992public new object CreateInstance(Type type, ICollection arguments, string name, bool addToContainer) 1997public new object GetService(Type serviceType) => base.GetService(serviceType); 1999public new Type GetType(string typeName) => base.GetType(typeName); 2120public object GetSerializer(IDesignerSerializationManager manager, object currentSerializer, Type objectType, Type serializerType) 2134public object GetSerializer(IDesignerSerializationManager manager, object currentSerializer, Type objectType, Type serializerType) 2142public object GetSerializer(IDesignerSerializationManager manager, object currentSerializer, Type objectType, Type serializerType)
System\ComponentModel\Design\Serialization\ExpressionContextTests.cs (2)
18public void ExpressionContext_Ctor_CodeExpression_Type_Object_Object_TestData(CodeExpression expression, Type expressionType, object owner, object presetValue) 34public void ExpressionContext_Ctor_CodeExpression_Type_Object_TestData(CodeExpression expression, Type expressionType, object owner)
System\ComponentModel\Design\SiteNestedContainerTests.cs (1)
149.Setup(s => s.CreateName(It.IsAny<IContainer>(), It.IsAny<Type>()))
System\Drawing\Design\BitmapEditorTests.cs (1)
117protected override Type[] GetImageExtenders() => [typeof(CustomGetExtensionsEditor)];
System\Drawing\Design\ColorEditorTests.CustomColorDialogTests.cs (1)
13Type? typeCustomColorDialog = typeof(ColorEditor).Assembly.GetTypes().SingleOrDefault(t => t.Name == "CustomColorDialog");
System\Drawing\Design\ImageEditorTests.cs (4)
112Type[] extenders = editor.GetImageExtenders(); 214public new Type[] GetImageExtenders() => base.GetImageExtenders(); 223public Type[] GetImageExtendersResult { get; set; } 229protected override Type[] GetImageExtenders()
System\Drawing\Design\MetafileEditorTests.cs (1)
92protected override Type[] GetImageExtenders() => [typeof(CustomGetExtensionsEditor)];
System\Drawing\Design\ToolboxItemTests.cs (12)
1278public void ToolboxItem_GetType_InvokeWithoutTypeNameAssemblyName_ReturnsExpected(IDesignerHost host, AssemblyName assemblyName, string typeName, bool reference, Type expected) 1295public void ToolboxItem_GetType_InvokeWithTypeNameAssemblyName_ReturnsExpected(IDesignerHost host, AssemblyName assemblyName, string typeName, bool reference, Type expected) 1335public void ToolboxItem_Initialize_TypeWithAttributes_Success(Type type, Size expectedOriginalBitmapSize) 1440public void ToolboxItem_Initialize_Locked_ThrowsInvalidOperationException(Type type) 1604public void ToolboxItem_ValidatePropertyType_NullDisallowed_ThrowsArgumentNullException(string propertyName, Type expectedType) 1613public void ToolboxItem_ValidatePropertyType_NullAllowed_Nop(string propertyName, Type expectedType) 1656public new Type GetType(IDesignerHost host, AssemblyName assemblyName, string typeName, bool reference) 1676public new void ValidatePropertyType(string propertyName, object value, Type expectedType, bool allowNull) 1698public Type GetType(string name) 1705return Type.GetType(name); 1708public Type GetType(string name, bool throwOnError) 1713public Type GetType(string name, bool throwOnError, bool ignoreCase)
System\Resources\Tools\CodeDomCompileHelper.cs (2)
57internal static Type CompileClass( 73Type type = assembly.GetType(fullName, throwOnError: true);
System\Resources\Tools\StronglyTypedResourceBuilderTests.cs (5)
201Type type = CodeDomCompileHelper.CompileClass(compileUnit, "Resources"); 229Type type = CodeDomCompileHelper.CompileClass(compileUnit, "Resources", "Namespace", resourceStream); 260Type type = CodeDomCompileHelper.CompileClass(compileUnit, "Resources", "Namespace", resourceStream); 289Type type = CodeDomCompileHelper.CompileClass(compileUnit, "Resources", "Namespace", resourceStream); 666Type type = CodeDomCompileHelper.CompileClass(compileUnit, "Resources", "Namespace", resourceStream);
System\Windows\Forms\Design\AnchorEditorTests.cs (1)
85Type type = typeof(AnchorEditor)
System\Windows\Forms\Design\ContentAlignmentEditorTests.cs (1)
25Type type = editor.GetType()
System\Windows\Forms\Design\ControlDesigner.DesignerControlCollectionTests.cs (1)
183public object? GetService(Type serviceType) => null;
System\Windows\Forms\Design\DataMemberFieldConverterTests.cs (3)
35public static void ConvertTo(object actual, Type expectedType, object expected) 43public static void ConvertTo_ThrowsNotSupportedException(object actual, Type expectedType) 58public object GetService(Type serviceType) { return null; }
System\Windows\Forms\Design\MaskDescriptorComparerTests.cs (4)
15public override Type? ValidatingType { get; } 17public TestMaskDescriptor(string name, string sample, Type validatingType) 52public void GetHashCode_TestCases(string nameA, string sampleA, Type typeA, string nameB, string sampleB, Type typeB, bool expectSameHashCode)
System\Windows\Forms\Design\MaskDescriptorTemplateTests.cs (1)
19public void MaskDescriptorTemplate_Constructor_Validation(string? mask, string? name, string? sample, Type? validatingType, string? cultureName, bool skipValidation, bool isValid)
System\Windows\Forms\Design\MaskDescriptorTests.cs (8)
28private readonly Type? _validatingType; 36public override Type? ValidatingType => _validatingType; 38public ConcreteMaskDescriptor(string? mask, string? name = null, string? sample = null, Type? validatingType = null) 100public void Equals_VariousScenarios(string mask2, string name2, string sample2, Type type2, bool expected) 105Type type1 = typeof(DateTime); 122public void GetHashCode_VariousScenarios(string mask2, string name2, string sample2, Type type2, bool shouldMatch, string reason, string culture1 = "", string culture2 = "") 129Type type1 = typeof(DateTime); 170public void ConcreteMaskDescriptor_ToString_ShouldReturnExpectedFormat(string? mask, string? name, string? sample, Type? validatingType, string expectedOutput)
System\Windows\Forms\Design\MaskDesignerDialogTests.cs (5)
75public void DiscoverMaskDescriptors_ShouldHandleVariousDescriptorTypes(Type descriptorType, bool shouldBeAdded) 78List<Type> types = new(){ descriptorType }; 100public override Type? ValidatingType => null; 108public override Type? ValidatingType => null; 117public override Type? ValidatingType => typeof(string);
System\Windows\Forms\Design\TabControlDesignerTests.cs (1)
58public void CanParent_ReturnsExpectedResult(Type controlType, bool expected)
ToolStripDropDownDesignerTest.cs (1)
30mockDesignerHost.Setup(s => s.AddService(It.IsAny<Type>(), It.IsAny<object>()));
TreeNodeCollectionEditorTests.cs (3)
11Type type = typeof(TreeNode); 19Type type = typeof(TreeNode); 28Type type = typeof(TreeNode);
System.Windows.Forms.Interop.Tests (1)
AccessibleObjectTests.cs (1)
717Type type = typeof(Accessibility.IAccessible);
System.Windows.Forms.Primitives (13)
System\ComponentModel\Design\Serialization\DesignerSerializationManagerHelper.cs (2)
27public static T? GetSerializer<T>(this IDesignerSerializationManager manager, Type? objectType) where T : class 32public static bool TryGetSerializer<T>(this IDesignerSerializationManager manager, Type? objectType, [NotNullWhen(true)] out T? serializer) where T : class
System\ComponentModel\TypeDescriptorHelper.cs (2)
19[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType, 26public static T? GetEditor<T>([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
System\Windows\Forms\Internals\ScaleHelper.cs (4)
318internal static Bitmap GetIconResourceAsDefaultSizeBitmap(Type type, string resource) => 324internal static Bitmap GetSmallIconResourceAsBitmap(Type type, string resource, int dpi) => 330internal static Bitmap GetIconResourceAsBitmap(Type type, string resource, Size size) 357internal static Bitmap GetIconResourceAsBestMatchBitmap(Type type, string resource, Size size)
System\Windows\Forms\Message.cs (1)
89Type cls) => Marshal.PtrToStructure(LParamInternal, cls);
System\Windows\Forms\PaddingConverter.cs (3)
14public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) => 17public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) => 43public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
Windows\Win32\System\Ole\ClassPropertyDispatchAdapter.cs (1)
22private readonly Type _type;
System.Windows.Forms.Primitives.TestUtilities (10)
Extensions\AssertExtensions.cs (8)
179public static Exception Throws(Type netCoreExceptionType, Type netFxExceptionType, Action action) 205public static void ThrowsAny(Type firstExceptionType, Type secondExceptionType, Action action) 210private static void ThrowsAnyInternal(Action action, params Type[] exceptionTypes) 218Type exceptionType = e.GetType(); 222throw new XunitException($"Expected one of: ({string.Join<Type>(", ", exceptionTypes)}) -> Actual: ({exceptionType}): {e}"); // Log message and callstack to help diagnosis 225throw new XunitException($"Expected one of: ({string.Join<Type>(", ", exceptionTypes)}) -> Actual: No exception thrown");
System\Windows\Forms\BinaryFormat\BinaryFormatTestExtensions.cs (2)
38/// Returns `true` if the <see cref="Type"/> would use the <see cref="BinaryFormatter"/> for the purposes 41public static bool IsBinaryFormatted(this Type type)
System.Windows.Forms.Tests (516)
MaskedTextBoxTests.cs (1)
746public void MaskedTextBox_ValidatingTypeAndValidateText_ReturnsExpected(Type validatingType, string text)
System\Resources\ResXResourceWriterTests.cs (1)
16private readonly Func<Type, string> _typeNameConverter = type => type?.AssemblyQualifiedName ?? string.Empty;
System\Resources\ResXSerializationBinderTests.cs (3)
74public Type? GetType(string typeName) 107public Type? GetType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] string name, bool throwOnError) => throw new NotImplementedException(); 109public Type? GetType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] string name, bool throwOnError, bool ignoreCase) => throw new NotImplementedException();
System\Windows\Forms\AccessibleObjects\AccessibleObjectTests.cs (2)
2694foreach (Type type in assembly.GetTypes()) 2713public void AccessibleObject_RuntimeId_IsOverridden(Type type)
System\Windows\Forms\AccessibleObjects\Control.ControlAccessibleObjectTests.cs (21)
17private static readonly Type[] s_controlsNotUseTextForAccessibility = 42private static readonly Type[] s_controlsIgnoringTextChangesForTests = 1241public void ControlAccessibleObject_Custom_Role_ReturnsExpected(Type type) 1260public void ControlAccessibleObject_GetPropertyValue_AccessKey_ReturnExpected(Type type) 1282public void ControlAccessibleObject_IsPatternSupported_LegacyIAccessible_ReturnsTrue(Type type) 1300public void ControlAccessibleObject_Custom_Description_ReturnsExpected(Type type) 1319public void ControlAccessibleObject_GetPropertyValue_Custom_Name_ReturnsExpected(Type type) 1340var typeDefaultValues = new Dictionary<Type, string> 1349foreach (Type type in ReflectionHelper.GetPublicNotAbstractClasses<Control>()) 1361public void ControlAccessibleObject_GetPropertyValue_Default_Name_ReturnsExpected(Type type, string expectedName) 1408public void ControlAccessibleObject_FragmentRoot_IsNullOrOwnObject(Type type) 1423public unsafe void ControlAccessibleObject_FragmentRoot_IsToolStrip_IfControlIsUsedAsToolStripItem(Type type) 1455public void ControlAccessibleObject_FragmentNavigate_Parent_IsNull(Type type) 1471public void ControlAccessibleObject_FragmentNavigate_Siblings_AreNull(Type type) 1490public void ControlAccessibleObject_FragmentNavigate_ParentIsToolStrip_IfControlIsUsedAsToolStripItem(Type type) 1524public void ControlAccessibleObject_FragmentNavigate_NextSibling_IsNextItem_IfControlIsUsedAsToolStripItem(Type type) 1562public void ControlAccessibleObject_FragmentNavigate_PreviousSibling_IsPreviousItem_IfControlIsUsedAsToolStripItem(Type type) 1628public void ControlAccessibleObject_DoesNotRootControls_AllPublicControl(Type type) 1635static Control.ControlAccessibleObject CreateAndDisposeControl(Type type) 1659public void ControlAccessibleObject_Shortcut_Invoke_ReturnsExpected(Type type) 1703public void ControlAccessibleObject_Name_Invoke_ReturnsExpected(Type type)
System\Windows\Forms\AccessibleObjects\DataGridViewAccessibleObjectTests.cs (1)
263Type type = dataGridView.AccessibilityObject.GetType();
System\Windows\Forms\AccessibleObjects\DataGridViewSelectedCellsAccessibleObjectTests.cs (13)
14Type type = typeof(DataGridView) 25Type type = typeof(DataGridView) 35Type type = typeof(DataGridView) 45Type type = typeof(DataGridView) 56Type type = typeof(DataGridView) 67Type type = typeof(DataGridView) 84Type type = typeof(DataGridView) 102Type type = typeof(DataGridView) 126Type type = typeof(DataGridView) 145Type type = typeof(DataGridView) 161Type type = typeof(DataGridView) 182Type type = typeof(DataGridView) 201Type type = typeof(DataGridView)
System\Windows\Forms\AccessibleObjects\DataGridViewSelectedRowCellsAccessibleObjectTests.cs (13)
14Type type = typeof(DataGridViewRow) 25Type type = typeof(DataGridViewRow) 35Type type = typeof(DataGridViewRow) 45Type type = typeof(DataGridViewRow) 59Type type = typeof(DataGridViewRow) 70Type type = typeof(DataGridViewRow) 87Type type = typeof(DataGridViewRow) 105Type type = typeof(DataGridViewRow) 130Type type = typeof(DataGridViewRow) 151Type type = typeof(DataGridViewRow) 168Type type = typeof(DataGridViewRow) 190Type type = typeof(DataGridViewRow) 210Type type = typeof(DataGridViewRow)
System\Windows\Forms\AccessibleObjects\ErrorProvider.ControlItem.ControlItemAccessibleObjectTests.cs (13)
17Type type = typeof(ControlItem) 32Type type = typeof(ControlItem) 52Type type = typeof(ControlItem) 67Type type = typeof(ControlItem) 82Type type = typeof(ControlItem) 93Type type = typeof(ControlItem) 103Type type = typeof(ControlItem) 134Type type = typeof(ControlItem) 150Type type = typeof(ControlItem) 162Type type = typeof(ControlItem) 172Type type = typeof(ControlItem) 194Type type = typeof(ControlItem) 215Type type = typeof(ControlItem)
System\Windows\Forms\AccessibleObjects\ErrorProvider.ErrorWindow.ErrorWindowAccessibleObjectTests.cs (7)
16Type type = typeof(ErrorWindow) 27Type type = typeof(ErrorWindow) 37Type type = typeof(ErrorWindow) 48Type type = typeof(ErrorWindow) 58Type type = typeof(ErrorWindow) 68Type type = typeof(ErrorWindow) 80Type type = typeof(ErrorWindow)
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (1)
24Type type = listGroup.AccessibilityObject.GetType();
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (1)
20Type type = listItem.AccessibilityObject.GetType();
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarBodyAccessibleObjectTests.cs (1)
251public void CalendarBodyAccessibleObject_GetItem_ReturnsExpectedResult_ForGivenIndices(int rowIndex, int columnIndex, Type expectedType)
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarCellAccessibleObjectTests.cs (1)
264public void CalendarCellAccessibleObject_GetRowHeaderItems_ReturnsCorrectly(bool showWeekNumbers, int expectedCount, Type expectedType)
System\Windows\Forms\AccessibleObjects\PropertyGrid.PropertyGridAccessibleObjectTests.cs (1)
218public object GetService(Type serviceType)
System\Windows\Forms\AccessibleObjects\PropertyGridView.GridViewListBoxItemAccessibleObjectTests.cs (5)
16Type type = typeof(PropertyGridView) 25Type type = typeof(PropertyGridView) 34Type type = typeof(PropertyGridView) 49Type type = typeof(PropertyGridView) 63Type type = typeof(PropertyGridView)
System\Windows\Forms\AccessibleObjects\PropertyGridView.PropertyGridViewAccessibleObjectTests.cs (1)
205Type type = accessibleObject.GetType();
System\Windows\Forms\AccessibleObjects\ToolStripControlHost.ToolStripHostedControlAccessibleObjectTests.cs (1)
18public void ToolStripHostedControlAccessibleObject_GetPropertyValue_IsOffscreenPropertyId_ReturnExpected(Type type)
System\Windows\Forms\AccessibleObjects\ToolStripDropDownMenu.ToolStripDropDownMenuAccessibleObjectTests.cs (15)
12IEnumerable<Type> types = ReflectionHelper.GetPublicNotAbstractClasses<ToolStripDropDownItem>().Select(type => type); 13foreach (Type itemType in types) 24public void ToolStripDropDownMenuAccessible_FragmentNavigate_ReturnExpected_WithoutItem(Type itemType, bool createControl) 79IEnumerable<Type> types = ReflectionHelper.GetPublicNotAbstractClasses<ToolStripDropDownItem>().Select(type => type); 81foreach (Type ownerType in types) 83foreach (Type parentType in types) 85foreach (Type childType in types) 99public void ToolStripDropDownMenuAccessible_FragmentNavigate_ReturnExpected(Type ownerType, Type parentType, Type childType, bool createControl) 171IEnumerable<Type> types = ReflectionHelper.GetPublicNotAbstractClasses<ToolStripDropDownItem>().Select(type => type); 173foreach (Type parentType in types) 175foreach (Type childType in types) 188public void ToolStripDropDownMenuAccessible_FragmentNavigate_ReturnExpected_ToolStripOverflowButton(Type parentType, Type childType)
System\Windows\Forms\AccessibleObjects\ToolStripItemAccessibleObjectTests.cs (5)
49public void ToolStripItemAccessibleObject_LegacyIAccessible_Custom_Role_ReturnsExpected(Type type) 65public void ToolStripItemAccessibleObject_IsPatternSupported_LegacyIAccessible_ReturnsTrue(Type type) 77public void ToolStripItemAccessibleObject_LegacyIAccessible_Custom_Description_ReturnsExpected(Type type) 90public void ToolStripItemAccessibleObject_GetPropertyValue_Custom_Name_ReturnsExpected(Type type) 112public void ToolStripHostedControlAccessibleObject_GetPropertyValue_IsOffscreenPropertyId_ReturnExpected(Type type)
System\Windows\Forms\AccessibleObjects\ToolStripScrollButton.ToolStripScrollButtonAccessibleObjectTests.cs (4)
12IEnumerable<Type> types = ReflectionHelper.GetPublicNotAbstractClasses<ToolStripDropDownItem>().Select(type => type); 13foreach (Type itemType in types) 24public void ToolStripScrollButtonAccessibleObject_FragmentNavigate_ReturnsExpected(Type itemType, bool createControl) 86public void ToolStripScrollButtonAccessibleObject_FragmentNavigate_ReturnsNull_If_ScrollButtonsHidden(Type itemType, bool createControl)
System\Windows\Forms\AccessibleObjects\ToolStripTextBox.ToolStripTextBoxControlAccessibleObjectTests.cs (2)
17Type type = toolStripTextBox.GetType().GetNestedType("ToolStripTextBoxControlAccessibleObject", BindingFlags.NonPublic); 28Type type = toolStripTextBox.GetType().GetNestedType("ToolStripTextBoxControlAccessibleObject", BindingFlags.NonPublic);
System\Windows\Forms\ApplicationContextTests.cs (1)
388foreach (var type in typeof(ApplicationContext).Assembly.GetTypes().
System\Windows\Forms\AxHost.ConnectionPointCookieTests.cs (14)
17Type type = Type.GetTypeFromCLSID(CLSID_WebBrowser); 20Type eventType = typeof(IPropertyNotifySink.Interface); 44Type type = Type.GetTypeFromCLSID(CLSID_WebBrowser); 54public void ConnectionPointCookie_Ctor_NullSink_ThrowsInvalidCastException(Type eventInterface) 56Type type = Type.GetTypeFromCLSID(CLSID_WebBrowser); 71Type type = Type.GetTypeFromCLSID(CLSID_WebBrowser); 73Type eventInterface = typeof(IPropertyNotifySink.Interface); 80Type type = Type.GetTypeFromCLSID(CLSID_WebBrowser); 83Type eventType = typeof(IPropertyNotifySink.Interface);
System\Windows\Forms\AxHostTests.cs (2)
2583public void AxHost_ICustomTypeDescriptorGetEditor_typeInvoke_ReturnsExpected(Type editorBaseType) 2600public void AxHost_ICustomTypeDescriptorGetEditor_typeInvokeWithHandle_ReturnsExpected(Type editorBaseType)
System\Windows\Forms\AxSystemMonitorTests.cs (1)
35Type assemblyType = typeof(AxSystemMonitor.AxSystemMonitor);
System\Windows\Forms\AxWebBrowserTests.cs (1)
35Type assemblyType = typeof(AxWebBrowser);
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (2)
98public override Type? BindToType(string assemblyName, string typeName) 245Type propertyType = property.PropertyType;
System\Windows\Forms\BinaryFormatUtilitiesTests.cs (16)
37private object? ReadObjectFromStream<T>(bool restrictDeserialization, Func<TypeName, Type>? resolver) 45private object? ReadObjectFromStream<T>(Func<TypeName, Type>? resolver) 51private object? ReadRestrictedObjectFromStream<T>(Func<TypeName, Type>? resolver) 88private object? RoundTripOfType<T>(object value, Func<TypeName, Type>? resolver) 436static Type ObjectListResolver(TypeName typeName) 438(string name, Type type)[] allowedTypes = 543private static Type NullableIntArrayResolver(TypeName typeName) 545(string name, Type type)[] allowedTypes = 574static Type TestDataResolver(TypeName typeName) 576(string name, Type type)[] allowedTypes = 611static Type InvalidResolver(TypeName typeName) => null!; 614private static Type FontResolver(TypeName typeName) 616(string? name, Type type)[] allowedTypes = 840private static Type NotSupportedResolver(TypeName typeName) => 996internal static Type MyExactMatchResolver(TypeName typeName) 999(Type type, TypeName typeName)[] allowedTypes =
System\Windows\Forms\BindingSourceTests.cs (3)
72public void Ctor_Object_String_Null(object dataSource, string dataMember, Type expectedType) 293public void Ctor_Object_String_BindingList(object dataSource, string dataMember, bool expectedAllowEdit, bool expectedAllowNew, bool expectedAllowRemove, bool expectedIsFixedSize, bool expectedReadOnly, bool expectedIsSynchronized, IList expected, Type expectedType) 463public void Ctor_InvalidDataSourceType_ThrowsNotSupportedException(Type dataSource)
System\Windows\Forms\ClipboardTests.cs (7)
630object IDataObject.GetData(Type format) => null!; 635bool IDataObject.GetDataPresent(Type format) => false; 641void IDataObject.SetData(Type format, object? data) => throw new NotImplementedException(); 772public static Type TestDataResolver(TypeName typeName) 1138public object GetData(Type format) => throw new NotImplementedException(); 1141public bool GetDataPresent(Type format) => throw new NotImplementedException(); 1151public void SetData(Type format, object? data) => throw new NotImplementedException();
System\Windows\Forms\ColumnHeaderConverterTests.cs (12)
12public static TheoryData<Type, bool> CanConvertFromData => 18public void ColumnHeaderConverter_CanConvertFrom_Invoke_ReturnsExpected(Type sourceType, bool expected) 40public void ColumnHeaderConverter_CanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 51Array.Empty<Type>(), 57new Type[] { typeof(string) }, 63new Type[] { typeof(int) }, 69Array.Empty<Type>(), 75Array.Empty<Type>(), 81new Type[] { typeof(string) }, 87new Type[] { typeof(int) }, 94public void ColumnHeaderConverter_ConvertTo_InstanceDescriptor_ReturnsExpected(ColumnHeader value, Type[] parameterTypes, object[] arguments) 136public void ColumnHeaderConverter_ConvertTo_InvalidDestinationType_ThrowsNotSupportedException(Type destinationType)
System\Windows\Forms\ComboBox.ComboBoxChildNativeWindowTests.cs (1)
15Type childWindowTypeEnum = typeof(ComboBox).GetNestedType("ChildWindowType", Reflection.BindingFlags.NonPublic);
System\Windows\Forms\ComponentModel\Com2Interop\COM2FontConverterTests.cs (1)
126public object? GetEditor(Type editorBaseType) => throw new NotImplementedException();
System\Windows\Forms\ComponentModel\Com2Interop\Com2PropertyDescriptorTests.cs (1)
11private static readonly Type s_typeCom2PropertyDescriptor = typeof(Com2PropertyDescriptor);
System\Windows\Forms\ConvertEventArgsTests.cs (1)
12public void Ctor_Object_Type(object value, Type desiredType)
System\Windows\Forms\CursorConverterTests.cs (3)
18public void CursorConverter_CanConvertFrom_Invoke_ReturnsExpected(Type sourceType, bool expected) 68public void CursorConverter_CanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 175public void CursorConverter_ConvertTo_ValueNotCursor_ThrowsNotSupportedException(Type destinationType)
System\Windows\Forms\CursorTests.cs (2)
165Assert.Throws<ArgumentNullException>("type", () => new Cursor((Type)null, "resource")); 172public void Cursor_Ctor_NoSuchResource_ThrowsArgumentNullException(Type type, string resource)
System\Windows\Forms\DataGridViewCellConverterTests.cs (4)
18public void CanConvertTo_ReturnsExpected(Type destinationType, bool expected) => 25Type destinationType = typeof(InstanceDescriptor); 35Type destinationType = typeof(InstanceDescriptor); 46Type destinationType = typeof(string);
System\Windows\Forms\DataGridViewCellFormattingEventArgsTests.cs (1)
18public void Ctor_Int_Int_Object_Type_DataGridViewCellStyle(int columnIndex, int rowIndex, object value, Type desiredType, DataGridViewCellStyle cellStyle)
System\Windows\Forms\DataGridViewCellParsingEventArgsTests.cs (1)
19public void Ctor_Int_Int_Object_Type_DataGridViewCellStyle(int rowIndex, int columnIndex, object value, Type desiredType, DataGridViewCellStyle inheritedCellStyle)
System\Windows\Forms\DataGridViewCellTests.cs (18)
2780public void DataGridViewCell_ValueType_GetWithColumn_ReturnsExpected(Type valueType) 2793public void DataGridViewCell_ValueType_GetWithDataGridView_ReturnsExpected(Type valueType) 2810public void DataGridViewCell_ValueType_Set_GetReturnsExpected(Type value) 2827public void DataGridViewCell_ValueType_SetWithNonNullOldValue_GetReturnsExpected(Type value) 2845public void DataGridViewCell_ValueType_SetWithRow_GetReturnsExpected(Type value) 2863public void DataGridViewCell_ValueType_SetWithRowWithNonNullOldValue_GetReturnsExpected(Type value) 2891public void DataGridViewCell_ValueType_SetWithColumn_GetReturnsExpected(Type value, Type expected) 2909public void DataGridViewCell_ValueType_SetWithColumnWithNonNullOldValue_GetReturnsExpected(Type value, Type expected) 2930public void DataGridViewCell_ValueType_SetWithDataGridView_GetReturnsExpected(Type value) 2955public void DataGridViewCell_ValueType_SetWithDataGridViewWithNonNullOldValue_GetReturnsExpected(Type value) 6145public void DataGridViewCell_ParseFormattedValue_Invoke_ReturnsExpected(Type valueType, Type formattedValueType, object formattedValue, DataGridViewCellStyle cellStyle, TypeConverter formattedValueTypeConverter, TypeConverter valueTypeConverter, object expected) 6195public void DataGridViewCell_ParseFormattedValue_CantConvert_ThrowsFormatException(Type valueType, Type formattedValueType, object formattedValue, DataGridViewCellStyle cellStyle, TypeConverter formattedValueTypeConverter, TypeConverter valueTypeConverter) 6220public Type FormattedValueTypeResult { get; set; } 6222public override Type FormattedValueType => FormattedValueTypeResult;
System\Windows\Forms\DataGridViewColumnTests.cs (8)
921public void DataGridViewColumn_DefaultHeaderCellType_Set_GetReturnsExpected(Type value, Type expected) 938public void DataGridViewColumn_DefaultHeaderCellType_SetWithNonNullOldValue_GetReturnsExpected(Type value) 954public void DataGridViewColumn_DefaultHeaderCellType_SetWithDataGridView_GetReturnsExpected(Type value, Type expected) 976public void DataGridViewColumn_DefaultHeaderCellType_SetWithDataGridViewNonNullOldValue_GetReturnsExpected(Type value) 997public void DataGridViewColumn_DefaultHeaderCellType_SetInvalidWithNullOldValue_GetReturnsExpected(Type value) 1005public void DataGridViewColumn_DefaultHeaderCellType_SetInvalidWithNonNullOldValue_GetReturnsExpected(Type value)
System\Windows\Forms\DataGridViewElementTests.cs (2)
35foreach (var type in typeof(DataGridViewElement).Assembly.GetTypes().Where(type => 364public void DataGridViewElement_Subclasses_SuppressFinalizeCall(Type type)
System\Windows\Forms\DataGridViewHeaderCellTests.cs (36)
1356public void DataGridViewHeaderCell_ValueType_GetColumnHeaderCellHeaderCell_ReturnsExpected(Type valueType) 1369public void DataGridViewHeaderCell_ValueType_GetWithDataGridView_ReturnsExpected(Type valueType) 1386public void DataGridViewHeaderCell_ValueType_GetRowHeaderCellWithDataGridView_ReturnsExpected(Type valueType) 1405public void DataGridViewHeaderCell_ValueType_GetColumnHeaderCellWithDataGridView_ReturnsExpected(Type valueType) 1437public void DataGridViewHeaderCell_ValueType_Set_GetReturnsExpected(Type value, Type expected) 1456public void DataGridViewHeaderCell_ValueType_SetWithNonNullOldValue_GetReturnsExpected(Type value, Type expected) 1476public void DataGridViewHeaderCell_ValueType_SetWithRow_GetReturnsExpected(Type value, Type expected) 1496public void DataGridViewHeaderCell_ValueType_SetWithRowWithNonNullOldValue_GetReturnsExpected(Type value, Type expected) 1524public void DataGridViewHeaderCell_ValueType_SetWithRowHeaderCell_GetReturnsExpected(Type value, Type expected) 1542public void DataGridViewHeaderCell_ValueType_SetWithRowHeaderCellWithNonNullOldValue_GetReturnsExpected(Type value, Type expected) 1563public void DataGridViewHeaderCell_ValueType_SetColumnHeaderCellHeaderCell_GetReturnsExpected(Type value, Type expected) 1581public void DataGridViewHeaderCell_ValueType_SetColumnHeaderCellWithNonNullOldValue_GetReturnsExpected(Type value, Type expected) 1604public void DataGridViewHeaderCell_ValueType_SetWithDataGridView_GetReturnsExpected(Type value, Type expected) 1631public void DataGridViewHeaderCell_ValueType_SetWithDataGridViewWithNonNullOldValue_GetReturnsExpected(Type value, Type expected) 1659public void DataGridViewHeaderCell_ValueType_SetRowHeaderCellWithDataGridView_GetReturnsExpected(Type value, Type expected) 1688public void DataGridViewHeaderCell_ValueType_SetRowHeaderCellWithDataGridViewWithNonNullOldValue_GetReturnsExpected(Type value, Type expected) 1718public void DataGridViewHeaderCell_ValueType_SetColumnHeaderCellWithDataGridView_GetReturnsExpected(Type value, Type expected) 1746public void DataGridViewHeaderCell_ValueType_SetColumnHeaderCellWithDataGridViewWithNonNullOldValue_GetReturnsExpected(Type value, Type expected) 1775public void DataGridViewHeaderCell_ValueType_SetTopLeftHeaderCell_GetReturnsExpected(Type value, Type expected) 1800public void DataGridViewHeaderCell_ValueType_SetTopLeftHeaderCellWithNonNullOldValue_GetReturnsExpected(Type value, Type expected)
System\Windows\Forms\DataGridViewRowTests.cs (11)
604public void DataGridViewRow_DefaultHeaderCellType_Set_GetReturnsExpected(Type value, Type expected) 621public void DataGridViewRow_DefaultHeaderCellType_SetWithNonNullOldValue_GetReturnsExpected(Type value) 637public void DataGridViewRow_DefaultHeaderCellType_SetWithDataGridView_GetReturnsExpected(Type value, Type expected) 658public void DataGridViewRow_DefaultHeaderCellType_SetWithDataGridViewNonNullOldValue_GetReturnsExpected(Type value) 678public void DataGridViewRow_DefaultHeaderCellType_SetShared_GetReturnsExpected(Type value, Type expected) 699public void DataGridViewRow_DefaultHeaderCellType_SetSharedNonNullOldValue_GetReturnsExpected(Type value) 719public void DataGridViewRow_DefaultHeaderCellType_SetInvalidWithNullOldValue_GetReturnsExpected(Type value) 727public void DataGridViewRow_DefaultHeaderCellType_SetInvalidWithNonNullOldValue_GetReturnsExpected(Type value)
System\Windows\Forms\DataGridViewTests.cs (1)
3530Type type = typeof(DataGridView);
System\Windows\Forms\DataObjectComTests.cs (3)
55public object GetData(Type format) => throw new NotImplementedException(); 58public bool GetDataPresent(Type format) => throw new NotImplementedException(); 63public void SetData(Type format, object data) => throw new NotImplementedException();
System\Windows\Forms\DataObjectExtensionsTests.cs (8)
32private static Type Resolver(TypeName typeName) => typeof(string); 164public object? GetData(Type format) 172public bool GetDataPresent(Type format) => throw new NotImplementedException(); 177public void SetData(Type format, object? data) => throw new NotImplementedException(); 185public object? GetData(Type format) => throw new NotImplementedException(); 188public bool GetDataPresent(Type format) => throw new NotImplementedException(); 193public void SetData(Type format, object? data) => throw new NotImplementedException(); 254public bool TryGetData<T>(string format, Func<TypeName, Type> resolver, bool autoConvert, [MaybeNullWhen(false), NotNullWhen(true)] out T data)
System\Windows\Forms\DataObjectTests.cs (25)
339public void DataObject_GetData_InvokeTypeDefault_ReturnsNull(Type format) 345public static TheoryData<Type, object, int, object> GetData_InvokeTypeMocked_TheoryData() 347TheoryData<Type, object, int, object> theoryData = new(); 359public void DataObject_GetData_InvokeTypeMocked_CallsGetData(Type format, object result, int expectedCallCount, object expectedResult) 363.Setup(o => o.GetData(It.IsAny<Type>())) 378private readonly Func<TypeName, Type>? _resolver; 382public DataObjectOverridesTryGetDataCore(string format, Func<TypeName, Type>? resolver, bool autoConvert) : base() 390public static Type Resolver(TypeName _) => typeof(string); 394Func<TypeName, Type>? resolver, 471private static Type NotSupportedResolver(TypeName typeName) => throw new NotSupportedException(); 599public void DataObject_GetDataPresentPresent_InvokeTypeDefault_ReturnsFalse(Type format) 605public static TheoryData<Type, bool, int, bool, string> GetDataPresent_InvokeTypeMocked_TheoryData() 607TheoryData<Type, bool, int, bool, string> theoryData = []; 619public void DataObject_GetDataPresent_InvokeTypeMocked_CallsGetDataPresent(Type format, bool result, int expectedCallCount, bool expectedResult, string expectedFormatName) 623.Setup(o => o.GetDataPresent(It.IsAny<Type>())) 1457public static TheoryData<Type, object> SetData_TypeObjectIDataObject_TheoryData() 1459TheoryData<Type, object> theoryData = []; 1460foreach (Type format in new Type[] { typeof(int), null }) 1471public void DataObject_SetData_InvokeTypeObjectIDataObject_CallsSetData(Type format, object data) 1492((Action)(() => dataObject.SetData((Type)null, new object()))).Should() 2679public object GetData(Type format) => throw new NotImplementedException(); 2683public bool GetDataPresent(Type format) => throw new NotImplementedException(); 2690public void SetData(Type format, object data) => throw new NotImplementedException(); 2927public override WeatherForecast Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Windows\Forms\Design\ComponentEditorFormTests.cs (10)
17using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 172using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 193using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 209using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 237using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 248using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 286using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 314using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 341using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 366public SubComponentEditorForm(object component, Type[] pageTypes) : base(component, pageTypes)
System\Windows\Forms\Design\DesignerAttributeTests.cs (21)
40public static IEnumerable<object[]> GetAttributeOfType_TestData(string assembly, Type attributeType) 42foreach (var type in Assembly.Load(assembly).GetTypes()) 47public static IEnumerable<object[]> GetAttributeOfTypeAndProperty_TestData(string assembly, Type attributeType) 49foreach (var type in Assembly.Load(assembly).GetTypes()) 60public static IEnumerable<object[]> GetAttributeWithType_TestData(string assembly, Type attributeType) 62foreach (var type in Assembly.Load(assembly).GetTypes()) 67public static IEnumerable<object[]> GetAttributeWithProperty_TestData(string assembly, Type attributeType) 69foreach (var type in Assembly.Load(assembly).GetTypes()) 77public void DesignerAttributes_DesignerAttribute_TypeExists(Type annotatedType, DesignerAttribute attribute) 79var type = Type.GetType(attribute.DesignerTypeName, false); 95public void DesignerAttributes_DesignerSerializerAttribute_TypeExists(Type annotatedType, DesignerSerializerAttribute attribute) 97var type = Type.GetType(attribute.SerializerTypeName, false); 111public void DesignerAttributes_DefaultPropertyAttribute_PropertyExists(Type type, DefaultPropertyAttribute attribute) 121public void DesignerAttributes_DefaultBindingPropertyAttribute_PropertyExists(Type type, DefaultBindingPropertyAttribute attribute) 131public void DesignerAttributes_DefaultEventAttribute_EventExists(Type type, DefaultEventAttribute attribute) 144var type = Type.GetType(attribute.ConverterTypeName, false); 161var type = Type.GetType(attribute.EditorTypeName, false);
System\Windows\Forms\Design\WindowsFormsComponentEditorTests.cs (12)
15yield return new object[] { Array.Empty<Type>(), null, null }; 19yield return new object[] { Array.Empty<Type>(), new(), mockWindow.Object }; 24public void WindowsFormsComponentEditor_EditComponent_InvokeObjectIWin32Window_ReturnsFalse(Type[] pages, object component, IWin32Window owner) 36yield return new object[] { Array.Empty<Type>(), null, null }; 40yield return new object[] { Array.Empty<Type>(), mockContext.Object, new() }; 45public void WindowsFormsComponentEditor_EditComponent_InvokeITypeDescriptorContextObject_ReturnsFalse(Type[] pages, ITypeDescriptorContext context, object component) 57yield return new object[] { Array.Empty<Type>(), null, null, null }; 62yield return new object[] { Array.Empty<Type>(), mockContext.Object, new(), mockWindow.Object }; 67public void WindowsFormsComponentEditor_EditComponent_InvokeITypeDescriptorContextObjectIWin32Window_ReturnsFalse(Type[] pages, ITypeDescriptorContext context, object component, IWin32Window owner) 106public new Type[] GetComponentEditorPages() => base.GetComponentEditorPages(); 113public Type[] GetComponentEditorPagesResult { get; set; } 115protected override Type[] GetComponentEditorPages() => GetComponentEditorPagesResult;
System\Windows\Forms\DragEventArgsTests.cs (3)
103public object GetData(Type format) => throw new NotImplementedException(); 106public void SetData(Type format, object data) => throw new NotImplementedException(); 110public bool GetDataPresent(Type format) => throw new NotImplementedException();
System\Windows\Forms\FeatureSupportTests.cs (2)
91public void FeatureSupport_GetVersionPresent_NonStaticField_ThrowsTargetException(Type featureClassType, string featureConstName) 154public void FeatureSupport_IsPresent_NonStaticField_ThrowsTargetException(Type featureClassType, string featureConstName)
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (6)
1754public void TableLayoutSettings_ISerializableGetObjectData_InvokeInvalidStringConverter_Success(Type type) 1809public void TableLayoutSettings_Serialize_InvalidStringConverter_DeserializeThrowsSerializationException(Type type) 1831public void TableLayoutSettings_Deserialize_InvalidConverterResult_Success(Type type) 1859public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 1867public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 1895public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
System\Windows\Forms\Layout\TableLayoutSettingsTypeConverterTests.cs (5)
14public static TheoryData<Type, bool> CanConvertFromData => 21public void TableLayoutSettingsTypeConverter_CanConvertFrom_Invoke_ReturnsExpected(Type sourceType, bool expected) 153public void TableLayoutSettingsTypeConverter_CanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 295public void TableLayoutSettingsTypeConverter_ConvertTo_InvalidDestinationType_ThrowsNotSupportedException(Type destinationType) 313public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
System\Windows\Forms\LinkAreaConverterTests.cs (3)
18public void LinkAreaConverter_CanConvertFrom_Invoke_ReturnsExpected(Type sourceType, bool expected) 66public void LinkAreaConverter_CanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 107public void LinkAreaConverter_ConvertTo_InvalidDestinationType_ThrowsNotSupportedException(Type destinationType)
System\Windows\Forms\LinkConverterTests.cs (3)
16public void LinkConverter_CanConvertFrom_Invoke_ReturnsExpected(Type sourceType, bool expected) 64public void LinkConverter_CanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 116public void LinkConverter_ConvertTo_InvalidDestinationType_ThrowsNotSupportedException(Type destinationType)
System\Windows\Forms\ListBindingHelperTests.cs (19)
175public void ListBindingHelper_GetListItemType_InvokeObject_ReturnsExpected(object list, Type expected) 216public void ListBindingHelper_GetListItemType_InvokeObjectString_ReturnsExpected(object list, string dataMember, Type expected) 225public void ListBindingHelper_GetListItemType_InvalidIListSourceType_ThrowsNotSupportedException(Type list) 744public override Type PropertyType => new CustomTypeDescriptorType(); 746public override Type ComponentType => throw new NotImplementedException(); 781public override Type BaseType => throw new NotImplementedException(); 783public override Type UnderlyingSystemType => throw new NotImplementedException(); 817public override object[] GetCustomAttributes(Type attributeType, bool inherit) 832public object GetEditor(Type editorBaseType) 837public override Type GetElementType() => throw new NotImplementedException(); 864public override Type GetInterface(string name, bool ignoreCase) 869public override Type[] GetInterfaces() => throw new NotImplementedException(); 881public override Type GetNestedType(string name, BindingFlags bindingAttr) 886public override Type[] GetNestedTypes(BindingFlags bindingAttr) 911public override bool IsDefined(Type attributeType, bool inherit) => throw new NotImplementedException(); 915protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) 920protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) 925protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
System\Windows\Forms\ListControlConvertEventArgsTests.cs (1)
12public void Ctor_Object_Type(object value, Type desiredType, object listItem)
System\Windows\Forms\ListControlTests.cs (3)
3042public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 3060public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 3074public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Forms\ListViewGroupConverterTests.cs (9)
13public static TheoryData<Type, bool> CanConvertFromData => 20public void ListViewGroupConverter_CanConvertFrom_Invoke_ReturnsExpected(Type sourceType, bool expected) 133public void ListViewGroupConverter_CanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 175new Type[] { typeof(string), typeof(HorizontalAlignment) }, 181new Type[] { typeof(string), typeof(HorizontalAlignment) }, 187new Type[] { typeof(string), typeof(HorizontalAlignment) }, 193new Type[] { typeof(string), typeof(HorizontalAlignment) }, 200public void ListViewGroupConverter_ConvertTo_InstanceDescriptor_ReturnsExpected(ListViewGroup value, Type[] parameterTypes, object[] arguments) 234public void ListViewGroupConverter_ConvertTo_InvalidDestinationType_ThrowsNotSupportedException(Type destinationType)
System\Windows\Forms\ListViewItemConverterTests.cs (35)
13public static TheoryData<Type, bool> CanConvertFromData => 20public void ListViewItemConverter_CanConvertFrom_Invoke_ReturnsExpected(Type sourceType, bool expected) 42public void ListViewItemConverter_ConverterCanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 70new Type[] { typeof(string) }, 76new Type[] { typeof(string) }, 82new Type[] { typeof(string) }, 88new Type[] { typeof(string) }, 94new Type[] { typeof(string), typeof(string) }, 100new Type[] { typeof(string), typeof(int) }, 106new Type[] { typeof(string), typeof(string) }, 112new Type[] { typeof(string), typeof(int) }, 120new Type[] { typeof(string), typeof(string) }, 126new Type[] { typeof(string), typeof(int) }, 132new Type[] { typeof(string), typeof(string) }, 138new Type[] { typeof(string), typeof(int) }, 144new Type[] { typeof(string[]), typeof(string) }, 150new Type[] { typeof(string[]), typeof(int) }, 156new Type[] { typeof(string[]), typeof(string) }, 162new Type[] { typeof(string[]), typeof(int) }, 168new Type[] { typeof(ListViewItem.ListViewSubItem[]), typeof(string) }, 174new Type[] { typeof(ListViewItem.ListViewSubItem[]), typeof(int) }, 180new Type[] { typeof(ListViewItem.ListViewSubItem[]), typeof(string) }, 186new Type[] { typeof(ListViewItem.ListViewSubItem[]), typeof(int) }, 192new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 198new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 204new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 210new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 216new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 222new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 230new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 236new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 242new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 248new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 255public void ListViewItemConverter_ConvertTo_InstanceDescriptor_ReturnsExpected(ListViewItem value, Type[] parameterTypes, object[] arguments) 289public void ListViewItemConverter_ConvertTo_InvalidDestinationType_ThrowsNotSupportedException(Type destinationType)
System\Windows\Forms\ListViewSubItemConverterTests.cs (7)
13public static TheoryData<Type, bool> CanConvertFromData => 20public void ListViewSubItemConverter_CanConvertFrom_Invoke_ReturnsExpected(Type sourceType, bool expected) 42public void ListViewSubItemConverter_CanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 54new Type[] { typeof(ListViewItem), typeof(string) }, 61new Type[] { typeof(ListViewItem), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 68public void ListViewSubItemConverter_ConvertTo_InstanceDescriptor_ReturnsExpected(ListViewItem.ListViewSubItem value, Type[] parameterTypes, object[] arguments) 102public void ListViewSubItemConverter_ConvertTo_InvalidDestinationType_ThrowsNotSupportedException(Type destinationType)
System\Windows\Forms\MonthCalendar.SelectionRangeConverterTests.cs (4)
32public void CanConvertFrom_ReturnsExpected(Type type, bool expected) 41public void CanConvertTo_ReturnsExpected(Type type, bool expected) 82public static readonly TheoryData<string, Type, object> s_convertToData = new() 90public void ConvertTo_ReturnsExpected(string dateValue, Type targetType, object expected)
System\Windows\Forms\NativeToWinFormsAdapterTests.cs (5)
58static Type Resolver(TypeName typeName) => typeof(int); 480public static Type Resolver(TypeName typeName) 482(string name, Type type)[] allowedTypes = 538public static Type Resolver(TypeName typeName) 540(string name, Type type)[] allowedTypes =
System\Windows\Forms\OpacityConverterTests.cs (4)
11public static TheoryData<Type, bool> CanConvertFromData => 17public void OpacityConverter_CanConvertFrom_Invoke_ReturnsExpected(Type sourceType, bool expected) 76public void OpacityConverter_CanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 110public void OpacityConverter_ConvertTo_InvalidDestinationType_ThrowsNotSupportedException(Type destinationType)
System\Windows\Forms\PaddingConverterTests.cs (3)
19public void PaddingConverter_CanConvertFrom_Invoke_ReturnsExpected(Type sourceType, bool expected) 68public void PaddingConverter_CanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 119public void PaddingConverter_ConvertTo_InvalidDestinationType_ThrowsNotSupportedException(Type destinationType)
System\Windows\Forms\PropertyGrid.PropertyTabCollectionTests.cs (5)
14public void Count_ReturnsCorrectCount(Type ownerType) 24public void Indexer_ReturnsCorrectTab(Type ownerType, int index, Type expectedTabType) 37public void AddTabType_WithDifferentInputs(Type ownerType, Type tabType, int expectedCount, bool addTwice)
System\Windows\Forms\PropertyGridInternal\AccessibleObjects\PropertyDescriptorGridEntry.PropertyDescriptorGridEntryAccessibleObjectTests.cs (2)
144public override Type PropertyType => throw new NotImplementedException(); 146public override Type ComponentType => throw new NotImplementedException();
System\Windows\Forms\PropertyGridInternal\AccessibleObjects\PropertyGridView.GridViewListBoxAccessibleObjectTests.cs (1)
19Type type = gridViewListBox.AccessibilityObject.GetType();
System\Windows\Forms\PropertyGridInternal\AccessibleObjects\PropertyGridView.GridViewTextBox.GridViewTextBoxAccessibleObjectTests.cs (4)
95Type gridViewTextBoxType = typeof(PropertyGridView).GetNestedType("GridViewTextBox", BindingFlags.NonPublic); 98Type accessibleObjectType = gridViewTextBoxType.GetNestedType("GridViewTextBoxAccessibleObject", BindingFlags.NonPublic); 109Type gridViewTextBoxType = typeof(PropertyGridView).GetNestedType("GridViewTextBox", BindingFlags.NonPublic); 112Type accessibleObjectType = gridViewTextBoxType.GetNestedType("GridViewTextBoxAccessibleObject", BindingFlags.NonPublic);
System\Windows\Forms\PropertyGridInternal\PropertyGridView.GridViewListBoxTests.cs (1)
28Type gridViewListBoxAccessibleObjectType = gridViewListBoxAccessibleObject.GetType();
System\Windows\Forms\PropertyGridTests.cs (3)
3938Type propertyType = gridEntry.PropertyType; 4163public new Type DefaultTabType => base.DefaultTabType; 4275public object GetService(Type serviceType)
System\Windows\Forms\SpecialFolderEnumConverterTests.cs (2)
90TypeConverter converter = (TypeConverter)Activator.CreateInstance(descriptor.Converter.GetType(), new Type[] { typeof(CustomEnum) }); 97return (TypeConverter)Activator.CreateInstance(descriptor.Converter.GetType(), new Type[] { typeof(Environment.SpecialFolder) });
System\Windows\Forms\StatusStripTests.cs (2)
469public void StatusStrip_RenderMode_Set_ReturnsExpected(ToolStripRenderMode value, Type expectedRendererType, int expectedSameRendererChangedCallCount) 512public void StatusStrip_RenderMode_SetWithCustomRenderer_ReturnsExpected(ToolStripRenderMode value, Type expectedRendererType, int expectedSameRendererChangedCallCount)
System\Windows\Forms\TabControlTests.cs (4)
3854public void TabControl_GetItems_InvokeTypeWithoutPages_ReturnsExpected(Type baseType) 3867public void TabControl_GetItems_InvokeTypeBaseTypeWithPages_ReturnsExpected(Type baseType) 3900public void TabControl_GetItems_InvokeInvalidTypeWithoutPages_ThrowsInvalidCastException(Type baseType) 5783public new object[] GetItems(Type baseType) => base.GetItems(baseType);
System\Windows\Forms\TableLayoutPanelCellPositionTests.cs (4)
97public static TheoryData<Type, bool> CanConvertFromData => 104public void TableLayoutPanelCellPosition_ConverterCanConvertFrom_Invoke_ReturnsExpected(Type sourceType, bool expected) 165public void TableLayoutPanelCellPosition_ConverterCanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 198public void TableLayoutPanelCellPosition_ConverterConvertTo_InvalidDestinationType_ThrowsNotSupportedException(Type destinationType)
System\Windows\Forms\TableLayoutPanelTests.cs (1)
2149public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
System\Windows\Forms\TableLayoutStyleTests.cs (4)
118public void TableLayoutStyle_ConverterCanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 126yield return new object[] { new RowStyle(SizeType.AutoSize, 1), typeof(RowStyle).GetConstructor(Array.Empty<Type>()), Array.Empty<object>() }; 129yield return new object[] { new ColumnStyle(SizeType.AutoSize, 1), typeof(ColumnStyle).GetConstructor(Array.Empty<Type>()), Array.Empty<object>() }; 169public void TableLayoutStyle_ConverterConvertTo_InvalidDestinationType_ThrowsNotSupportedException(Type destinationType)
System\Windows\Forms\ToolStrip.ToolStripAccessibleObjectWrapperForItemsOnOverflowTests.cs (1)
17Type type = typeof(ToolStrip)
System\Windows\Forms\ToolStripContentPanelTests.cs (3)
1287public void ToolStripContentPanel_RenderMode_Set_ReturnsExpected(ToolStripRenderMode value, Type expectedRendererType, int expectedSetSameCallCount) 1325public void ToolStripContentPanel_RenderMode_SetWithCustomRenderer_ReturnsExpected(ToolStripRenderMode value, Type expectedRendererType) 1366public void ToolStripContentPanel_RenderMode_SetWithHandle_ReturnsExpected(ToolStripRenderMode value, Type expectedRendererType, int expectedSetSameCallCount)
System\Windows\Forms\ToolStripCustomIComparerTests.cs (2)
16public void ToolStripCustomIComparer_Compare_Tests(Type type1, Type type2, int expected)
System\Windows\Forms\ToolStripItemTests.cs (3)
10242public object GetData(Type format) => throw new NotImplementedException(); 10245public bool GetDataPresent(Type format) => throw new NotImplementedException(); 10250public void SetData(Type format, object data) => throw new NotImplementedException();
System\Windows\Forms\ToolStripTests.cs (2)
3295public void ToolStrip_RenderMode_Set_ReturnsExpected(ToolStripRenderMode value, Type expectedRendererType) 3338public void ToolStrip_RenderMode_SetWithCustomRenderer_ReturnsExpected(ToolStripRenderMode value, Type expectedRendererType)
System\Windows\Forms\TreeNodeConverterTests.cs (2)
15public void TreeNodeConverter_CanConvertTo_Invoke_ReturnsExpected(Type destinationType, bool expected) 25public void TreeNodeConverter_ConvertTo_Invoke_ReturnsExpected(Type destinationType, bool canConvert)
System\Windows\Forms\TypeExtensionsTests.cs (2)
15public static TheoryData<Type, TypeName, bool> MatchesNameAndAssemblyLessVersionData() => new() 51public void MatchesLessAssemblyVersion(Type type, TypeName typeName, bool matches) =>
System\Windows\Forms\TypeNameComparerTests.cs (8)
14public static TheoryData<TypeName, Type> TypeNameComparerSuccess() => new() 28public void DictionaryLookupSucceeds(TypeName name, Type expected) 30Dictionary<TypeName, Type> types = new(DataObject.Composition.TypeNameComparer.Default) 38types.TryGetValue(name, out Type? resolvedType).Should().BeTrue(); 55Dictionary<TypeName, Type> types = new(DataObject.Composition.TypeNameComparer.Default) 63types.TryGetValue(name, out Type? _).Should().BeFalse(); 69Dictionary<TypeName, Type> types = new(DataObject.Composition.TypeNameComparer.Default) 81types.TryGetValue(name, out Type? _).Should().BeFalse();
System\Windows\Forms\TypeValidationEventArgsTests.cs (1)
13public void Ctor_Type_Object_Object_String(Type validatingType, bool isValidInput, object returnValue, string message)
System\Windows\Forms\WebBrowserTests.cs (4)
2307Type t = Type.GetTypeFromCLSID(new Guid("0002DF01-0000-0000-C000-000000000046")); 2341Type t = Type.GetTypeFromCLSID(new Guid("0002DF01-0000-0000-C000-000000000046"));
ToolStripContainerTests.cs (1)
196public void ToolStripContainer_ForeColor_GetSetAndEventFired_Success(Type colorType, string colorName)
System.Windows.Forms.TestUtilities (2)
CommonTestHelperEx.cs (2)
54public static TheoryData<Type> GetTypeWithNullTheoryData() 56TheoryData<Type> data = new()
System.Windows.Forms.UI.IntegrationTests (1)
Infra\ControlTestBase.cs (1)
49var type = testOutputHelper.GetType();
System.Xaml (380)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (25)
82internal static Type GetQualifiedType(string typeName) 91return Type.GetType(nameFrags[0]); 121internal static bool IsNullableType(Type type) 126internal static bool IsInternalType(Type type) 128Type origType = type; 148internal static bool IsPublicType(Type type) 165internal static Type GetFrameworkType(string assemblyName, Type type) 189internal static Type GetSystemType(Type type) 215internal static string GetTypeConverterAttributeData(Type type, out Type converterType) 221internal static string GetTypeConverterAttributeData(MemberInfo mi, out Type converterType) 229private static string GetCustomAttributeData(MemberInfo mi, Type attrType, out Type typeValue) 252private static string GetCustomAttributeData(IList<CustomAttributeData> list, Type attrType, out Type typeValue, bool allowTypeAlso, bool allowZeroArgs) 273internal static string GetCustomAttributeData(Type t, 274Type attrType, 277out Type typeValue) 281Type currentType = t; 316Type attrType, 317out Type typeValue, 340if (attrValue is null && allowTypeAlso && tca.ArgumentType == typeof(Type)) 343typeValue = tca.Value as Type;
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\Replacements\TypeUriConverter.cs (4)
19public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 26public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 34public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 46ConstructorInfo constructor = typeof(Uri).GetConstructor(new Type[] { typeof(string), typeof(UriKind) });
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (11)
110internal static Type? GetConverterType(Type type) 115string? converterName = ReflectionHelper.GetTypeConverterAttributeData(type, out Type? converterType); 119private static Type? GetConverterTypeFromName(string? converterName) 121Type? converterType = null; 239private static TypeConverter? GetCoreConverterFromCoreType(Type type) 316else if (type == typeof(Type)) 333internal static TypeConverter? GetCoreConverterFromCustomType(Type type) 416else if (type == typeof(Type)) 442internal static TypeConverter GetTypeConverter(Type type) 450Type? converterType = GetConverterType(type);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlWrappingReader.cs (1)
56public override System.Type ValueType { get { return _reader.ValueType; } }
System\Windows\Markup\AcceptedMarkupExtensionExpressionTypeAttribute.cs (2)
11public Type? Type { get; set; } 13public AcceptedMarkupExtensionExpressionTypeAttribute(Type? type)
System\Windows\Markup\ArrayExtension.cs (2)
33public ArrayExtension(Type arrayType) 68public Type Type { get; set; }
System\Windows\Markup\ContentWrapperAttribute.cs (2)
23public ContentWrapperAttribute(Type? contentWrapper) 32public Type? ContentWrapper { get; }
System\Windows\Markup\IValueSerializerContext.cs (1)
24ValueSerializer GetValueSerializerFor(Type type);
System\Windows\Markup\IXamlTypeResolver.cs (1)
24Type Resolve(string qualifiedTypeName);
System\Windows\Markup\MarkupExtensionReturnTypeAttribute.cs (5)
17public MarkupExtensionReturnTypeAttribute(Type? returnType) 25public MarkupExtensionReturnTypeAttribute(Type? returnType, Type? expressionType) 31public Type? ReturnType { get; } 34public Type? ExpressionType { get; }
System\Windows\Markup\NameReferenceConverter.cs (3)
15public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 49public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 65public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Windows\Markup\NameScopePropertyAttribute.cs (2)
18public NameScopePropertyAttribute(string? name, Type? type) : this(name) 24public Type? Type { get; }
System\Windows\Markup\StaticExtension.cs (5)
22private Type _memberType; 55Type type = MemberType; 119private bool GetFieldOrPropertyValue(Type type, string name, out object value) 121Type currentType = type; 164public Type MemberType
System\Windows\Markup\StaticExtensionsToInstanceDescriptorsConverter.cs (3)
17public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 27public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 37typeof(StaticExtension).GetConstructor(new Type[] { typeof(string) }),
System\Windows\Markup\TypeExtension.cs (4)
17[MarkupExtensionReturnType(typeof(Type))] 21private Type _type; 41public TypeExtension(Type type) 107public Type Type
System\Windows\Markup\TypeExtensionConverter.cs (4)
17public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 27public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 37typeof(TypeExtension).GetConstructor(new Type[] { typeof(Type) }),
System\Windows\Markup\ValueSerializer.cs (5)
96public virtual IEnumerable<Type> TypeReferences(object? value, IValueSerializerContext? context) 98return Array.Empty<Type>(); 106public static ValueSerializer? GetSerializerFor(Type type) 196public static ValueSerializer? GetSerializerFor(Type type, IValueSerializerContext? context) 235protected Exception GetConvertToException(object? value, Type destinationType)
System\Windows\Markup\XamlDeferLoadAttribute.cs (4)
10public XamlDeferLoadAttribute(Type loaderType, Type contentType) 30public Type? LoaderType { get; private set; } 31public Type? ContentType { get; private set; }
System\Xaml\AttachableMemberIdentifier.cs (3)
11readonly Type declaringType; 14public AttachableMemberIdentifier(Type declaringType, string memberName) 28public Type DeclaringType
System\Xaml\Context\ObjectWriterContext.cs (1)
150internal Type ServiceProvider_Resolve(string qName)
System\Xaml\Context\ServiceProviderContext.cs (3)
35object IServiceProvider.GetService(Type serviceType) 114Type IXamlTypeResolver.Resolve(string qName) 386public Type GetDestinationType()
System\Xaml\Context\XamlParserContext.cs (2)
117Type allowProtectedForType = null; 292Type allowProtectedForType = null;
System\Xaml\EventConverter.cs (3)
18public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 31GetRootObjectAndDelegateType(context, out object? rootObject, out Type? delegateType); 41internal static void GetRootObjectAndDelegateType(ITypeDescriptorContext? context, out object? rootObject, out Type? delegateType)
System\Xaml\IDestinationTypeProvider.cs (1)
11Type GetDestinationType();
System\Xaml\InfosetObjects\XamlObjectWriter.cs (5)
1054private XamlType GetXamlType(Type clrType) 1412private static bool IsBuiltInGenericDictionary(Type type) 1418Type openGeneric = type.GetGenericTypeDefinition(); 1803private bool Logic_WillParentCollectionAdd(ObjectWriterContext ctx, Type type, bool excludeObjectType) 2176Type rootInstanceType = (curInstance is not null) ? curInstance.GetType() : ctx.CurrentType.UnderlyingType;
System\Xaml\RefOnly\LooseTypeExtensions.cs (12)
19internal static bool AssemblyQualifiedNameEquals(Type t1, Type t2) 66internal static bool IsAssemblyQualifiedNameAssignableFrom(Type t1, Type t2) 93Type[] genericParameterConstraints = t1.GetGenericParameterConstraints(); 105static bool LooselyImplementInterface(Type t, Type interfaceType) 107for (Type type = t; type is not null; type = type.BaseType) 109Type[] interfaces = type.GetInterfaces(); 122static bool IsLooseSubClassOf(Type t1, Type t2) 134for(Type baseType = t1.BaseType; baseType is not null; baseType = baseType.BaseType)
System\Xaml\Replacements\DateTimeConverter2.cs (3)
18public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) 28public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) 41public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
System\Xaml\Replacements\DateTimeOffsetConverter2.cs (4)
16public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 26public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 36public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 47ConstructorInfo constructor = typeof(DateTimeOffset).GetConstructor(new Type[]
System\Xaml\Replacements\TypeListConverter.cs (4)
19public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 27Type[] types = new Type[tl.Length]; 30types[i] = (Type)s_typeTypeConverter.ConvertFrom(context, TypeConverterHelper.InvariantEnglishUS, tl[i]);
System\Xaml\Replacements\TypeTypeConverter.cs (5)
19public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 36public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 39public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 41if (context is not null && value is Type type && destinationType == typeof(string)) 53private static string ConvertTypeToString(ITypeDescriptorContext context, Type type)
System\Xaml\Runtime\ClrObjectRuntime.cs (12)
74Type type = xamlType.UnderlyingType; 103protected virtual object InvokeFactoryMethod(Type type, string methodName, object[] args) 109protected MethodInfo GetFactoryMethod(Type type, string methodName, object[] args, BindingFlags flags) 114factory = type.GetMethod(methodName, flags, null, Type.EmptyTypes, null); 134return Type.DefaultBinder.BindToMethod( 185public override bool CanConvertTo(ITypeDescriptorContext context, TypeConverter converter, Type type) 372Type keyType = dictionaryType.KeyType.UnderlyingType; 373Type itemType = dictionaryType.ItemType.UnderlyingType; 374Type genericKVP = typeof(KeyValuePair<,>).MakeGenericType(keyType, itemType); 375Type genericIEnumerator = typeof(IEnumerator<>).MakeGenericType(genericKVP); 380var method = openMethod.MakeGenericMethod(new Type[] { keyType, itemType }); 659protected virtual Delegate CreateDelegate(Type delegateType, object target, string methodName)
System\Xaml\Runtime\DynamicMethodRuntime.cs (41)
40delegate Delegate DelegateCreator(Type delegateType, object target, string methodName); 44Type _localType; 59Dictionary<Type, object> _converterInstances; 60Dictionary<Type, DelegateCreator> _delegateCreators; 99private Dictionary<Type, object> ConverterInstances 105_converterInstances = new Dictionary<Type, object>(); 111private Dictionary<Type, DelegateCreator> DelegateCreators 117_delegateCreators = new Dictionary<Type, DelegateCreator>(); 139Type clrType = ts.ConverterType; 165Type delegateType; 174protected override Delegate CreateDelegate(Type delegateType, object target, string methodName) 177Type targetType = target.GetType(); 191private object CreateInstanceWithCtor(Type type, object[] args) 196ctor = type.GetConstructor(BF_AllInstanceMembers, null, Type.EmptyTypes, null); 214protected override object InvokeFactoryMethod(Type type, string methodName, object[] args) 260private DelegateCreator CreateDelegateCreator(Type targetType) 269helperFlags, null, new Type[] { typeof(Type), typeof(string) }, null); 280typeof(Delegate), typeof(Type), typeof(object), typeof(string)); 297typeof(Delegate), typeof(Type), typeof(object), typeof(string)); 305new Type[] { typeof(Type), typeof(object), typeof(string) }, null); 353Type[] paramTypes = new Type[parameters.Length]; 357Type paramType = parameters[i].ParameterType; 365Type elementType = paramType.GetElementType(); 410Type targetType = getter.IsStatic ? getter.GetParameters()[0].ParameterType : GetTargetType(getter); 429Type targetType = setter.IsStatic ? parameters[0].ParameterType : GetTargetType(setter); 430Type valueType = setter.IsStatic ? parameters[1].ParameterType : parameters[0].ParameterType; 443private DynamicMethod CreateDynamicMethod(string name, Type returnType, params Type[] argTypes) 455private Type GetTargetType(MethodInfo instanceMethod) 457Type declaringType = instanceMethod.DeclaringType; 488private static void Emit_CastTo(ILGenerator ilGenerator, Type toType) 500private static void Emit_BoxIfValueType(ILGenerator ilGenerator, Type type) 548private void Emit_LateBoundInvoke(ILGenerator ilGenerator, Type targetType, string methodName, 578s_InvokeMemberMethod = typeof(Type).GetMethod(KnownStrings.InvokeMember, 579new Type[] { typeof(string), typeof(BindingFlags), typeof(Binder), typeof(object), typeof(object[]) }); 584private void Emit_TypeOf(ILGenerator ilGenerator, Type type) 589s_GetTypeFromHandleMethod = typeof(Type).GetMethod( 591null, new Type[] { typeof(RuntimeTypeHandle) }, null);
System\Xaml\Runtime\PartialTrustTolerantRuntime.cs (1)
120public override bool CanConvertTo(ITypeDescriptorContext context, TypeConverter converter, Type type)
System\Xaml\Schema\BuiltInValueConverter.cs (5)
20internal BuiltInValueConverter(Type converterType, Func<TConverterBase> factory) 71internal static XamlValueConverter<TypeConverter> GetTypeConverter(Type targetType) 141if (typeof(Type).IsAssignableFrom(targetType)) 145if (typeof(Type[]).IsAssignableFrom(targetType)) 206internal static XamlValueConverter<ValueSerializer> GetValueSerializer(Type targetType)
System\Xaml\Schema\CollectionReflector.cs (33)
15private static Type[] s_typeOfObjectArray; 16private static Type[] s_typeOfTwoObjectArray; 30internal static XamlCollectionKind LookupCollectionKind(Type type, out MethodInfo addMethod) 80internal static MethodInfo LookupAddMethod(Type type, XamlCollectionKind collectionKind) 105private static bool TryGetICollectionAdder(Type type, out MethodInfo addMethod) 108Type genericICollection = GetGenericInterface(type, typeof(ICollection<>), out hasMoreThanOneICollection); 123private static bool TryGetCollectionAdder(Type type, bool mayBeICollection, out MethodInfo addMethod) 169private static bool TryGetIDictionaryAdder(Type type, out MethodInfo addMethod) 172Type genericIDictionary = GetGenericInterface(type, typeof(IDictionary<,>), out hasMoreThanOneIDictionary); 187private static bool TryGetDictionaryAdder(Type type, bool mayBeIDictionary, out MethodInfo addMethod) 231internal static MethodInfo GetAddMethod(Type type, Type contentType) 233return GetMethod(type, KnownStrings.Add, new Type[] { contentType }); 236internal static MethodInfo GetEnumeratorMethod(Type type) 248internal static MethodInfo GetIsReadOnlyMethod(Type collectionType, Type itemType) 250Type genericICollection = typeof(ICollection<>).MakeGenericType(itemType); 259private static MethodInfo LookupEnumeratorMethod(Type type) 261MethodInfo result = GetMethod(type, KnownStrings.GetEnumerator, Type.EmptyTypes); 269private static Type GetGenericInterface(Type type, Type interfaceType, out bool hasMultiple) 271Type result = null; 277foreach (Type currentInterface in type.GetInterfaces()) 293private static MethodInfo GetAddMethod(Type type, int paramCount, out bool hasMoreThanOne) 324private static BindingFlags GetBindingFlags(Type type) 336private static MethodInfo GetMethod(Type type, string name, Type[] argTypes) 346private static MethodInfo GetPublicMethod(Type type, string name, int argCount) 360private static Type[] TypeOfObjectArray 366s_typeOfObjectArray = new Type[] { typeof(object) }; 372private static Type[] TypeOfTwoObjectArray 378s_typeOfTwoObjectArray = new Type[] { typeof(object), typeof(object) };
System\Xaml\Schema\MemberReflector.cs (2)
240internal static bool IsProtectedVisibleTo(MethodInfo method, Type derivedType, XamlSchemaContext schemaContext) 274foreach (Type typeArg in method.GetGenericArguments())
System\Xaml\Schema\Reflector.cs (33)
43public bool IsAttributePresent(Type attributeType) 62public string GetAttributeString(Type attributeType, out bool checkedInherited) 128public IReadOnlyDictionary<char,char> GetBracketCharacterAttributes(Type attributeType) 162public T? GetAttributeValue<T>(Type attributeType) where T : struct 200public Type GetAttributeType(Type attributeType) 212return Type.GetType(typeName); 241public Type[] GetAttributeTypes(Type attributeType, int count) 253Type converterType = Type.GetType(tca.LoaderTypeName); 254Type contentType = Type.GetType(tca.ContentTypeName); 255return new Type[] { converterType, contentType }; 273public List<T> GetAllAttributeContents<T>(Type attributeType) 377private static bool TypesAreEqual(Type userType, Type builtInType) 389private ReadOnlyDictionary<char, char> TokenizeBracketCharacters(Type attributeType) 410private Type ExtractType(CustomAttributeData cad) 412Type result = null; 419ThrowInvalidMetadata(cad, 1, typeof(Type)); 424private Type[] ExtractTypes(CustomAttributeData cad, int count) 428ThrowInvalidMetadata(cad, count, typeof(Type)); 430Type[] result = new Type[count]; 436ThrowInvalidMetadata(cad, count, typeof(Type)); 442private Type ExtractType(CustomAttributeTypedArgument arg) 444if (arg.ArgumentType == typeof(Type)) 446return (Type)arg.Value; 451return Type.GetType(typeName); 479private CustomAttributeData GetAttribute(Type attributeType) 492private void GetAttributes(Type attributeType, IList<CustomAttributeData> cads) 504protected void ThrowInvalidMetadata(CustomAttributeData cad, int expectedCount, Type expectedType)
System\Xaml\Schema\TypeReflector.cs (9)
101public TypeReflector(Type underlyingType) 121internal static bool IsVisibleTo(Type type, Assembly accessingAssembly, XamlSchemaContext schemaContext) 135foreach (Type typeArg in type.GetGenericArguments()) 150internal static bool IsInternal(Type type) 260internal Type UnderlyingType { get; set; } 405Type ownerType = nspAttr.Type; 1047private static object GetCustomAttribute(Type attrType, Type reflectedType) 1063private static TypeVisibility GetVisibility(Type type)
System\Xaml\Schema\XamlMemberInvoker.cs (4)
113Type declaringType = _member.UnderlyingMember.DeclaringType; 116Type[] args; 119args = new Type[] { _member.TargetType.UnderlyingType ?? typeof(object) }; 124args = Type.EmptyTypes;
System\Xaml\Schema\XamlNamespace.cs (17)
65Type[] clrTypeArgs = ConvertArrayOfXamlTypesToTypes(typeArgs); 79Type type = TryGetType(typeName); 95private XamlType TryGetXamlType(string typeName, Type[] typeArgs) 107Type openType = openXamlType?.UnderlyingType; 114Type closedType = openType.MakeGenericType(typeArgs); 128private static Type MakeArrayType(Type elementType, string subscript) 130Type type = elementType; 152private Type[] ConvertArrayOfXamlTypesToTypes(XamlType[] typeArgs) 154var clrTypeArgs = new Type[typeArgs.Length]; 173private Type TryGetType(string typeName) 175Type type = SearchAssembliesForShortName(typeName); 187Type currentType = type; 214Type[] types = asm.GetTypes(); 216foreach (Type t in types) 242private Type SearchAssembliesForShortName(string shortName) 254Type type = asm.GetType(longName);
System\Xaml\Schema\XamlTypeInvoker.cs (4)
227Type type = _xamlType.UnderlyingType.UnderlyingSystemType; 251typeof(Action<object>).GetConstructor(new Type[] { typeof(Object), typeof(IntPtr) }); 297Type underlyingType = type._xamlType.UnderlyingType.UnderlyingSystemType; 299ConstructorInfo tConstInfo = underlyingType.GetConstructor(Type.EmptyTypes);
System\Xaml\Schema\XamlTypeTypeConverter.cs (3)
14public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 35public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) 40public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
System\Xaml\Schema\XamlValueConverter.cs (3)
22public Type ConverterType { get; } 25public XamlValueConverter(Type converterType, XamlType targetType) 30public XamlValueConverter(Type converterType, XamlType targetType, string name)
System\Xaml\XamlLanguage.cs (3)
249internal static string TypeAlias(Type type) 376internal static Type LookupClrNamespaceType(AssemblyNamespacePair nsPair, string typeName) 458private static XamlType GetXamlType(Type type)
System\Xaml\XamlMember.cs (8)
474internal bool IsReadVisibleTo(Assembly accessingAssembly, Type accessingType) 491internal bool IsWriteVisibleTo(Assembly accessingAssembly, Type accessingType) 527Type[] loaderTypes = _reflector.GetAttributeTypes(typeof(XamlDeferLoadAttribute), 2); 653Type result = parameters[0].ParameterType; 667Type converterType = _reflector.GetAttributeType(typeof(TypeConverterAttribute)); 686Type converterType = _reflector.GetAttributeType(typeof(ValueSerializerAttribute)); 719Type systemType = LookupSystemType(); 951private Type LookupSystemType()
System\Xaml\XamlObjectReader.cs (15)
1221void AddFactoryMethodAndValidateArguments(Type valueType, MemberInfo memberInfo, ICollection arguments, SerializerContext context, out ParameterInfo[] methodParams) 1241var declaringType = memberInfo.DeclaringType; 1428var valueType = value.GetType(); 1786static string ConvertTypeAndMethodToString(Type type, string methodName, SerializerContext context) 1967else if (value is Type type) 2553public Type RootType { get; set; } 2622public XamlType GetXamlType(Type clrType) 2633public XamlType LocalAssemblyAwareGetXamlType(Type clrType) 2636if(!result.IsVisibleTo(LocalAssembly) && !typeof(Type).IsAssignableFrom(clrType)) 2643public bool CanConvertTo(TypeConverter converter, Type type) 2769Type allowProtectedMemberOnType = null; 2779Type allowProtectedMemberOnType = null; 2812public object GetService(Type serviceType) 2841public ValueSerializer GetValueSerializerFor(Type type) 3219Type baseDeclaringType = accessor.GetBaseDefinition().DeclaringType;
System\Xaml\XamlRuntime.cs (1)
36abstract public bool CanConvertTo(ITypeDescriptorContext context, TypeConverter converter, Type type);
System\Xaml\XamlSchemaContext.cs (15)
465private ConcurrentDictionary<Type, XamlType> _masterTypeList; 466private ConcurrentDictionary<ReferenceEqualityTuple<Type, XamlType, Type>, object> _masterValueConverterList; 488private ConcurrentDictionary<Type, XamlType> MasterTypeList 493Interlocked.CompareExchange(ref _masterTypeList, CreateDictionary<Type, XamlType>(ReferenceEqualityComparer.Instance), null); 499private ConcurrentDictionary<ReferenceEqualityTuple<Type, XamlType, Type>, object> MasterValueConverterList 504Interlocked.CompareExchange(ref _masterValueConverterList, CreateDictionary<ReferenceEqualityTuple<Type, XamlType, Type>, object>(), null); 520public virtual XamlType GetXamlType(Type type) 527internal XamlType GetXamlType(Type type, string alias) 592Type converterType, XamlType targetType) 595var key = new ReferenceEqualityTuple<Type, XamlType, Type>(converterType, targetType, typeof(TConverterBase)); 890Type clrType = type.UnderlyingType;
System\Xaml\XamlType.cs (37)
32private NullableReference<Type> _underlyingType; 57public XamlType(Type underlyingType, XamlSchemaContext schemaContext) 62public XamlType(Type underlyingType, XamlSchemaContext schemaContext, XamlTypeInvoker invoker) 67internal XamlType(string alias, Type underlyingType, XamlSchemaContext schemaContext, XamlTypeInvoker invoker, TypeReflector reflector) 152public Type UnderlyingType 167internal NullableReference<Type> UnderlyingTypeInternal 415Type baseUnderlyingType = xamlType.UnderlyingType; 419Type curUnderlyingType = curType.UnderlyingType; 591Type underlyingType = UnderlyingType; 622internal ConstructorInfo GetConstructor(Type[] paramTypes) 634MethodBase result = Type.DefaultBinder.SelectMethod(ConstructorBindingFlags, ctorArray, paramTypes, null); 642Type attributeType = null; 705Type underlyingType = UnderlyingType; 735Type underlyingType = UnderlyingType; 745ConstructorInfo defaultCtor = underlyingType.GetConstructor(ConstructorBindingFlags, null, Type.EmptyTypes, null); 773List<Type> wrapperTypes = _reflector.GetAllAttributeContents<Type>(typeof(ContentWrapperAttribute)); 777foreach (Type wrapperType in wrapperTypes) 810Type[] loaderTypes = _reflector.GetAttributeTypes(typeof(XamlDeferLoadAttribute), 2); 825Type underlyingType = UnderlyingType; 932Type result = null; 965Type returnType = _reflector.GetAttributeType(typeof(MarkupExtensionReturnTypeAttribute)); 1104protected virtual Type LookupUnderlyingType() 1111Type underlyingType = UnderlyingType; 1151Type converterType = _reflector.GetAttributeType(typeof(TypeConverterAttribute)); 1167Type underlyingType = UnderlyingType; 1181Type[] typeArgs = underlyingType.GetGenericArguments(); 1195Type converterType = _reflector.GetAttributeType(typeof(ValueSerializerAttribute)); 1211Type underlyingType = UnderlyingType; 1221Type[] typeArgs = underlyingType.GetGenericArguments(); 1483private static ReadOnlyCollection<XamlType> GetTypeArguments(Type type, XamlSchemaContext schemaContext) 1485Type genericType = type; 1494Type[] types = genericType.GetGenericArguments(); 1503private static string GetTypeName(Type type) 1571XamlType typeOfType = SchemaContext.GetXamlType(typeof(Type)); 1585Type type = param.ParameterType; 1681private bool TryGetAttributeString(Type attributeType, out string result)
System\Xaml\XamlXmlWriter.cs (4)
1888Type objectClrType = objectXamlType.UnderlyingType; 1947Type[] paramClrTypes = new Type[numOfParameters]; 1952Type underlyingType = xamlType.UnderlyingType;
System.Xaml.Tests (53)
System\Windows\Markup\AcceptedMarkupExtensionExpressionTypeAttributeTests.cs (1)
15public void Ctor_Type(Type? type)
System\Windows\Markup\ArrayExtensionTests.cs (4)
24public void Ctor_Type(Type type) 36Assert.Throws<ArgumentNullException>("arrayType", () => new ArrayExtension((Type)null!)); 52public void Ctor_Array(Array elements, Type expectedType) 122public void Type_Set_GetReturnsExpected(Type? value)
System\Windows\Markup\ContentWrapperAttributeTests.cs (1)
14public void Ctor_Type(Type? contentWrapper)
System\Windows\Markup\MarkupExtensionReturnTypeAttributeTests.cs (3)
23public void Ctor_Type(Type? returnType) 33public void Ctor_Type_Type(Type? returnType, Type? expressionType)
System\Windows\Markup\NameReferenceConverterTests.cs (4)
20public void CanConvertFrom_Invoke_ReturnsExpected(Type? type, bool expected) 132public void CanConvertTo_Invoke_ReturnsExpected(ITypeDescriptorContext context, Type destinationType, bool expected) 203public Func<Type, object>? GetServiceAction { get; set; } 205public object GetService(Type serviceType)
System\Windows\Markup\NameScopePropertyAttributeTests.cs (1)
25public void Ctor_String_Type(string? name, Type? type)
System\Windows\Markup\ReferenceTests.cs (2)
97public Func<Type, object>? ServiceAction { get; set; } 99public object GetService(Type serviceType) =>
System\Windows\Markup\StaticExtensionTests.cs (7)
186public void MemberType_Set_GetReturnsExpected(Type value) 204public void StaticExtensionConverter_CanConvertTo_ReturnsExpected(Type? type, bool expected) 217Assert.Equal(new Type[] { typeof(string) }, Assert.IsAssignableFrom<ConstructorInfo>(descriptor.MemberInfo).GetParameters().Select(p => p.ParameterType)); 248public Func<Type, object>? ServiceAction { get; set; } 250public object GetService(Type serviceType) => 256public Func<string, Type>? ResolveAction { get; set; } 258public Type Resolve(string qualifiedTypeName) =>
System\Windows\Markup\TypeExtensionTests.cs (11)
40public void Ctor_Type(Type type) 50Assert.Throws<ArgumentNullException>("type", () => new TypeExtension((Type)null!)); 146public void Type_Set_GetReturnsExpected(Type value) 165public void TypeExtensionConverter_CanConvertTo_ReturnsExpected(Type? type, bool expected) 178Assert.Equal(new Type[] { typeof(Type) }, Assert.IsAssignableFrom<ConstructorInfo>(descriptor.MemberInfo).GetParameters().Select(p => p.ParameterType)); 179Assert.Equal(new Type[] { typeof(int) }, descriptor.Arguments); 209public Func<Type, object>? ServiceAction { get; set; } 211public object GetService(Type serviceType) => 217public Func<string, Type>? ResolveAction { get; set; } 219public Type Resolve(string qualifiedTypeName) =>
System\Windows\Markup\ValueSerializerTests.cs (15)
117yield return new object[] { typeof(Type) }; 126public void GetSerializerFor_WellKnownType_ReturnsExpected(Type type) 197public void GetSerializerFor_NoSuchTypeConverterAttribute_ReturnsNull(Type type) 228Assert.Throws<ArgumentNullException>("type", () => ValueSerializer.GetSerializerFor((Type)null!)); 229Assert.Throws<ArgumentNullException>("type", () => ValueSerializer.GetSerializerFor((Type)null!, null)); 283public void GetSerializerFor_DescriptorHasNoConverter_ReturnsNull(Type type) 441public ValueSerializer? GetValueSerializerFor(Type type) => SerializerResult; 451public object GetService(Type serviceType) => throw new NotImplementedException(); 461public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 467public override bool CanConvertFrom(ITypeDescriptorContext? context, Type? sourceType) 478public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) 486public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 491public override bool CanConvertFrom(ITypeDescriptorContext? context, Type? sourceType) 499public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) 504public override bool CanConvertFrom(ITypeDescriptorContext? context, Type? sourceType)
System\Windows\Markup\XamlDeferLoadAttributeTests.cs (2)
14public void Ctor_Type_Type(Type loaderType, Type contentType)
System\Windows\Markup\XamlSetMarkupExtensionEventArgsTests.cs (1)
41public object GetService(Type serviceType) => throw new NotImplementedException();
System\Windows\Markup\XamlSetTypeConverterEventArgsTests.cs (1)
50public object GetService(Type serviceType) => throw new NotImplementedException();
UIAutomationClient (12)
MS\Internal\Automation\AutomationAttributeInfo.cs (3)
30Type type 50internal Type Type { get { return _type; } } 64private Type _type;
MS\Internal\Automation\AutomationPropertyInfo.cs (3)
30Type type, 53internal Type Type { get { return _type; } } 67private Type _type;
MS\Internal\Automation\Misc.cs (2)
73internal static Array CombineArrays(IEnumerable arrays, Type t) 98internal static Array RemoveDuplicates(Array a, Type t)
MS\Internal\Automation\ProxyManager.cs (2)
65Type t = a.GetType( typeName ); 351Type t = mb.ReflectedType;
System\Windows\Automation\ItemContainerPattern.cs (1)
136Type expectedType = info.Type;
System\Windows\Automation\PropertyCondition.cs (1)
134Type expectedType = info.Type;
UnitTests.Common (7)
MockTransportBindingElement.cs (3)
13BuildChannelFactoryOverride = (Type t, BindingContext bc) => DefaultBuildChannelFactory(t, bc); 17public Func<Type,BindingContext,IChannelFactory> BuildChannelFactoryOverride { get; set; } 52public IChannelFactory DefaultBuildChannelFactory(Type tChannel, BindingContext context)
TestHelpers.cs (4)
113public static string ValidateContractDescription(ContractDescription contract, Type expectedType, ContractDescriptionData expectedContract) 125Type contractType = contract.ContractType; 317public Type MessageType { get; set; } 329public Type Type { get; set; }
VBCSCompiler.UnitTests (1)
NamedPipeTestUtil.cs (1)
28var sharedServerType = typeof(NamedPipeServerStream).Assembly.GetType(sharedServerFullName);
VisualBasicRuntimeTest (2)
Program.cs (2)
130Type dialogType = typeof(ApplicationBase).Assembly.GetType("Microsoft.VisualBasic.MyServices.Internal.ProgressDialog"); 154Type formType = typeof(ApplicationBase).Assembly.GetType("Microsoft.VisualBasic.CompilerServices.VBInputBox");
WindowsFormsIntegration (2)
System\Windows\Integration\PropertyMap.cs (1)
182return SourceObject.GetType().GetProperty(propertyName, Type.EmptyTypes);
System\Windows\Integration\WindowsFormsHost.cs (1)
1115MethodInfo methodInfo = typeof(SWF.Control).GetMethod("OnParentRightToLeftChanged", BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(EventArgs) }, null);
WinFormsControlsTest (2)
Dialogs.cs (1)
87Type? typeCustomColorDialog = typeof(ColorEditor).Assembly.GetTypes().SingleOrDefault(t => t.Name == "CustomColorDialog")
UserControls\UserControlWithObjectCollectionEditor.cs (1)
33public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
XmlFileLogger (4)
LogProcessNode.cs (4)
23private readonly Dictionary<Type, List<ILogNode>> _childNodes; 31_childNodes = new Dictionary<Type, List<ILogNode>>(); 96var type = childNode.GetType(); 116var t = typeof(T);
XmlFormattersWebSite (2)
PersonWrapper.cs (1)
32public object Unwrap(Type declaredType)
PersonWrapperProvider.cs (1)
23public Type WrappingType
xunit.assert (77)
Assert.cs (3)
56 /// Safely perform <see cref="Type.GetGenericTypeDefinition"/>, returning <c>null</c> when the 64 static Type? SafeGetGenericTypeDefinition([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type? type)
EqualityAsserts.cs (11)
37 static readonly Type typeofDictionary = typeof(Dictionary<,>); 38 static readonly Type typeofHashSet = typeof(HashSet<>); 39 static readonly Type typeofSet = typeof(ISet<>); 272 var expectedType = expected?.GetType(); 273 var actualType = actual?.GetType(); 317 var expectedType = expected?.GetType(); 318 var actualType = actual?.GetType(); 319 var expectedTypeDefinition = SafeGetGenericTypeDefinition(expectedType); 322 var actualTypeDefinition = SafeGetGenericTypeDefinition(actualType); 786 var expectedType = expected?.GetType(); 787 var actualType = actual?.GetType();
ExceptionAsserts.cs (6)
32 Type exceptionType, 57 Type exceptionType, 69 Type exceptionType, 81 Type exceptionType, 190 Type exceptionType, 259 Type exceptionType,
Sdk\ArgumentFormatter.cs (9)
83 static readonly Type[] EmptyTypes = new Type[0]; 187 public static string Format(Type? value) 216 var valueAsType = value as Type; 251 var type = value.GetType(); 325 DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type, 477 Type type, 578 internal static Type? GetSetElementType(object? obj)
Sdk\AssertEqualityComparer.cs (9)
140 static readonly ConcurrentDictionary<Type, TypeInfo> cacheOfIComparableOfT = new ConcurrentDictionary<Type, TypeInfo>(); 141 static readonly ConcurrentDictionary<Type, TypeInfo> cacheOfIEquatableOfT = new ConcurrentDictionary<Type, TypeInfo>(); 143 static readonly Type typeKeyValuePair = typeof(KeyValuePair<,>); 339 var xKeyType = xKey.GetType(); 340 var yKeyType = yKey?.GetType(); 362 var xValueType = xValue.GetType(); 363 var yValueType = yValue?.GetType();
Sdk\AssertHelper.cs (12)
63 static readonly ConcurrentDictionary<Type, Dictionary<string, Func<object?, object?>>> gettersByType = new ConcurrentDictionary<Type, Dictionary<string, Func<object?, object?>>>(); 70 static readonly Lazy<TypeInfo?> fileSystemInfoTypeInfo = new Lazy<TypeInfo?>(() => Type.GetType(fileSystemInfoFqn)?.GetTypeInfo()); 71 static readonly Lazy<PropertyInfo?> fileSystemInfoFullNameProperty = new Lazy<PropertyInfo?>(() => Type.GetType(fileSystemInfoFqn)?.GetTypeInfo().GetDeclaredProperty("FullName")); 123 | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type) => 136 | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type _type) => 197 internal static bool IsCompilerGenerated(Type type) => 312 Type targetType, 452 var expectedType = expected.GetType(); 454 var actualType = actual.GetType(); 606 var expectedType = expected.GetType(); 607 var actualType = actual.GetType();
Sdk\CollectionTracker.cs (4)
225 var valueXType = valueX.GetType(); 226 var valueYType = valueY.GetType(); 318 var elementTypeX = ArgumentFormatter.GetSetElementType(x.InnerEnumerable); 319 var elementTypeY = ArgumentFormatter.GetSetElementType(y.InnerEnumerable);
Sdk\CollectionTrackerExtensions.cs (2)
46 static readonly ConcurrentDictionary<Type, MethodInfo> cacheOfAsTrackerByType = new ConcurrentDictionary<Type, MethodInfo>();
Sdk\Exceptions\EquivalentException.cs (2)
247 Type expectedType, 248 Type actualType,
Sdk\Exceptions\IsAssignableFromException.cs (1)
39 Type expected,
Sdk\Exceptions\IsNotAssignableFromException.cs (1)
36 Type expected,
Sdk\Exceptions\IsNotTypeException.cs (1)
35 public static IsNotTypeException ForExactType(Type type)
Sdk\Exceptions\NotNullException.cs (1)
34 public static Exception ForNullStruct(Type type) =>
Sdk\Exceptions\NullException.cs (1)
45 Type type,
Sdk\Exceptions\RaisesAnyException.cs (1)
34 public static RaisesAnyException ForNoEvent(Type expected) =>
Sdk\Exceptions\RaisesException.cs (3)
36 Type expected, 37 Type actual) => 61 public static RaisesException ForNoEvent(Type expected) =>
Sdk\Exceptions\ThrowsAnyException.cs (2)
45 Type expected, 64 public static ThrowsAnyException ForNoException(Type expected) =>
Sdk\Exceptions\ThrowsException.cs (3)
45 Type expected, 67 Type expected, 93 public static ThrowsException ForNoException(Type expected) =>
TypeAsserts.cs (5)
58 Type expectedType, 92 Type expectedType, 127 Type expectedType, 166 Type expectedType, 178 var actualType = @object.GetType();
xunit.console (5)
common\AssemblyResolution\AssemblyHelper.cs (1)
103public static IDisposable SubscribeResolveForAssembly(Type typeInAssembly, IMessageSink internalDiagnosticsMessageSink = null)
ConsoleRunner.cs (4)
140Type[] types = new Type[0]; 156foreach (var type in types) 162var ctor = type.GetConstructor(new Type[0]);
Xunit.NetCore.Extensions (12)
AssemblyFixtureSupport\AssemblyFixtureAttribute.cs (2)
13public AssemblyFixtureAttribute(Type fixtureType) 18public Type FixtureType { get; private set; }
AssemblyFixtureSupport\XunitTestAssemblyRunnerWithAssemblyFixture.cs (2)
18private readonly Dictionary<Type, object> assemblyFixtureMappings = new Dictionary<Type, object>();
AssemblyFixtureSupport\XunitTestClassRunnerWithAssemblyFixture.cs (3)
18private readonly Dictionary<Type, object> assemblyFixtureMappings = new Dictionary<Type, object>(); 25CancellationTokenSource cancellationTokenSource, IDictionary<Type, object> collectionFixtureMappings)
AssemblyFixtureSupport\XunitTestCollectionRunnerWithAssemblyFixture.cs (3)
17private readonly Dictionary<Type, object> assemblyFixtureMappings; 21public XunitTestCollectionRunnerWithAssemblyFixture(Dictionary<Type, object> assemblyFixtureMappings, 41var combinedFixtures = new Dictionary<Type, object>(assemblyFixtureMappings);
AssemblyFixtureSupport\XunitTestMethodRunnerWithAssemblyFixture.cs (2)
17private readonly Dictionary<Type, object> assemblyFixtureMappings = new Dictionary<Type, object>();