14 types derived from MethodInfo
System.Private.CoreLib (8)
System.Reflection.Context (2)
System.Reflection.Emit (2)
System.Reflection.MetadataLoadContext (1)
System.Xaml.Tests (1)
5175 references to MethodInfo
Aspire.Dashboard.Components.Tests (2)
Aspire.Hosting.Testing (2)
Aspire.TestUtilities (2)
Binding.UDS.IntegrationTests (2)
ConfigurationSchemaGenerator (2)
DesignSurfaceExt (1)
Diagnostics.EFCore.FunctionalTests (1)
dotnet-svcutil.xmlserializer (4)
dotnet-svcutil.xmlserializer.IntegrationTests (1)
dotnet-svcutil-lib (423)
FrameworkFork\Microsoft.Xml\External\Extensions.cs (2)
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\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (32)
26private static MethodInfo s_getTypeFromHandle;
27private static MethodInfo GetTypeFromHandle
50private static MethodInfo s_objectEquals;
51private static MethodInfo ObjectEquals
73private static MethodInfo s_arraySetValue;
74private static MethodInfo ArraySetValue
94private static MethodInfo s_objectToString;
95private static MethodInfo ObjectToString
109private static MethodInfo s_stringFormat;
110private static MethodInfo StringFormat
192MethodInfo signature = delegateType.GetMethod("Invoke");
255internal MethodInfo CurrentMethod
383LocalBuilder enumerator, MethodInfo getCurrentMethod)
397internal void EndForEach(MethodInfo moveNextMethod)
516internal void VerifyParameterCount(MethodInfo methodInfo, int expectedCount)
522internal void Call(object thisObj, MethodInfo methodInfo)
529internal void Call(object thisObj, MethodInfo methodInfo, object param1)
537internal void Call(object thisObj, MethodInfo methodInfo, object param1, object param2)
546internal void Call(object thisObj, MethodInfo methodInfo, object param1, object param2, object param3)
556internal void Call(object thisObj, MethodInfo methodInfo, object param1, object param2, object param3, object param4)
567internal void Call(object thisObj, MethodInfo methodInfo, object param1, object param2, object param3, object param4, object param5)
579internal void Call(object thisObj, MethodInfo methodInfo, object param1, object param2, object param3, object param4, object param5, object param6)
592internal void Call(MethodInfo methodInfo)
712MethodInfo getMethod = property.GetMethod;
718else if (memberInfo is MethodInfo)
720MethodInfo method = (MethodInfo)memberInfo;
754MethodInfo setMethod = property.SetMethod;
760else if (memberInfo is MethodInfo)
761Call((MethodInfo)memberInfo);
1443private void LoadThis(object thisObj, MethodInfo methodInfo)
1644private static MethodInfo s_stringLength = typeof(string).GetProperty("Length").GetMethod;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (19)
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)
411internal MethodInfo GetEnumeratorMethod
422internal MethodInfo AddMethod
576private readonly MethodInfo _getEnumeratorMethod, _addMethod;
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)
817internal MethodInfo GetEnumeratorMethod
822internal MethodInfo AddMethod
980internal static MethodInfo GetTargetMethodWithName(string name, Type type, Type interfaceType)
1003MethodInfo addMethod, getEnumeratorMethod;
1218private static void FindCollectionMethodsOnInterface(Type type, Type interfaceType, ref MethodInfo addMethod, ref MethodInfo getEnumeratorMethod)
1228private static void GetCollectionMethods(Type type, Type interfaceType, Type[] addMethodTypeArray, bool addMethodOnInterface, out MethodInfo getEnumeratorMethod, out MethodInfo addMethod)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\TypeLoader.cs (20)
135foreach (MethodInfo methodInfo in aParentType.GetRuntimeMethods().Where(m => !m.IsStatic))
282MethodInfo opMethod = operationDescription.OperationMethod;
370MethodInfo method = type.GetRuntimeMethod(knownTypeAttribute.MethodName, s_knownTypesMethodParamType);
408MethodInfo opMethod = opDesc.OperationMethod;
425private void ProcessOpMethod(MethodInfo opMethod, bool canHaveBehaviors,
429MethodInfo method = null;
432MethodInfo ifaceMethod = GetCorrespondingMethodFromType(ifaceType, opMethod);
437MethodInfo implMethod = GetCorrespondingMethodFromType(implType, opMethod);
502private static MethodInfo GetCorrespondingMethodFromType(Type type, MethodInfo methodInfo)
512MethodInfo matchingMethod = type.GetTypeInfo().DeclaredMethods.SingleOrDefault(m => MethodsMatch(m, methodInfo));
517private static bool MethodsMatch(MethodInfo method1, MethodInfo method2)
687foreach (MethodInfo methodInfo in contractToGetMethodsFrom.GetRuntimeMethods().Where(m => !m.IsStatic))
847private OperationDescription CreateOperationDescription(ContractDescription contractDescription, MethodInfo methodInfo, MessageDirection direction,
1020MethodInfo outputMethod = methodInfo;
1115private MessageDescription CreateMessageDescription(MethodInfo methodInfo,
1319MethodInfo getMethod = property.GetGetMethod(true);
1324MethodInfo setMethod = property.GetSetMethod(true);
1405private static bool IsMethodOverriding(MethodInfo method)
GenerateDocumentationAndConfigFiles (2)
GetDocument.Insider (14)
IIS.FunctionalTests (1)
IIS.LongTests (1)
IIS.NewHandler.FunctionalTests (1)
IIS.NewShim.FunctionalTests (1)
IIS.ShadowCopy.Tests (1)
IISExpress.FunctionalTests (1)
illink (2)
ILLink.RoslynAnalyzer (2)
Infrastructure.Common (5)
InMemory.FunctionalTests (3)
InProcessWebSite (1)
Metrics (5)
Metrics.Legacy (5)
Microsoft.Arcade.Common (1)
Microsoft.AspNetCore.App.Analyzers.Test (4)
Microsoft.AspNetCore.Components (18)
Microsoft.AspNetCore.Components.Endpoints (13)
Microsoft.AspNetCore.Components.Forms (3)
Microsoft.AspNetCore.Components.Web (3)
Microsoft.AspNetCore.Components.WebAssembly (8)
HotReload\HotReloadAgent.cs (2)
73var applyUpdateMethod = metadataUpdater.GetMethod(ApplyUpdateMethodName, BindingFlags.Public | BindingFlags.Static, binder: null, [typeof(Assembly), typeof(ReadOnlySpan<byte>), typeof(ReadOnlySpan<byte>), typeof(ReadOnlySpan<byte>)], modifiers: null);
82var getCapabilities = metadataUpdater.GetMethod(GetCapabilitiesMethodName, BindingFlags.NonPublic | BindingFlags.Static, binder: null, Type.EmptyTypes, modifiers: null);
Microsoft.AspNetCore.Diagnostics (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding (10)
Microsoft.AspNetCore.Grpc.Swagger (4)
Microsoft.AspNetCore.Hosting (13)
Internal\StartupLoader.cs (5)
296var configureMethod = FindMethod(startupType, "Configure{0}", environmentName, typeof(void), required: true)!;
302var configureMethod = FindMethod(startupType, "Configure{0}Container", environmentName, typeof(void), required: false);
313var servicesMethod = FindMethod(startupType, "Configure{0}Services", environmentName, typeof(IServiceProvider), required: false)
318private static MethodInfo? FindMethod([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType, string methodName, string environmentName, Type? returnType = null, bool required = true)
338var methodInfo = selectedMethods.FirstOrDefault();
Microsoft.AspNetCore.Hosting.Tests (1)
Microsoft.AspNetCore.Http.Abstractions (25)
Extensions\UseMiddlewareExtensions.cs (8)
23private static readonly MethodInfo GetServiceInfo = typeof(UseMiddlewareExtensions).GetMethod(nameof(GetService), BindingFlags.NonPublic | BindingFlags.Static)!;
24private static readonly MethodInfo GetKeyedServiceInfo = typeof(UseMiddlewareExtensions).GetMethod(nameof(GetKeyedService), BindingFlags.NonPublic | BindingFlags.Static)!;
68MethodInfo? invokeMethod = null;
69foreach (var method in methods)
108private readonly MethodInfo _invokeMethod;
115MethodInfo invokeMethod,
200private static Func<T, HttpContext, IServiceProvider, Task> ReflectionFallback<T>(MethodInfo methodInfo, ParameterInfo[] parameters)
265private static Func<T, HttpContext, IServiceProvider, Task> CompileExpression<T>(MethodInfo methodInfo, ParameterInfo[] parameters)
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
Microsoft.AspNetCore.Http.Extensions (139)
RequestDelegateFactory.cs (50)
41private static readonly MethodInfo ExecuteTaskWithEmptyResultMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteTaskWithEmptyResult), BindingFlags.NonPublic | BindingFlags.Static)!;
42private static readonly MethodInfo ExecuteValueTaskWithEmptyResultMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteValueTaskWithEmptyResult), BindingFlags.NonPublic | BindingFlags.Static)!;
43private static readonly MethodInfo ExecuteTaskOfTMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteTaskOfT), BindingFlags.NonPublic | BindingFlags.Static)!;
44private static readonly MethodInfo ExecuteTaskOfTFastMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteTaskOfTFast), BindingFlags.NonPublic | BindingFlags.Static)!;
45private static readonly MethodInfo ExecuteTaskOfObjectMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteTaskOfObject), BindingFlags.NonPublic | BindingFlags.Static)!;
46private static readonly MethodInfo ExecuteValueTaskOfObjectMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteValueTaskOfObject), BindingFlags.NonPublic | BindingFlags.Static)!;
47private static readonly MethodInfo ExecuteTaskOfStringMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteTaskOfString), BindingFlags.NonPublic | BindingFlags.Static)!;
48private static readonly MethodInfo ExecuteValueTaskOfTMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteValueTaskOfT), BindingFlags.NonPublic | BindingFlags.Static)!;
49private static readonly MethodInfo ExecuteValueTaskOfTFastMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteValueTaskOfTFast), BindingFlags.NonPublic | BindingFlags.Static)!;
50private static readonly MethodInfo ExecuteValueTaskMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteValueTask), BindingFlags.NonPublic | BindingFlags.Static)!;
51private static readonly MethodInfo ExecuteValueTaskOfStringMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteValueTaskOfString), BindingFlags.NonPublic | BindingFlags.Static)!;
52private static readonly MethodInfo ExecuteTaskResultOfTMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteTaskResult), BindingFlags.NonPublic | BindingFlags.Static)!;
53private static readonly MethodInfo ExecuteValueResultTaskOfTMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteValueTaskResult), BindingFlags.NonPublic | BindingFlags.Static)!;
54private static readonly MethodInfo ExecuteAwaitedReturnMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteAwaitedReturn), BindingFlags.NonPublic | BindingFlags.Static)!;
55private static readonly MethodInfo GetHeaderSplitMethod = typeof(ParsingHelpers).GetMethod(nameof(ParsingHelpers.GetHeaderSplit), BindingFlags.Public | BindingFlags.Static, [typeof(IHeaderDictionary), typeof(string)])!;
56private static readonly MethodInfo GetRequiredServiceMethod = typeof(ServiceProviderServiceExtensions).GetMethod(nameof(ServiceProviderServiceExtensions.GetRequiredService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider) })!;
57private static readonly MethodInfo GetServiceMethod = typeof(ServiceProviderServiceExtensions).GetMethod(nameof(ServiceProviderServiceExtensions.GetService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider) })!;
58private static readonly MethodInfo GetRequiredKeyedServiceMethod = typeof(ServiceProviderKeyedServiceExtensions).GetMethod(nameof(ServiceProviderKeyedServiceExtensions.GetRequiredKeyedService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider), typeof(object) })!;
59private static readonly MethodInfo GetKeyedServiceMethod = typeof(ServiceProviderKeyedServiceExtensions).GetMethod(nameof(ServiceProviderKeyedServiceExtensions.GetKeyedService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider), typeof(object) })!;
60private static readonly MethodInfo ResultWriteResponseAsyncMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteResultWriteResponse), BindingFlags.NonPublic | BindingFlags.Static)!;
61private static readonly MethodInfo StringResultWriteResponseAsyncMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ExecuteWriteStringResponseAsync), BindingFlags.NonPublic | BindingFlags.Static)!;
62private static readonly MethodInfo StringIsNullOrEmptyMethod = typeof(string).GetMethod(nameof(string.IsNullOrEmpty), BindingFlags.Static | BindingFlags.Public)!;
63private static readonly MethodInfo WrapObjectAsValueTaskMethod = typeof(RequestDelegateFactory).GetMethod(nameof(WrapObjectAsValueTask), BindingFlags.NonPublic | BindingFlags.Static)!;
64private static readonly MethodInfo TaskOfTToValueTaskOfObjectMethod = typeof(RequestDelegateFactory).GetMethod(nameof(TaskOfTToValueTaskOfObject), BindingFlags.NonPublic | BindingFlags.Static)!;
65private static readonly MethodInfo ValueTaskOfTToValueTaskOfObjectMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ValueTaskOfTToValueTaskOfObject), BindingFlags.NonPublic | BindingFlags.Static)!;
66private static readonly MethodInfo ArrayEmptyOfObjectMethod = typeof(Array).GetMethod(nameof(Array.Empty), BindingFlags.Public | BindingFlags.Static)!.MakeGenericMethod(new Type[] { typeof(object) });
74private static readonly MethodInfo JsonResultWriteResponseOfTFastAsyncMethod = typeof(RequestDelegateFactory).GetMethod(nameof(WriteJsonResponseFast), BindingFlags.NonPublic | BindingFlags.Static)!;
75private static readonly MethodInfo JsonResultWriteResponseOfTAsyncMethod = typeof(RequestDelegateFactory).GetMethod(nameof(WriteJsonResponse), BindingFlags.NonPublic | BindingFlags.Static)!;
77private static readonly MethodInfo LogParameterBindingFailedMethod = GetMethodInfo<Action<HttpContext, string, string, string, bool>>((httpContext, parameterType, parameterName, sourceValue, shouldThrow) =>
79private static readonly MethodInfo LogRequiredParameterNotProvidedMethod = GetMethodInfo<Action<HttpContext, string, string, string, bool>>((httpContext, parameterType, parameterName, source, shouldThrow) =>
81private static readonly MethodInfo LogImplicitBodyNotProvidedMethod = GetMethodInfo<Action<HttpContext, string, bool>>((httpContext, parameterName, shouldThrow) =>
83private static readonly MethodInfo LogFormMappingFailedMethod = GetMethodInfo<Action<HttpContext, string, string, FormDataMappingException, bool>>((httpContext, parameterName, parameterType, exception, shouldThrow) =>
113private static readonly MethodInfo EndpointFilterInvocationContextGetArgument = typeof(EndpointFilterInvocationContext).GetMethod(nameof(EndpointFilterInvocationContext.GetArgument))!;
123private static readonly MethodInfo ProcessFormMethod = typeof(RequestDelegateFactory).GetMethod(nameof(ProcessForm), BindingFlags.Static | BindingFlags.NonPublic)!;
124private static readonly MethodInfo FormDataMapperMapMethod = typeof(FormDataMapper).GetMethod(nameof(FormDataMapper.Map))!;
125private static readonly MethodInfo AsMemoryMethod = new Func<char[]?, int, int, Memory<char>>(MemoryExtensions.AsMemory).Method;
126private static readonly MethodInfo ArrayPoolSharedReturnMethod = typeof(ArrayPool<char>).GetMethod(nameof(ArrayPool<char>.Shared.Return))!;
137/// <param name="methodInfo">The <see cref="MethodInfo"/> for the route handler to be passed to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>.</param>
140public static RequestDelegateMetadataResult InferMetadata(MethodInfo methodInfo, RequestDelegateFactoryOptions? options = null)
169/// The result returned from <see cref="InferMetadata(MethodInfo, RequestDelegateFactoryOptions?)"/> if that was used to inferring metadata before creating the final RequestDelegate.
171/// <see cref="InferMetadata(MethodInfo, RequestDelegateFactoryOptions?)"/> would have inferred for the same <see cref="Delegate.Method"/> and populate <see cref="RequestDelegateFactoryOptions.EndpointBuilder"/>
209public static RequestDelegateResult Create(MethodInfo methodInfo, Func<HttpContext, object>? targetFactory, RequestDelegateFactoryOptions? options)
221/// The result returned from <see cref="InferMetadata(MethodInfo, RequestDelegateFactoryOptions?)"/> if that was used to inferring metadata before creating the final RequestDelegate.
223/// <see cref="InferMetadata(MethodInfo, RequestDelegateFactoryOptions?)"/> would have inferred for the same <see cref="Delegate.Method"/> and populate <see cref="RequestDelegateFactoryOptions.EndpointBuilder"/>
228public static RequestDelegateResult Create(MethodInfo methodInfo, Func<HttpContext, object>? targetFactory = null, RequestDelegateFactoryOptions? options = null, RequestDelegateMetadataResult? metadataResult = null)
314MethodInfo methodInfo,
389private static Expression[] CreateArgumentsAndInferMetadata(MethodInfo methodInfo, RequestDelegateFactoryContext factoryContext)
413private static EndpointFilterDelegate? CreateFilterPipeline(MethodInfo methodInfo, Expression? targetExpression, RequestDelegateFactoryContext factoryContext, Expression<Func<HttpContext, object?>>? targetFactory)
926private static Expression CreateMethodCall(MethodInfo methodInfo, Expression? target, Expression[] arguments) =>
2377private static MethodInfo GetMethodInfo<T>(Expression<T> expr)
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (14)
17private static readonly MethodInfo INotifyCompletion_OnCompleted = typeof(INotifyCompletion).GetMethod(nameof(INotifyCompletion.OnCompleted), Everything, new[] { typeof(Action) })!;
18private static readonly MethodInfo ICriticalNotifyCompletion_UnsafeOnCompleted = typeof(ICriticalNotifyCompletion).GetMethod(nameof(ICriticalNotifyCompletion.UnsafeOnCompleted), Everything, new[] { typeof(Action) })!;
22public MethodInfo AwaiterGetResultMethod { get; }
23public MethodInfo AwaiterOnCompletedMethod { get; }
24public MethodInfo? AwaiterUnsafeOnCompletedMethod { get; }
26public MethodInfo GetAwaiterMethod { get; }
31MethodInfo awaiterGetResultMethod,
32MethodInfo awaiterOnCompletedMethod,
33MethodInfo? awaiterUnsafeOnCompletedMethod,
35MethodInfo getAwaiterMethod)
54var getAwaiterMethod = type.GetMethod("GetAwaiter", Everything, Type.EmptyTypes);
81var onCompletedMethod = INotifyCompletion_OnCompleted;
85MethodInfo? unsafeOnCompletedMethod = null;
93var getResultMethod = awaiterType.GetMethod("GetResult", Everything, Type.EmptyTypes);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (35)
30private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo)
42private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo, object?[]? parameterDefaultValues)
63private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo, bool isTrimAotCompatible)
90public MethodInfo MethodInfo { get; }
105public static ObjectMethodExecutor Create(MethodInfo methodInfo, TypeInfo targetTypeInfo)
112public static ObjectMethodExecutor Create(MethodInfo methodInfo, TypeInfo targetTypeInfo, object?[] parameterDefaultValues)
123/// The difference between this method and <see cref="Create(MethodInfo, TypeInfo)"/> is that
127public static ObjectMethodExecutor CreateTrimAotCompatible(MethodInfo methodInfo, TypeInfo targetTypeInfo)
197private static MethodExecutor GetExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo)
247MethodInfo methodInfo,
386private static readonly MethodInfo _taskGetAwaiterMethodInfo = typeof(Task<>).GetMethod("GetAwaiter")!;
387private static readonly MethodInfo _taskAwaiterGetIsCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("get_IsCompleted")!;
388private static readonly MethodInfo _taskAwaiterGetResultMethodInfo = typeof(TaskAwaiter<>).GetMethod("GetResult")!;
389private static readonly MethodInfo _taskAwaiterOnCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("OnCompleted")!;
390private static readonly MethodInfo _taskAwaiterUnsafeOnCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("UnsafeOnCompleted")!;
392private static readonly MethodInfo _valueTaskGetAwaiterMethodInfo = typeof(ValueTask<>).GetMethod("GetAwaiter")!;
393private static readonly MethodInfo _valueTaskAwaiterGetIsCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("get_IsCompleted")!;
394private static readonly MethodInfo _valueTaskAwaiterGetResultMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("GetResult")!;
395private static readonly MethodInfo _valueTaskAwaiterOnCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("OnCompleted")!;
396private static readonly MethodInfo _valueTaskAwaiterUnsafeOnCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("UnsafeOnCompleted")!;
423var taskGetAwaiterMethodInfo = (MethodInfo)methodReturnType.GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo);
424var taskAwaiterGetResultMethodInfo = (MethodInfo)taskGetAwaiterMethodInfo.ReturnType.GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo);
437private static MethodExecutorAsync? GetExecutorAsyncTrimAotCompatible(MethodInfo methodInfo, Type asyncResultType)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()),
496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
500((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
504((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()),
515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
519((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
523((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
src\Shared\ParameterBindingMethodCache.cs (28)
24private static readonly MethodInfo ConvertValueTaskMethod = typeof(ParameterBindingMethodCache).GetMethod(nameof(ConvertValueTask), BindingFlags.NonPublic | BindingFlags.Static)!;
25private static readonly MethodInfo ConvertValueTaskOfNullableResultMethod = typeof(ParameterBindingMethodCache).GetMethod(nameof(ConvertValueTaskOfNullableResult), BindingFlags.NonPublic | BindingFlags.Static)!;
26private static readonly MethodInfo BindAsyncMethod = typeof(ParameterBindingMethodCache).GetMethod(nameof(BindAsync), BindingFlags.NonPublic | BindingFlags.Static)!;
27private static readonly MethodInfo UriTryCreateMethod = typeof(Uri).GetMethod(nameof(Uri.TryCreate), BindingFlags.Public | BindingFlags.Static, new[] { typeof(string), typeof(UriKind), typeof(Uri).MakeByRefType() })!;
42private readonly MethodInfo _enumTryParseMethod;
87MethodInfo? methodInfo;
89if (TryGetExplicitIParsableTryParseMethod(type, out var explicitIParsableTryParseMethod))
190if (_throwOnInvalidMethod && GetAnyMethodFromHierarchy(type, "TryParse") is MethodInfo invalidMethod)
205static bool ValidateReturnType(MethodInfo methodInfo)
221var methodInfo = GetIBindableFromHttpContextMethod(nonNullableParameterType);
284if (_throwOnInvalidMethod && GetAnyMethodFromHierarchy(nonNullableParameterType, "BindAsync") is MethodInfo invalidBindMethod)
306static bool ValidateReturnType(MethodInfo methodInfo)
410private static MethodInfo? GetIBindableFromHttpContextMethod(Type type)
431private static bool TryGetExplicitIParsableTryParseMethod(Type type, out MethodInfo methodInfo)
442private MethodInfo? GetStaticMethodFromHierarchy(Type type, string name, Type[] parameterTypes, Func<MethodInfo, bool> validateReturnType)
444bool IsMatch(MethodInfo? method) => method is not null && !method.IsAbstract && validateReturnType(method);
446var methodInfo = type.GetMethod(name, BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy, parameterTypes);
453var candidateInterfaceMethodInfo = default(MethodInfo);
458var interfaceMethod = implementedInterface.GetMethod(name, BindingFlags.Public | BindingFlags.Static, parameterTypes);
480private static MethodInfo? GetAnyMethodFromHierarchy(Type type, string name)
483var methodInfo = type.GetMethods(BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance | BindingFlags.FlattenHierarchy)
493var interfaceMethod = implementedInterface.GetMethod(name, BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);
504private static MethodInfo GetEnumTryParseMethod(bool preferNonGenericEnumParseOverload)
506MethodInfo? methodInfo = null;
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)
Microsoft.AspNetCore.Http.Extensions.Tests (37)
RequestDelegateFactoryTests.cs (18)
133var methodInfo = typeof(RequestDelegateFactoryTests).GetMethod(
166var methodInfo = typeof(TestNonStaticActionClass).GetMethod(
203var methodInfo = typeof(RequestDelegateFactoryTests).GetMethod(
269var methodInfo = typeof(HttpHandler).GetMethod(nameof(HttpHandler.Handle));
2153var methodInfo = typeof(RequestDelegateFactoryTests).GetMethod(
2190var methodInfo = typeof(RequestDelegateFactoryTests).GetMethod(
3342public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
3358public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
3377public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
3387public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
3397public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
3408public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
3435public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
3453public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
3478public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
3503public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
3526public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
3534public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
RequestDelegateGenerator\SharedTypes.cs (11)
40public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
564public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
599public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
612public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
619public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
629public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
660public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
683public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
925public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
945public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
958public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
Microsoft.AspNetCore.Http.Microbenchmarks (11)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (11)
40public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
564public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
599public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
612public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
619public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
629public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
660public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
683public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
925public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
945public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
958public static void PopulateMetadata(MethodInfo method, EndpointBuilder builder)
Microsoft.AspNetCore.Http.Results (32)
Microsoft.AspNetCore.Http.Results.Tests (37)
Microsoft.AspNetCore.InternalTesting (18)
Microsoft.AspNetCore.InternalTesting.Tests (3)
Microsoft.AspNetCore.Mvc.Abstractions (28)
src\Shared\ParameterBindingMethodCache.cs (28)
24private static readonly MethodInfo ConvertValueTaskMethod = typeof(ParameterBindingMethodCache).GetMethod(nameof(ConvertValueTask), BindingFlags.NonPublic | BindingFlags.Static)!;
25private static readonly MethodInfo ConvertValueTaskOfNullableResultMethod = typeof(ParameterBindingMethodCache).GetMethod(nameof(ConvertValueTaskOfNullableResult), BindingFlags.NonPublic | BindingFlags.Static)!;
26private static readonly MethodInfo BindAsyncMethod = typeof(ParameterBindingMethodCache).GetMethod(nameof(BindAsync), BindingFlags.NonPublic | BindingFlags.Static)!;
27private static readonly MethodInfo UriTryCreateMethod = typeof(Uri).GetMethod(nameof(Uri.TryCreate), BindingFlags.Public | BindingFlags.Static, new[] { typeof(string), typeof(UriKind), typeof(Uri).MakeByRefType() })!;
42private readonly MethodInfo _enumTryParseMethod;
87MethodInfo? methodInfo;
89if (TryGetExplicitIParsableTryParseMethod(type, out var explicitIParsableTryParseMethod))
190if (_throwOnInvalidMethod && GetAnyMethodFromHierarchy(type, "TryParse") is MethodInfo invalidMethod)
205static bool ValidateReturnType(MethodInfo methodInfo)
221var methodInfo = GetIBindableFromHttpContextMethod(nonNullableParameterType);
284if (_throwOnInvalidMethod && GetAnyMethodFromHierarchy(nonNullableParameterType, "BindAsync") is MethodInfo invalidBindMethod)
306static bool ValidateReturnType(MethodInfo methodInfo)
410private static MethodInfo? GetIBindableFromHttpContextMethod(Type type)
431private static bool TryGetExplicitIParsableTryParseMethod(Type type, out MethodInfo methodInfo)
442private MethodInfo? GetStaticMethodFromHierarchy(Type type, string name, Type[] parameterTypes, Func<MethodInfo, bool> validateReturnType)
444bool IsMatch(MethodInfo? method) => method is not null && !method.IsAbstract && validateReturnType(method);
446var methodInfo = type.GetMethod(name, BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy, parameterTypes);
453var candidateInterfaceMethodInfo = default(MethodInfo);
458var interfaceMethod = implementedInterface.GetMethod(name, BindingFlags.Public | BindingFlags.Static, parameterTypes);
480private static MethodInfo? GetAnyMethodFromHierarchy(Type type, string name)
483var methodInfo = type.GetMethods(BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance | BindingFlags.FlattenHierarchy)
493var interfaceMethod = implementedInterface.GetMethod(name, BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);
504private static MethodInfo GetEnumTryParseMethod(bool preferNonGenericEnumParseOverload)
506MethodInfo? methodInfo = null;
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)
Microsoft.AspNetCore.Mvc.Abstractions.Test (5)
Microsoft.AspNetCore.Mvc.ApiExplorer (4)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (5)
Microsoft.AspNetCore.Mvc.Core (118)
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (14)
17private static readonly MethodInfo INotifyCompletion_OnCompleted = typeof(INotifyCompletion).GetMethod(nameof(INotifyCompletion.OnCompleted), Everything, new[] { typeof(Action) })!;
18private static readonly MethodInfo ICriticalNotifyCompletion_UnsafeOnCompleted = typeof(ICriticalNotifyCompletion).GetMethod(nameof(ICriticalNotifyCompletion.UnsafeOnCompleted), Everything, new[] { typeof(Action) })!;
22public MethodInfo AwaiterGetResultMethod { get; }
23public MethodInfo AwaiterOnCompletedMethod { get; }
24public MethodInfo? AwaiterUnsafeOnCompletedMethod { get; }
26public MethodInfo GetAwaiterMethod { get; }
31MethodInfo awaiterGetResultMethod,
32MethodInfo awaiterOnCompletedMethod,
33MethodInfo? awaiterUnsafeOnCompletedMethod,
35MethodInfo getAwaiterMethod)
54var getAwaiterMethod = type.GetMethod("GetAwaiter", Everything, Type.EmptyTypes);
81var onCompletedMethod = INotifyCompletion_OnCompleted;
85MethodInfo? unsafeOnCompletedMethod = null;
93var getResultMethod = awaiterType.GetMethod("GetResult", Everything, Type.EmptyTypes);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (35)
30private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo)
42private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo, object?[]? parameterDefaultValues)
63private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo, bool isTrimAotCompatible)
90public MethodInfo MethodInfo { get; }
105public static ObjectMethodExecutor Create(MethodInfo methodInfo, TypeInfo targetTypeInfo)
112public static ObjectMethodExecutor Create(MethodInfo methodInfo, TypeInfo targetTypeInfo, object?[] parameterDefaultValues)
123/// The difference between this method and <see cref="Create(MethodInfo, TypeInfo)"/> is that
127public static ObjectMethodExecutor CreateTrimAotCompatible(MethodInfo methodInfo, TypeInfo targetTypeInfo)
197private static MethodExecutor GetExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo)
247MethodInfo methodInfo,
386private static readonly MethodInfo _taskGetAwaiterMethodInfo = typeof(Task<>).GetMethod("GetAwaiter")!;
387private static readonly MethodInfo _taskAwaiterGetIsCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("get_IsCompleted")!;
388private static readonly MethodInfo _taskAwaiterGetResultMethodInfo = typeof(TaskAwaiter<>).GetMethod("GetResult")!;
389private static readonly MethodInfo _taskAwaiterOnCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("OnCompleted")!;
390private static readonly MethodInfo _taskAwaiterUnsafeOnCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("UnsafeOnCompleted")!;
392private static readonly MethodInfo _valueTaskGetAwaiterMethodInfo = typeof(ValueTask<>).GetMethod("GetAwaiter")!;
393private static readonly MethodInfo _valueTaskAwaiterGetIsCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("get_IsCompleted")!;
394private static readonly MethodInfo _valueTaskAwaiterGetResultMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("GetResult")!;
395private static readonly MethodInfo _valueTaskAwaiterOnCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("OnCompleted")!;
396private static readonly MethodInfo _valueTaskAwaiterUnsafeOnCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("UnsafeOnCompleted")!;
423var taskGetAwaiterMethodInfo = (MethodInfo)methodReturnType.GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo);
424var taskAwaiterGetResultMethodInfo = (MethodInfo)taskGetAwaiterMethodInfo.ReturnType.GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo);
437private static MethodExecutorAsync? GetExecutorAsyncTrimAotCompatible(MethodInfo methodInfo, Type asyncResultType)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()),
496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
500((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
504((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()),
515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
519((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
523((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
Microsoft.AspNetCore.Mvc.Core.Test (78)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (7)
Microsoft.AspNetCore.Mvc.FunctionalTests (94)
Microsoft.AspNetCore.Mvc.IntegrationTests (3)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
Microsoft.AspNetCore.Mvc.RazorPages (19)
Microsoft.AspNetCore.Mvc.RazorPages.Test (20)
Microsoft.AspNetCore.Mvc.Test (1)
Microsoft.AspNetCore.Mvc.Testing (5)
Microsoft.AspNetCore.Mvc.ViewFeatures (10)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (15)
Microsoft.AspNetCore.OpenApi (92)
Services\OpenApiGenerator.cs (7)
55/// <param name="methodInfo">The <see cref="MethodInfo"/> associated with the route handler of the endpoint.</param>
60MethodInfo methodInfo,
74private OpenApiOperation GetOperation(string httpMethod, MethodInfo methodInfo, EndpointMetadataCollection metadata, RoutePattern pattern)
100private static OpenApiResponses GetOpenApiResponses(MethodInfo method, EndpointMetadataCollection metadata)
257private OpenApiRequestBody? GetOpenApiRequestBody(MethodInfo methodInfo, EndpointMetadataCollection metadata, RoutePattern pattern, bool disableInferredBody)
327private HashSet<OpenApiTagReference> GetOperationTags(MethodInfo methodInfo, EndpointMetadataCollection metadata)
367private List<IOpenApiParameter> GetOpenApiParameters(MethodInfo methodInfo, RoutePattern pattern, bool disableInferredBody)
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (14)
17private static readonly MethodInfo INotifyCompletion_OnCompleted = typeof(INotifyCompletion).GetMethod(nameof(INotifyCompletion.OnCompleted), Everything, new[] { typeof(Action) })!;
18private static readonly MethodInfo ICriticalNotifyCompletion_UnsafeOnCompleted = typeof(ICriticalNotifyCompletion).GetMethod(nameof(ICriticalNotifyCompletion.UnsafeOnCompleted), Everything, new[] { typeof(Action) })!;
22public MethodInfo AwaiterGetResultMethod { get; }
23public MethodInfo AwaiterOnCompletedMethod { get; }
24public MethodInfo? AwaiterUnsafeOnCompletedMethod { get; }
26public MethodInfo GetAwaiterMethod { get; }
31MethodInfo awaiterGetResultMethod,
32MethodInfo awaiterOnCompletedMethod,
33MethodInfo? awaiterUnsafeOnCompletedMethod,
35MethodInfo getAwaiterMethod)
54var getAwaiterMethod = type.GetMethod("GetAwaiter", Everything, Type.EmptyTypes);
81var onCompletedMethod = INotifyCompletion_OnCompleted;
85MethodInfo? unsafeOnCompletedMethod = null;
93var getResultMethod = awaiterType.GetMethod("GetResult", Everything, Type.EmptyTypes);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (35)
30private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo)
42private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo, object?[]? parameterDefaultValues)
63private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo, bool isTrimAotCompatible)
90public MethodInfo MethodInfo { get; }
105public static ObjectMethodExecutor Create(MethodInfo methodInfo, TypeInfo targetTypeInfo)
112public static ObjectMethodExecutor Create(MethodInfo methodInfo, TypeInfo targetTypeInfo, object?[] parameterDefaultValues)
123/// The difference between this method and <see cref="Create(MethodInfo, TypeInfo)"/> is that
127public static ObjectMethodExecutor CreateTrimAotCompatible(MethodInfo methodInfo, TypeInfo targetTypeInfo)
197private static MethodExecutor GetExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo)
247MethodInfo methodInfo,
386private static readonly MethodInfo _taskGetAwaiterMethodInfo = typeof(Task<>).GetMethod("GetAwaiter")!;
387private static readonly MethodInfo _taskAwaiterGetIsCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("get_IsCompleted")!;
388private static readonly MethodInfo _taskAwaiterGetResultMethodInfo = typeof(TaskAwaiter<>).GetMethod("GetResult")!;
389private static readonly MethodInfo _taskAwaiterOnCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("OnCompleted")!;
390private static readonly MethodInfo _taskAwaiterUnsafeOnCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("UnsafeOnCompleted")!;
392private static readonly MethodInfo _valueTaskGetAwaiterMethodInfo = typeof(ValueTask<>).GetMethod("GetAwaiter")!;
393private static readonly MethodInfo _valueTaskAwaiterGetIsCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("get_IsCompleted")!;
394private static readonly MethodInfo _valueTaskAwaiterGetResultMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("GetResult")!;
395private static readonly MethodInfo _valueTaskAwaiterOnCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("OnCompleted")!;
396private static readonly MethodInfo _valueTaskAwaiterUnsafeOnCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("UnsafeOnCompleted")!;
423var taskGetAwaiterMethodInfo = (MethodInfo)methodReturnType.GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo);
424var taskAwaiterGetResultMethodInfo = (MethodInfo)taskGetAwaiterMethodInfo.ReturnType.GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo);
437private static MethodExecutorAsync? GetExecutorAsyncTrimAotCompatible(MethodInfo methodInfo, Type asyncResultType)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()),
496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
500((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
504((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()),
515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
519((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
523((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
src\Shared\ParameterBindingMethodCache.cs (28)
24private static readonly MethodInfo ConvertValueTaskMethod = typeof(ParameterBindingMethodCache).GetMethod(nameof(ConvertValueTask), BindingFlags.NonPublic | BindingFlags.Static)!;
25private static readonly MethodInfo ConvertValueTaskOfNullableResultMethod = typeof(ParameterBindingMethodCache).GetMethod(nameof(ConvertValueTaskOfNullableResult), BindingFlags.NonPublic | BindingFlags.Static)!;
26private static readonly MethodInfo BindAsyncMethod = typeof(ParameterBindingMethodCache).GetMethod(nameof(BindAsync), BindingFlags.NonPublic | BindingFlags.Static)!;
27private static readonly MethodInfo UriTryCreateMethod = typeof(Uri).GetMethod(nameof(Uri.TryCreate), BindingFlags.Public | BindingFlags.Static, new[] { typeof(string), typeof(UriKind), typeof(Uri).MakeByRefType() })!;
42private readonly MethodInfo _enumTryParseMethod;
87MethodInfo? methodInfo;
89if (TryGetExplicitIParsableTryParseMethod(type, out var explicitIParsableTryParseMethod))
190if (_throwOnInvalidMethod && GetAnyMethodFromHierarchy(type, "TryParse") is MethodInfo invalidMethod)
205static bool ValidateReturnType(MethodInfo methodInfo)
221var methodInfo = GetIBindableFromHttpContextMethod(nonNullableParameterType);
284if (_throwOnInvalidMethod && GetAnyMethodFromHierarchy(nonNullableParameterType, "BindAsync") is MethodInfo invalidBindMethod)
306static bool ValidateReturnType(MethodInfo methodInfo)
410private static MethodInfo? GetIBindableFromHttpContextMethod(Type type)
431private static bool TryGetExplicitIParsableTryParseMethod(Type type, out MethodInfo methodInfo)
442private MethodInfo? GetStaticMethodFromHierarchy(Type type, string name, Type[] parameterTypes, Func<MethodInfo, bool> validateReturnType)
444bool IsMatch(MethodInfo? method) => method is not null && !method.IsAbstract && validateReturnType(method);
446var methodInfo = type.GetMethod(name, BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy, parameterTypes);
453var candidateInterfaceMethodInfo = default(MethodInfo);
458var interfaceMethod = implementedInterface.GetMethod(name, BindingFlags.Public | BindingFlags.Static, parameterTypes);
480private static MethodInfo? GetAnyMethodFromHierarchy(Type type, string name)
483var methodInfo = type.GetMethods(BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance | BindingFlags.FlattenHierarchy)
493var interfaceMethod = implementedInterface.GetMethod(name, BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);
504private static MethodInfo GetEnumTryParseMethod(bool preferNonGenericEnumParseOverload)
506MethodInfo? methodInfo = null;
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)
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (5)
Microsoft.AspNetCore.OpenApi.Tests (1)
Microsoft.AspNetCore.Routing (27)
Microsoft.AspNetCore.Routing.Abstractions (13)
Microsoft.AspNetCore.Routing.Tests (3)
Microsoft.AspNetCore.Server.IIS (1)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
Microsoft.AspNetCore.Shared.Tests (69)
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (14)
17private static readonly MethodInfo INotifyCompletion_OnCompleted = typeof(INotifyCompletion).GetMethod(nameof(INotifyCompletion.OnCompleted), Everything, new[] { typeof(Action) })!;
18private static readonly MethodInfo ICriticalNotifyCompletion_UnsafeOnCompleted = typeof(ICriticalNotifyCompletion).GetMethod(nameof(ICriticalNotifyCompletion.UnsafeOnCompleted), Everything, new[] { typeof(Action) })!;
22public MethodInfo AwaiterGetResultMethod { get; }
23public MethodInfo AwaiterOnCompletedMethod { get; }
24public MethodInfo? AwaiterUnsafeOnCompletedMethod { get; }
26public MethodInfo GetAwaiterMethod { get; }
31MethodInfo awaiterGetResultMethod,
32MethodInfo awaiterOnCompletedMethod,
33MethodInfo? awaiterUnsafeOnCompletedMethod,
35MethodInfo getAwaiterMethod)
54var getAwaiterMethod = type.GetMethod("GetAwaiter", Everything, Type.EmptyTypes);
81var onCompletedMethod = INotifyCompletion_OnCompleted;
85MethodInfo? unsafeOnCompletedMethod = null;
93var getResultMethod = awaiterType.GetMethod("GetResult", Everything, Type.EmptyTypes);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (35)
30private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo)
42private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo, object?[]? parameterDefaultValues)
63private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo, bool isTrimAotCompatible)
90public MethodInfo MethodInfo { get; }
105public static ObjectMethodExecutor Create(MethodInfo methodInfo, TypeInfo targetTypeInfo)
112public static ObjectMethodExecutor Create(MethodInfo methodInfo, TypeInfo targetTypeInfo, object?[] parameterDefaultValues)
123/// The difference between this method and <see cref="Create(MethodInfo, TypeInfo)"/> is that
127public static ObjectMethodExecutor CreateTrimAotCompatible(MethodInfo methodInfo, TypeInfo targetTypeInfo)
197private static MethodExecutor GetExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo)
247MethodInfo methodInfo,
386private static readonly MethodInfo _taskGetAwaiterMethodInfo = typeof(Task<>).GetMethod("GetAwaiter")!;
387private static readonly MethodInfo _taskAwaiterGetIsCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("get_IsCompleted")!;
388private static readonly MethodInfo _taskAwaiterGetResultMethodInfo = typeof(TaskAwaiter<>).GetMethod("GetResult")!;
389private static readonly MethodInfo _taskAwaiterOnCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("OnCompleted")!;
390private static readonly MethodInfo _taskAwaiterUnsafeOnCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("UnsafeOnCompleted")!;
392private static readonly MethodInfo _valueTaskGetAwaiterMethodInfo = typeof(ValueTask<>).GetMethod("GetAwaiter")!;
393private static readonly MethodInfo _valueTaskAwaiterGetIsCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("get_IsCompleted")!;
394private static readonly MethodInfo _valueTaskAwaiterGetResultMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("GetResult")!;
395private static readonly MethodInfo _valueTaskAwaiterOnCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("OnCompleted")!;
396private static readonly MethodInfo _valueTaskAwaiterUnsafeOnCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("UnsafeOnCompleted")!;
423var taskGetAwaiterMethodInfo = (MethodInfo)methodReturnType.GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo);
424var taskAwaiterGetResultMethodInfo = (MethodInfo)taskGetAwaiterMethodInfo.ReturnType.GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo);
437private static MethodExecutorAsync? GetExecutorAsyncTrimAotCompatible(MethodInfo methodInfo, Type asyncResultType)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()),
496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
500((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
504((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()),
515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
519((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
523((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
Microsoft.AspNetCore.SignalR.Client.Core (18)
Microsoft.AspNetCore.SignalR.Core (93)
src\Shared\ObjectMethodExecutor\AwaitableInfo.cs (14)
17private static readonly MethodInfo INotifyCompletion_OnCompleted = typeof(INotifyCompletion).GetMethod(nameof(INotifyCompletion.OnCompleted), Everything, new[] { typeof(Action) })!;
18private static readonly MethodInfo ICriticalNotifyCompletion_UnsafeOnCompleted = typeof(ICriticalNotifyCompletion).GetMethod(nameof(ICriticalNotifyCompletion.UnsafeOnCompleted), Everything, new[] { typeof(Action) })!;
22public MethodInfo AwaiterGetResultMethod { get; }
23public MethodInfo AwaiterOnCompletedMethod { get; }
24public MethodInfo? AwaiterUnsafeOnCompletedMethod { get; }
26public MethodInfo GetAwaiterMethod { get; }
31MethodInfo awaiterGetResultMethod,
32MethodInfo awaiterOnCompletedMethod,
33MethodInfo? awaiterUnsafeOnCompletedMethod,
35MethodInfo getAwaiterMethod)
54var getAwaiterMethod = type.GetMethod("GetAwaiter", Everything, Type.EmptyTypes);
81var onCompletedMethod = INotifyCompletion_OnCompleted;
85MethodInfo? unsafeOnCompletedMethod = null;
93var getResultMethod = awaiterType.GetMethod("GetResult", Everything, Type.EmptyTypes);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (35)
30private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo)
42private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo, object?[]? parameterDefaultValues)
63private ObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo, bool isTrimAotCompatible)
90public MethodInfo MethodInfo { get; }
105public static ObjectMethodExecutor Create(MethodInfo methodInfo, TypeInfo targetTypeInfo)
112public static ObjectMethodExecutor Create(MethodInfo methodInfo, TypeInfo targetTypeInfo, object?[] parameterDefaultValues)
123/// The difference between this method and <see cref="Create(MethodInfo, TypeInfo)"/> is that
127public static ObjectMethodExecutor CreateTrimAotCompatible(MethodInfo methodInfo, TypeInfo targetTypeInfo)
197private static MethodExecutor GetExecutor(MethodInfo methodInfo, TypeInfo targetTypeInfo)
247MethodInfo methodInfo,
386private static readonly MethodInfo _taskGetAwaiterMethodInfo = typeof(Task<>).GetMethod("GetAwaiter")!;
387private static readonly MethodInfo _taskAwaiterGetIsCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("get_IsCompleted")!;
388private static readonly MethodInfo _taskAwaiterGetResultMethodInfo = typeof(TaskAwaiter<>).GetMethod("GetResult")!;
389private static readonly MethodInfo _taskAwaiterOnCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("OnCompleted")!;
390private static readonly MethodInfo _taskAwaiterUnsafeOnCompletedMethodInfo = typeof(TaskAwaiter<>).GetMethod("UnsafeOnCompleted")!;
392private static readonly MethodInfo _valueTaskGetAwaiterMethodInfo = typeof(ValueTask<>).GetMethod("GetAwaiter")!;
393private static readonly MethodInfo _valueTaskAwaiterGetIsCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("get_IsCompleted")!;
394private static readonly MethodInfo _valueTaskAwaiterGetResultMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("GetResult")!;
395private static readonly MethodInfo _valueTaskAwaiterOnCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("OnCompleted")!;
396private static readonly MethodInfo _valueTaskAwaiterUnsafeOnCompletedMethodInfo = typeof(ValueTaskAwaiter<>).GetMethod("UnsafeOnCompleted")!;
423var taskGetAwaiterMethodInfo = (MethodInfo)methodReturnType.GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo);
424var taskAwaiterGetResultMethodInfo = (MethodInfo)taskGetAwaiterMethodInfo.ReturnType.GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo);
437private static MethodExecutorAsync? GetExecutorAsyncTrimAotCompatible(MethodInfo methodInfo, Type asyncResultType)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()),
496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
500((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
504((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()),
515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
519((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
523((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterUnsafeOnCompletedMethodInfo)).Invoke(awaiter, [continuation]);
Microsoft.AspNetCore.SignalR.Tests (1)
Microsoft.AspNetCore.TestHost (5)
Microsoft.Build (11)
Microsoft.Build.Tasks.CodeAnalysis (3)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (2)
Microsoft.Build.Tasks.UnitTests (2)
Microsoft.CodeAnalysis (12)
Microsoft.CodeAnalysis.Analyzers (5)
Microsoft.CodeAnalysis.AnalyzerUtilities (5)
Microsoft.CodeAnalysis.BannedApiAnalyzers (5)
Microsoft.CodeAnalysis.CodeStyle (4)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (41)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Microsoft.CodeAnalysis.EditorFeatures (4)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (5)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (5)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (13)
Microsoft.CodeAnalysis.ExternalAccess.Extensions (4)
Microsoft.CodeAnalysis.Features (6)
Microsoft.CodeAnalysis.InteractiveHost (1)
Microsoft.CodeAnalysis.LanguageServer (4)
Microsoft.CodeAnalysis.LanguageServer.Protocol (21)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (8)
57private static readonly MethodInfo s_processQueueCoreAsync = typeof(RequestExecutionQueue<TRequestContext>)
76private readonly FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata Metadata, IMethodHandler Handler, MethodInfo MethodInfo)>>> _handlerInfoMap;
94private static FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>> BuildHandlerMap(AbstractHandlerProvider handlerProvider, AbstractTypeRefResolver typeRefResolver)
96var genericMethodMap = new Dictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>>();
103var languages = new Dictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>();
115var method = s_processQueueCoreAsync.MakeGenericMethod(requestType, responseType);
310MethodInfo methodInfo,
413private (RequestHandlerMetadata Metadata, IMethodHandler Handler, MethodInfo MethodInfo) GetHandlerForRequest(IQueueItem<TRequestContext> work, string language)
Microsoft.CodeAnalysis.PublicApiAnalyzers (6)
Microsoft.CodeAnalysis.ResxSourceGenerator (5)
Microsoft.CodeAnalysis.Scripting (11)
Microsoft.CodeAnalysis.Scripting.TestUtilities (1)
Microsoft.CodeAnalysis.Test.Utilities (8)
Microsoft.CodeAnalysis.UnitTests (18)
Microsoft.CodeAnalysis.Workspaces (4)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (7)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Microsoft.CodeAnalysis.XunitHook (1)
Microsoft.CommonLanguageServerProtocol.Framework.Package (19)
RequestExecutionQueue.cs (8)
57private static readonly MethodInfo s_processQueueCoreAsync = typeof(RequestExecutionQueue<TRequestContext>)
76private readonly FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata Metadata, IMethodHandler Handler, MethodInfo MethodInfo)>>> _handlerInfoMap;
94private static FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>> BuildHandlerMap(AbstractHandlerProvider handlerProvider, AbstractTypeRefResolver typeRefResolver)
96var genericMethodMap = new Dictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>>();
103var languages = new Dictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>();
115var method = s_processQueueCoreAsync.MakeGenericMethod(requestType, responseType);
310MethodInfo methodInfo,
413private (RequestHandlerMetadata Metadata, IMethodHandler Handler, MethodInfo MethodInfo) GetHandlerForRequest(IQueueItem<TRequestContext> work, string language)
Microsoft.CSharp (33)
Microsoft.DotNet.RemoteExecutor (3)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (16)
Microsoft.DotNet.XUnitExtensions (3)
Microsoft.DotNet.XUnitV3Extensions (2)
Microsoft.Extensions.AI (25)
Functions\AIFunctionFactory.cs (22)
231/// Creates an <see cref="AIFunction"/> instance for a method, specified via an <see cref="MethodInfo"/> instance
326public static AIFunction Create(MethodInfo method, object? target, AIFunctionFactoryOptions? options)
334/// Creates an <see cref="AIFunction"/> instance for a method, specified via an <see cref="MethodInfo"/> instance
426public static AIFunction Create(MethodInfo method, object? target, string? name = null, string? description = null, JsonSerializerOptions? serializerOptions = null)
443/// Creates an <see cref="AIFunction"/> instance for a method, specified via an <see cref="MethodInfo"/> for
553MethodInfo method,
565public static ReflectionAIFunction Build(MethodInfo method, object? target, AIFunctionFactoryOptions options)
591MethodInfo method,
640public override MethodInfo UnderlyingMethod => FunctionDescriptor.Method;
705public static ReflectionAIFunctionDescriptor GetOrCreate(MethodInfo method, AIFunctionFactoryOptions options)
816public MethodInfo Method { get; }
823private static string GetFunctionName(MethodInfo method)
838static bool IsAsyncMethod(MethodInfo method)
1076MethodInfo taskResultGetter = GetMethodFromGenericMethodDefinition(returnType, _taskGetResult);
1099MethodInfo valueTaskAsTask = GetMethodFromGenericMethodDefinition(returnType, _valueTaskAsTask);
1100MethodInfo asTaskResultGetter = GetMethodFromGenericMethodDefinition(valueTaskAsTask.ReturnType, _taskGetResult);
1152private static readonly MethodInfo _taskGetResult = typeof(Task<>).GetProperty(nameof(Task<int>.Result), BindingFlags.Instance | BindingFlags.Public)!.GetMethod!;
1153private static readonly MethodInfo _valueTaskAsTask = typeof(ValueTask<>).GetMethod(nameof(ValueTask<int>.AsTask), BindingFlags.Instance | BindingFlags.Public)!;
1155private static MethodInfo GetMethodFromGenericMethodDefinition(Type specializedType, MethodInfo genericMethodDefinition)
1159return (MethodInfo)specializedType.GetMemberWithSameMetadataDefinitionAs(genericMethodDefinition);
1167MethodInfo Method,
Microsoft.Extensions.AI.Abstractions (10)
Microsoft.Extensions.Configuration.Binder (5)
Microsoft.Extensions.DependencyInjection (16)
Microsoft.Extensions.DependencyInjection.Abstractions (1)
Microsoft.Extensions.Hosting.Testing.Tests (1)
Microsoft.JSInterop (14)
Infrastructure\DotNetDispatcher.cs (14)
29private static readonly ConcurrentDictionary<AssemblyKey, IReadOnlyDictionary<string, (MethodInfo, Type[])>> _cachedMethodsByAssembly = new();
31private static readonly ConcurrentDictionary<Type, IReadOnlyDictionary<string, (MethodInfo, Type[])>> _cachedMethodsByType = new();
35private static readonly MethodInfo _taskConverterMethodInfo = typeof(DotNetDispatcher).GetMethod(nameof(CreateValueTaskConverter), BindingFlags.NonPublic | BindingFlags.Static)!;
162MethodInfo methodInfo;
351private static (MethodInfo, Type[]) GetCachedMethodInfo(AssemblyKey assemblyKey, string methodIdentifier)
373var converterDelegate = _cachedConvertToTaskByType.GetOrAdd(type, (Type t, MethodInfo taskConverterMethodInfo) =>
381private static (MethodInfo methodInfo, Type[] parameterTypes) GetCachedMethodInfo(IDotNetObjectReference objectReference, string methodIdentifier)
399static Dictionary<string, (MethodInfo, Type[])> ScanTypeForCallableMethods([DynamicallyAccessedMembers(JSInvokable)] Type type)
401var result = new Dictionary<string, (MethodInfo, Type[])>(StringComparer.Ordinal);
403foreach (var method in type.GetMethods(BindingFlags.Instance | BindingFlags.Public))
434private static Dictionary<string, (MethodInfo, Type[])> ScanAssemblyForCallableMethods(AssemblyKey assemblyKey)
438var result = new Dictionary<string, (MethodInfo, Type[])>(StringComparer.Ordinal);
442foreach (var method in type.GetMethods(BindingFlags.Public | BindingFlags.Static))
470private static Type[] GetParameterTypes(MethodInfo method)
Microsoft.Maui (17)
Microsoft.Maui.Controls (17)
MessagingCenter.cs (4)
66 class Subscription : Tuple<WeakReference, MaybeWeakReference, MethodInfo, Filter>
68 public Subscription(object subscriber, object delegateSource, MethodInfo methodInfo, Filter filter)
75 MethodInfo MethodInfo => Item3;
226 void InnerSubscribe(object subscriber, string message, Type senderType, Type argType, object target, MethodInfo methodInfo, Filter filter)
TypeConversionHelper.cs (7)
84 MethodInfo? opImplicit = GetImplicitConversionOperator(valueType, fromType: valueType, toType: targetType)
99 static MethodInfo? GetImplicitConversionOperator(Type onType, Type fromType, Type toType)
108 var method = onType.GetMethod("op_Implicit", bindingAttr, null, new[] { fromType }, null);
123 foreach (var method in onType.GetMethods(bindingAttr))
136 static bool IsImplicitOperator(MethodInfo method)
148 static bool HasSuitableParameterType(MethodInfo method, Type fromType)
153 static bool HasSuitableReturnType(MethodInfo method, Type toType)
Microsoft.Maui.Controls.Build.Tasks (3)
Microsoft.Maui.Controls.Compatibility (2)
Microsoft.Maui.Controls.Xaml (14)
Microsoft.ML.AutoML (2)
Microsoft.ML.AutoML.SourceGenerator (5)
Microsoft.ML.CodeGenerator (12)
Microsoft.ML.Core (148)
ComponentModel\ComponentCatalog.cs (16)
19internal static AccessModifier Accessmodifier(this MethodInfo methodInfo)
167public MethodInfo InstanceGetter { get; }
181public MethodInfo CreateMethod { get; }
200internal LoadableClassInfo(LoadableClassAttributeBase attr, MethodInfo getter, ConstructorInfo ctor, MethodInfo create, bool requireEnvironment)
333public readonly MethodInfo Method;
340internal EntryPointInfo(MethodInfo method,
459out MethodInfo getter, out ConstructorInfo ctor, out MethodInfo create, out bool requireEnvironment)
567foreach (var methodInfo in type.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))
642private static MethodInfo FindInstanceGetter(Type instType, Type loaderType)
650var meth = prop.GetGetMethod(false);
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);
693MethodInfo getter = null;
695MethodInfo create = null;
Utilities\FuncInstanceMethodInfo1`3.cs (9)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T, TResult}"/>,
37private FuncInstanceMethodInfo1(MethodInfo methodInfo)
45/// Creates a <see cref="FuncInstanceMethodInfo1{TTarget, T, TResult}"/> representing the <see cref="MethodInfo"/>
55/// <returns>A <see cref="FuncInstanceMethodInfo1{TTarget, T, TResult}"/> representing the <see cref="MethodInfo"/>
65Contracts.CheckParam(methodCallExpression.Method.DeclaringType == typeof(MethodInfo), nameof(expression), "Unexpected expression form");
66Contracts.CheckParam(methodCallExpression.Method.Name == nameof(MethodInfo.CreateDelegate), nameof(expression), "Unexpected expression form");
81Contracts.CheckParam(((ConstantExpression)methodCallExpression.Object).Type == typeof(MethodInfo), nameof(expression), "Unexpected expression form");
83var methodInfo = (MethodInfo)((ConstantExpression)methodCallExpression.Object).Value;
Utilities\FuncInstanceMethodInfo1`4.cs (9)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>,
38private FuncInstanceMethodInfo1(MethodInfo methodInfo)
46/// Creates a <see cref="FuncInstanceMethodInfo1{TTarget, T1, T2, TResult}"/> representing the <see cref="MethodInfo"/>
56/// <returns>A <see cref="FuncInstanceMethodInfo1{TTarget, T1, T2, TResult}"/> representing the <see cref="MethodInfo"/>
66Contracts.CheckParam(methodCallExpression.Method.DeclaringType == typeof(MethodInfo), nameof(expression), "Unexpected expression form");
67Contracts.CheckParam(methodCallExpression.Method.Name == nameof(MethodInfo.CreateDelegate), nameof(expression), "Unexpected expression form");
82Contracts.CheckParam(((ConstantExpression)methodCallExpression.Object).Type == typeof(MethodInfo), nameof(expression), "Unexpected expression form");
84var methodInfo = (MethodInfo)((ConstantExpression)methodCallExpression.Object).Value;
Utilities\FuncInstanceMethodInfo2`4.cs (9)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>,
38private FuncInstanceMethodInfo2(MethodInfo methodInfo)
46/// Creates a <see cref="FuncInstanceMethodInfo1{TTarget, T1, T2, TResult}"/> representing the <see cref="MethodInfo"/>
56/// <returns>A <see cref="FuncInstanceMethodInfo1{TTarget, T1, T2, TResult}"/> representing the <see cref="MethodInfo"/>
66Contracts.CheckParam(methodCallExpression.Method.DeclaringType == typeof(MethodInfo), nameof(expression), "Unexpected expression form");
67Contracts.CheckParam(methodCallExpression.Method.Name == nameof(MethodInfo.CreateDelegate), nameof(expression), "Unexpected expression form");
82Contracts.CheckParam(((ConstantExpression)methodCallExpression.Object).Type == typeof(MethodInfo), nameof(expression), "Unexpected expression form");
84var methodInfo = (MethodInfo)((ConstantExpression)methodCallExpression.Object).Value;
Utilities\FuncInstanceMethodInfo3`3.cs (9)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T, TResult}"/>,
37private FuncInstanceMethodInfo3(MethodInfo methodInfo)
45/// Creates a <see cref="FuncInstanceMethodInfo1{TTarget, T, TResult}"/> representing the <see cref="MethodInfo"/>
55/// <returns>A <see cref="FuncInstanceMethodInfo1{TTarget, T, TResult}"/> representing the <see cref="MethodInfo"/>
65Contracts.CheckParam(methodCallExpression.Method.DeclaringType == typeof(MethodInfo), nameof(expression), "Unexpected expression form");
66Contracts.CheckParam(methodCallExpression.Method.Name == nameof(MethodInfo.CreateDelegate), nameof(expression), "Unexpected expression form");
81Contracts.CheckParam(((ConstantExpression)methodCallExpression.Object).Type == typeof(MethodInfo), nameof(expression), "Unexpected expression form");
83var methodInfo = (MethodInfo)((ConstantExpression)methodCallExpression.Object).Value;
Utilities\FuncInstanceMethodInfo3`4.cs (9)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>,
38private FuncInstanceMethodInfo3(MethodInfo methodInfo)
46/// Creates a <see cref="FuncInstanceMethodInfo1{TTarget, T1, T2, TResult}"/> representing the <see cref="MethodInfo"/>
56/// <returns>A <see cref="FuncInstanceMethodInfo1{TTarget, T1, T2, TResult}"/> representing the <see cref="MethodInfo"/>
66Contracts.CheckParam(methodCallExpression.Method.DeclaringType == typeof(MethodInfo), nameof(expression), "Unexpected expression form");
67Contracts.CheckParam(methodCallExpression.Method.Name == nameof(MethodInfo.CreateDelegate), nameof(expression), "Unexpected expression form");
82Contracts.CheckParam(((ConstantExpression)methodCallExpression.Object).Type == typeof(MethodInfo), nameof(expression), "Unexpected expression form");
84var methodInfo = (MethodInfo)((ConstantExpression)methodCallExpression.Object).Value;
Utilities\FuncMethodInfo3`2.cs (5)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T, TResult}"/>,
27private ImmutableDictionary<(Type, Type, Type), MethodInfo> _instanceMethodInfo;
29private protected FuncMethodInfo3(MethodInfo methodInfo)
32_instanceMethodInfo = ImmutableDictionary<(Type, Type, Type), MethodInfo>.Empty;
38public MethodInfo MakeGenericMethod(Type typeArg1, Type typeArg2, Type typeArg3)
Utilities\FuncMethodInfo3`3.cs (5)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>,
28private ImmutableDictionary<(Type, Type, Type), MethodInfo> _instanceMethodInfo;
30private protected FuncMethodInfo3(MethodInfo methodInfo)
33_instanceMethodInfo = ImmutableDictionary<(Type, Type, Type), MethodInfo>.Empty;
39public MethodInfo MakeGenericMethod(Type typeArg1, Type typeArg2, Type typeArg3)
Utilities\Utils.cs (29)
961private static MethodInfo MarshalInvokeCheckAndCreate<TRet>(Type genArg, Delegate func)
963var meth = MarshalActionInvokeCheckAndCreate(genArg, func);
994var meth = func.MakeGenericMethod(genArg);
1003var meth = func.MakeGenericMethod(genArg);
1013var meth = func.MakeGenericMethod(genArg);
1022var meth = func.MakeGenericMethod(genArg);
1032var meth = func.MakeGenericMethod(genArg1, genArg2, genArg3);
1041var meth = func.MakeGenericMethod(genArg1, genArg2, genArg3);
1051var meth = func.MakeGenericMethod(genArg);
1060var meth = func.MakeGenericMethod(genArg);
1070var meth = func.MakeGenericMethod(genArg1, genArg2);
1079var meth = func.MakeGenericMethod(genArg1, genArg2);
1089var meth = func.MakeGenericMethod(genArg1, genArg2, genArg3);
1098var meth = func.MakeGenericMethod(genArg1, genArg2, genArg3);
1108var meth = MarshalInvokeCheckAndCreate<TRet>(genArg, func);
1118var meth = MarshalInvokeCheckAndCreate<TRet>(genArg, func);
1128var meth = MarshalInvokeCheckAndCreate<TRet>(genArg, func);
1138var meth = MarshalInvokeCheckAndCreate<TRet>(genArg, func);
1148var meth = MarshalInvokeCheckAndCreate<TRet>(genArg, func);
1158var meth = MarshalInvokeCheckAndCreate<TRet>(genArg, func);
1169var meth = MarshalInvokeCheckAndCreate<TRet>(genArg, func);
1180var meth = MarshalInvokeCheckAndCreate<TRet>(genArg, func);
1184private static MethodInfo MarshalActionInvokeCheckAndCreate(Type genArg, Delegate func)
1188var meth = func.GetMethodInfo();
1206var meth = MarshalActionInvokeCheckAndCreate(genArg, act);
1215var meth = MarshalActionInvokeCheckAndCreate(genArg, act);
1224var meth = MarshalActionInvokeCheckAndCreate(genArg, act);
1233var meth = MarshalActionInvokeCheckAndCreate(genArg, act);
1242var meth = MarshalActionInvokeCheckAndCreate(genArg, act);
Microsoft.ML.Data (24)
Microsoft.ML.DataView (7)
Microsoft.ML.OnnxTransformer (8)
Microsoft.ML.Parquet (2)
Microsoft.ML.Predictor.Tests (1)
Microsoft.ML.Samples (1)
Microsoft.ML.Samples.GPU (1)
Microsoft.ML.TestFrameworkCommon (1)
Microsoft.ML.Tests (6)
Microsoft.ML.Transforms (33)
Microsoft.VisualBasic.Core (38)
Microsoft.VisualStudio.LanguageServices (6)
MSBuild (4)
MSBuildTaskHost (7)
mscorlib (1)
netstandard (1)
PresentationBuildTasks (34)
PresentationCore (6)
PresentationFramework (85)
PresentationFramework-SystemCore (1)
Roslyn.Diagnostics.Analyzers (5)
Shared (8)
Sockets.BindTests (1)
Sockets.FunctionalTests (1)
System.ComponentModel.Annotations (5)
System.ComponentModel.Composition (52)
System.ComponentModel.TypeConverter (29)
System.Composition.Convention (13)
System.Composition.Hosting (13)
System.Composition.TypedParts (5)
System.Configuration.ConfigurationManager (2)
System.Data.Common (4)
System.Linq.Expressions (499)
System\Dynamic\DynamicObject.cs (7)
515private DynamicMetaObject CallMethodWithResult<TBinder>(MethodInfo method, TBinder binder, Expression[] args, Fallback<TBinder> fallback)
525private DynamicMetaObject CallMethodWithResult<TBinder>(MethodInfo method, TBinder binder, Expression[] args, Fallback<TBinder> fallback, Fallback<TBinder>? fallbackInvoke)
555private DynamicMetaObject BuildCallMethodWithResult<TBinder>(MethodInfo method, TBinder binder, Expression[] args, DynamicMetaObject fallbackResult, Fallback<TBinder>? fallbackInvoke)
684private DynamicMetaObject CallMethodReturnLast<TBinder>(MethodInfo method, TBinder binder, Expression[] args, Expression value, Fallback<TBinder> fallback)
753private DynamicMetaObject CallMethodNoResult<TBinder>(MethodInfo method, TBinder binder, Expression[] args, Fallback<TBinder> fallback)
814private bool IsOverridden(MethodInfo method)
818foreach (MethodInfo mi in methods)
System\Linq\Expressions\BinaryExpression.cs (128)
74public MethodInfo? Method => GetMethod();
76internal virtual MethodInfo? GetMethod() => null;
292MethodInfo? method = GetMethod();
313internal static BinaryExpression Create(ExpressionType nodeType, Expression left, Expression right, Type type, MethodInfo? method, LambdaExpression? conversion)
338MethodInfo? method = GetMethod();
356MethodInfo? method = GetMethod();
400MethodInfo? opTrueFalse = TypeUtils.GetBooleanOperator(Method!.DeclaringType!, opName);
535internal OpAssignMethodConversionBinaryExpression(ExpressionType nodeType, Expression left, Expression right, Type type, MethodInfo method, LambdaExpression conversion)
564private readonly MethodInfo _method;
566internal MethodBinaryExpression(ExpressionType nodeType, Expression left, Expression right, Type type, MethodInfo method)
572internal override MethodInfo GetMethod() => _method;
605MethodInfo? method = GetUserDefinedBinaryOperator(binaryType, left.Type, right.Type, name);
631private static BinaryExpression GetMethodBasedBinaryOperator(ExpressionType binaryType, Expression left, Expression right, MethodInfo method, bool liftToNull)
662private static BinaryExpression GetMethodBasedAssignOperator(ExpressionType binaryType, Expression left, Expression right, MethodInfo method, LambdaExpression? conversion, bool liftToNull)
717private static MethodInfo? GetUserDefinedBinaryOperator(ExpressionType binaryType, Type leftType, Type rightType, string name)
724MethodInfo? method = nnLeftType.GetAnyStaticMethodValidated(name, types);
737private static bool IsLiftingConditionalLogicalOperator(Type left, Type right, MethodInfo? method, ExpressionType binaryType)
761private static void ValidateOperator(MethodInfo method)
771private static void ValidateMethodInfo(MethodInfo method, string paramName)
799private static void ValidateUserDefinedConditionalLogicOperator(ExpressionType nodeType, Type left, Type right, MethodInfo method)
832MethodInfo? opTrue = TypeUtils.GetBooleanOperator(declaringType, "op_True");
833MethodInfo? opFalse = TypeUtils.GetBooleanOperator(declaringType, "op_False");
843private static void VerifyOpTrueFalse(ExpressionType nodeType, Type left, MethodInfo opTrue, string paramName)
884public static BinaryExpression MakeBinary(ExpressionType binaryType, Expression left, Expression right, bool liftToNull, MethodInfo? method)
900public static BinaryExpression MakeBinary(ExpressionType binaryType, Expression left, Expression right, bool liftToNull, MethodInfo? method, LambdaExpression? conversion) =>
964/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
969public static BinaryExpression Equal(Expression left, Expression right, bool liftToNull, MethodInfo? method)
1017/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1021public static BinaryExpression NotEqual(Expression left, Expression right, bool liftToNull, MethodInfo? method)
1109/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1114public static BinaryExpression GreaterThan(Expression left, Expression right, bool liftToNull, MethodInfo? method)
1143/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1148public static BinaryExpression LessThan(Expression left, Expression right, bool liftToNull, MethodInfo? method)
1176/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1181public static BinaryExpression GreaterThanOrEqual(Expression left, Expression right, bool liftToNull, MethodInfo? method)
1209/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1214public static BinaryExpression LessThanOrEqual(Expression left, Expression right, bool liftToNull, MethodInfo? method)
1262/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1266public static BinaryExpression AndAlso(Expression left, Expression right, MethodInfo? method)
1315/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1319public static BinaryExpression OrElse(Expression left, Expression right, MethodInfo? method)
1394MethodInfo method = delegateType.GetInvokeMethod();
1469/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1473public static BinaryExpression Add(Expression left, Expression right, MethodInfo? method)
1505/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1509public static BinaryExpression AddAssign(Expression left, Expression right, MethodInfo? method)
1519/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1525public static BinaryExpression AddAssign(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
1546private static void ValidateOpAssignConversionLambda(LambdaExpression conversion, Expression left, MethodInfo method, ExpressionType nodeType)
1550MethodInfo mi = delegateType.GetInvokeMethod();
1588/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1592public static BinaryExpression AddAssignChecked(Expression left, Expression right, MethodInfo? method)
1602/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1608public static BinaryExpression AddAssignChecked(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
1647/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1651public static BinaryExpression AddChecked(Expression left, Expression right, MethodInfo? method)
1683/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1687public static BinaryExpression Subtract(Expression left, Expression right, MethodInfo? method)
1719/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1723public static BinaryExpression SubtractAssign(Expression left, Expression right, MethodInfo? method)
1733/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1739public static BinaryExpression SubtractAssign(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
1777/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1781public static BinaryExpression SubtractAssignChecked(Expression left, Expression right, MethodInfo? method)
1791/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1797public static BinaryExpression SubtractAssignChecked(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
1835/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1839public static BinaryExpression SubtractChecked(Expression left, Expression right, MethodInfo? method)
1871/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1875public static BinaryExpression Divide(Expression left, Expression right, MethodInfo? method)
1907/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1911public static BinaryExpression DivideAssign(Expression left, Expression right, MethodInfo? method)
1921/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1927public static BinaryExpression DivideAssign(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
1965/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
1969public static BinaryExpression Modulo(Expression left, Expression right, MethodInfo? method)
2001/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2005public static BinaryExpression ModuloAssign(Expression left, Expression right, MethodInfo? method)
2015/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2021public static BinaryExpression ModuloAssign(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
2059/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2063public static BinaryExpression Multiply(Expression left, Expression right, MethodInfo? method)
2095/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2099public static BinaryExpression MultiplyAssign(Expression left, Expression right, MethodInfo? method)
2109/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2115public static BinaryExpression MultiplyAssign(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
2153/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2157public static BinaryExpression MultiplyAssignChecked(Expression left, Expression right, MethodInfo? method)
2167/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2173public static BinaryExpression MultiplyAssignChecked(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
2211/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2215public static BinaryExpression MultiplyChecked(Expression left, Expression right, MethodInfo? method)
2263/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2267public static BinaryExpression LeftShift(Expression left, Expression right, MethodInfo? method)
2300/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2304public static BinaryExpression LeftShiftAssign(Expression left, Expression right, MethodInfo? method)
2314/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2320public static BinaryExpression LeftShiftAssign(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
2359/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2363public static BinaryExpression RightShift(Expression left, Expression right, MethodInfo? method)
2396/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2400public static BinaryExpression RightShiftAssign(Expression left, Expression right, MethodInfo? method)
2410/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2416public static BinaryExpression RightShiftAssign(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
2455/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2459public static BinaryExpression And(Expression left, Expression right, MethodInfo? method)
2491/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2495public static BinaryExpression AndAssign(Expression left, Expression right, MethodInfo? method)
2505/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2511public static BinaryExpression AndAssign(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
2549/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2553public static BinaryExpression Or(Expression left, Expression right, MethodInfo? method)
2585/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2589public static BinaryExpression OrAssign(Expression left, Expression right, MethodInfo? method)
2599/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2605public static BinaryExpression OrAssign(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
2643/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2647public static BinaryExpression ExclusiveOr(Expression left, Expression right, MethodInfo? method)
2679/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2683public static BinaryExpression ExclusiveOrAssign(Expression left, Expression right, MethodInfo? method)
2693/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2699public static BinaryExpression ExclusiveOrAssign(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
2737/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2741public static BinaryExpression Power(Expression left, Expression right, MethodInfo? method)
2795/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2799public static BinaryExpression PowerAssign(Expression left, Expression right, MethodInfo? method)
2809/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="BinaryExpression.Method"/> property equal to.</param>
2815public static BinaryExpression PowerAssign(Expression left, Expression right, MethodInfo? method, LambdaExpression? conversion)
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (10)
298MethodInfo method = node.Indexer.GetGetMethod(nonPublic: true)!;
326MethodInfo method = node.Indexer.GetSetMethod(nonPublic: true)!;
365private void EmitMethodCall(Expression obj, MethodInfo method, IArgumentProvider methodCallExpr)
370private void EmitMethodCall(Expression? obj, MethodInfo method, IArgumentProvider methodCallExpr, CompilationFlags flags)
392private void EmitMethodCall(MethodInfo mi, IArgumentProvider args, Type? objectType)
398private void EmitMethodCall(MethodInfo mi, IArgumentProvider args, Type? objectType, CompilationFlags flags)
439private static bool MethodHasByRefParameter(MethodInfo mi)
451private void EmitCall(Type? objectType, MethodInfo method)
466private static bool UseVirtual(MethodInfo mi)
596MethodInfo invoke = node.DelegateType.GetInvokeMethod();
System\Linq\Expressions\Interpreter\CallInstruction.cs (12)
26private static readonly CacheDict<MethodInfo, CallInstruction> s_cache = new CacheDict<MethodInfo, CallInstruction>(256);
28public static CallInstruction Create(MethodInfo info)
36public static CallInstruction Create(MethodInfo info, ParameterInfo[] parameters)
119private static CallInstruction GetArrayAccessor(MethodInfo info, int argumentCount)
123MethodInfo? alternativeMethod = null;
173private static Type? TryGetParameterOrReturnType(MethodInfo target, ParameterInfo[] pi, int index)
200private static bool IndexIsNotReturnType(int index, MethodInfo target, ParameterInfo[] pi)
210private static CallInstruction SlowCreate(MethodInfo info, ParameterInfo[] pis)
283protected readonly MethodInfo _target;
288internal MethodInfoCallInstruction(MethodInfo target, int argumentCount)
381internal ByRefMethodInfoCallInstruction(MethodInfo target, int argumentCount, ByRefUpdater[] byrefArgs)
System\Linq\Expressions\ListInitExpression.cs (5)
133MethodInfo? addMethod = FindMethod(newExpression.Type, "Add", null, new Expression[] { initializerlist[0] }, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
141/// <param name="addMethod">A <see cref="MethodInfo"/> that represents an instance method named "Add" (case insensitive), that adds an element to a collection.</param>
146public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo? addMethod, params Expression[] initializers)
155/// <param name="addMethod">A <see cref="MethodInfo"/> that represents an instance method named "Add" (case insensitive), that adds an element to a collection.</param>
160public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo? addMethod, IEnumerable<Expression> initializers)
System\Linq\Expressions\MethodCallExpression.cs (56)
19internal MethodCallExpression(MethodInfo method)
39/// Gets the <see cref="MethodInfo"/> for the method to be called.
41public MethodInfo Method { get; }
156public InstanceMethodCallExpression(MethodInfo method, Expression instance)
171public MethodCallExpressionN(MethodInfo method, IReadOnlyList<Expression> args)
202public InstanceMethodCallExpressionN(MethodInfo method, Expression instance, IReadOnlyList<Expression> args)
231public MethodCallExpression0(MethodInfo method)
264public MethodCallExpression1(MethodInfo method, Expression arg0)
317public MethodCallExpression2(MethodInfo method, Expression arg0, Expression arg1)
382public MethodCallExpression3(MethodInfo method, Expression arg0, Expression arg1, Expression arg2)
453public MethodCallExpression4(MethodInfo method, Expression arg0, Expression arg1, Expression arg2, Expression arg3)
530public MethodCallExpression5(MethodInfo method, Expression arg0, Expression arg1, Expression arg2, Expression arg3, Expression arg4)
611public InstanceMethodCallExpression0(MethodInfo method, Expression instance)
644public InstanceMethodCallExpression1(MethodInfo method, Expression instance, Expression arg0)
698public InstanceMethodCallExpression2(MethodInfo method, Expression instance, Expression arg0, Expression arg1)
763public InstanceMethodCallExpression3(MethodInfo method, Expression instance, Expression arg0, Expression arg1, Expression arg2)
837/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="MethodCallExpression.Method"/> property equal to.</param>
840internal static MethodCallExpression Call(MethodInfo method)
855/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="MethodCallExpression.Method"/> property equal to.</param>
859public static MethodCallExpression Call(MethodInfo method, Expression arg0)
875/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="MethodCallExpression.Method"/> property equal to.</param>
880public static MethodCallExpression Call(MethodInfo method, Expression arg0, Expression arg1)
898/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="MethodCallExpression.Method"/> property equal to.</param>
904public static MethodCallExpression Call(MethodInfo method, Expression arg0, Expression arg1, Expression arg2)
924/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="MethodCallExpression.Method"/> property equal to.</param>
931public static MethodCallExpression Call(MethodInfo method, Expression arg0, Expression arg1, Expression arg2, Expression arg3)
953/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="MethodCallExpression.Method"/> property equal to.</param>
962public static MethodCallExpression Call(MethodInfo method, Expression arg0, Expression arg1, Expression arg2, Expression arg3, Expression arg4)
987/// <param name="method">The <see cref="MethodInfo"/> that represents the target method.</param>
990public static MethodCallExpression Call(MethodInfo method, params Expression[]? arguments)
998/// <param name="method">The <see cref="MethodInfo"/> that represents the target method.</param>
1001public static MethodCallExpression Call(MethodInfo method, IEnumerable<Expression>? arguments)
1010/// <param name="method">The <see cref="MethodInfo"/> that represents the target method.</param>
1012public static MethodCallExpression Call(Expression? instance, MethodInfo method)
1032/// <param name="method">The <see cref="MethodInfo"/> that represents the target method.</param>
1035public static MethodCallExpression Call(Expression? instance, MethodInfo method, params Expression[]? arguments)
1044/// <param name="method">The <see cref="MethodInfo"/> that represents the target method.</param>
1047internal static MethodCallExpression Call(Expression? instance, MethodInfo method, Expression arg0)
1072/// <param name="method">The <see cref="MethodInfo"/> that represents the target method.</param>
1076public static MethodCallExpression Call(Expression? instance, MethodInfo method, Expression arg0, Expression arg1)
1101/// <param name="method">The <see cref="MethodInfo"/> that represents the target method.</param>
1106public static MethodCallExpression Call(Expression? instance, MethodInfo method, Expression arg0, Expression arg1, Expression arg2)
1129/// <returns>A <see cref="MethodCallExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.Call"/>, the <see cref="MethodCallExpression.Object"/> property equal to <paramref name="instance"/>, <see cref="MethodCallExpression.Method"/> set to the <see cref="MethodInfo"/> that represents the specified instance method, and <see cref="MethodCallExpression.Arguments"/> set to the specified arguments.</returns>
1153/// <returns>A <see cref="MethodCallExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.Call"/>, the <see cref="MethodCallExpression.Method"/> property set to the <see cref="MethodInfo"/> that represents the specified static (Shared in Visual Basic) method, and the <see cref="MethodCallExpression.Arguments"/> property set to the specified arguments.</returns>
1183/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="MethodCallExpression.Method"/> property equal to.</param>
1189public static MethodCallExpression Call(Expression? instance, MethodInfo method, IEnumerable<Expression>? arguments)
1239private static ParameterInfo[] ValidateMethodAndGetParameters(Expression? instance, MethodInfo method)
1247private static void ValidateStaticOrInstanceMethod(Expression? instance, MethodInfo method)
1261private static void ValidateCallInstanceType(Type instanceType, MethodInfo method)
1297private static MethodInfo? FindMethod(
1305MethodInfo? method = null;
1307foreach (MethodInfo mi in type.GetMethods(flags))
1311MethodInfo? moo = ApplyTypeArgs(mi, typeArgs);
1373private static MethodInfo? ApplyTypeArgs(MethodInfo m, Type[]? typeArgs)
1437MethodInfo mi = TypeUtils.GetArrayGetMethod(array.Type);
System\Linq\Expressions\SwitchExpression.cs (6)
18internal SwitchExpression(Type type, Expression switchValue, Expression? defaultBody, MethodInfo? comparison, ReadOnlyCollection<SwitchCase> cases)
58public MethodInfo? Comparison { get; }
136public static SwitchExpression Switch(Expression switchValue, Expression? defaultBody, MethodInfo? comparison, params SwitchCase[]? cases)
150public static SwitchExpression Switch(Type? type, Expression switchValue, Expression? defaultBody, MethodInfo? comparison, params SwitchCase[]? cases)
163public static SwitchExpression Switch(Expression switchValue, Expression? defaultBody, MethodInfo? comparison, IEnumerable<SwitchCase>? cases)
177public static SwitchExpression Switch(Type? type, Expression switchValue, Expression? defaultBody, MethodInfo? comparison, IEnumerable<SwitchCase>? cases)
System\Linq\Expressions\UnaryExpression.cs (40)
18internal UnaryExpression(ExpressionType nodeType, Expression expression, Type type, MethodInfo? method)
47/// <returns>The <see cref="MethodInfo"/> that represents the implementing method.</returns>
48public MethodInfo? Method { get; }
314/// <param name="method">The <see cref="MethodInfo"/> that represents the implementing method.</param>
318public static UnaryExpression MakeUnary(ExpressionType unaryType, Expression operand, Type type, MethodInfo? method) =>
362MethodInfo? method = nnOperandType.GetAnyStaticMethodValidated(name, types);
380private static UnaryExpression GetMethodBasedUnaryOperator(ExpressionType unaryType, Expression operand, MethodInfo method)
415MethodInfo? method = TypeUtils.GetUserDefinedCoercionMethod(expression.Type, convertToType);
426private static UnaryExpression GetMethodBasedCoercionOperator(ExpressionType unaryType, Expression operand, Type convertToType, MethodInfo method)
466/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="UnaryExpression.Method"/> property equal to.</param>
471public static UnaryExpression Negate(Expression expression, MethodInfo? method)
501/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="UnaryExpression.Method"/> property equal to.</param>
506public static UnaryExpression UnaryPlus(Expression expression, MethodInfo? method)
533/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="UnaryExpression.Method"/> property equal to.</param>
540public static UnaryExpression NegateChecked(Expression expression, MethodInfo? method)
568/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="UnaryExpression.Method"/> property equal to.</param>
575public static UnaryExpression Not(Expression expression, MethodInfo? method)
608/// <param name="method">A <see cref="MethodInfo"/> that represents the implementing method.</param>
610public static UnaryExpression IsFalse(Expression expression, MethodInfo? method)
638/// <param name="method">A <see cref="MethodInfo"/> that represents the implementing method.</param>
640public static UnaryExpression IsTrue(Expression expression, MethodInfo? method)
668/// <param name="method">A <see cref="MethodInfo"/> that represents the implementing method.</param>
670public static UnaryExpression OnesComplement(Expression expression, MethodInfo? method)
738/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="UnaryExpression.Method"/> property equal to.</param>
745public static UnaryExpression Convert(Expression expression, Type type, MethodInfo? method)
778/// <param name="method">A <see cref="MethodInfo"/> to set the <see cref="UnaryExpression.Method"/> property equal to.</param>
785public static UnaryExpression ConvertChecked(Expression expression, Type type, MethodInfo? method)
906/// <param name="method">A <see cref="MethodInfo"/> that represents the implementing method.</param>
908public static UnaryExpression Increment(Expression expression, MethodInfo? method)
936/// <param name="method">A <see cref="MethodInfo"/> that represents the implementing method.</param>
938public static UnaryExpression Decrement(Expression expression, MethodInfo? method)
968/// <param name="method">A <see cref="MethodInfo"/> that represents the implementing method.</param>
970public static UnaryExpression PreIncrementAssign(Expression expression, MethodInfo? method)
991/// <param name="method">A <see cref="MethodInfo"/> that represents the implementing method.</param>
993public static UnaryExpression PreDecrementAssign(Expression expression, MethodInfo? method)
1014/// <param name="method">A <see cref="MethodInfo"/> that represents the implementing method.</param>
1016public static UnaryExpression PostIncrementAssign(Expression expression, MethodInfo? method)
1037/// <param name="method">A <see cref="MethodInfo"/> that represents the implementing method.</param>
1039public static UnaryExpression PostDecrementAssign(Expression expression, MethodInfo? method)
1044private static UnaryExpression MakeOpAssignUnary(ExpressionType kind, Expression expression, MethodInfo? method)
System.Linq.Queryable (17)
System\Linq\EnumerableRewriter.cs (17)
36MethodInfo mInfo = m.Method;
48MethodInfo seqMethod = FindEnumerableMethodForQueryable(mInfo.Name, args, typeArgs);
55MethodInfo method = FindMethod(mInfo.DeclaringType!, mInfo.Name, args, typeArgs);
63private static ReadOnlyCollection<Expression> FixupQuotedArgs(MethodInfo mi, ReadOnlyCollection<Expression> argList)
217private static ILookup<string, MethodInfo>? s_seqMethods;
218private static MethodInfo FindEnumerableMethodForQueryable(string name, ReadOnlyCollection<Expression> args, params Type[]? typeArgs)
222MethodInfo[] matchingMethods = s_seqMethods[name]
236static MethodInfo[] GetEnumerableStaticMethods(Type type) =>
239MethodInfo ApplyTypeArgs(MethodInfo methodInfo) => typeArgs == null ? methodInfo : methodInfo.MakeGenericMethod(typeArgs);
245static MethodInfo DisambiguateMatches(MethodInfo[] matchingMethods)
297private static MethodInfo FindMethod(Type type, string name, ReadOnlyCollection<Expression> args, Type[]? typeArgs)
299using (IEnumerator<MethodInfo> en = type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).Where(m => m.Name == name).GetEnumerator())
305MethodInfo mi = en.Current;
313private static bool ArgsMatch(MethodInfo m, ReadOnlyCollection<Expression> args, Type[]? typeArgs)
335static ParameterInfo[] GetConstrutedGenericParameters(MethodInfo method, Type[] genericTypes) =>
System.Net.HttpListener (1)
System.Net.Security (3)
System.Private.CoreLib (295)
src\libraries\System.Private.CoreLib\src\System\Reflection\Module.cs (6)
39public MethodInfo? GetMethod(string name)
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; }
65public MethodInfo[] GetMethods() => GetMethods(DefaultLookup);
67public virtual MethodInfo[] GetMethods(BindingFlags bindingFlags) { throw NotImplemented.ByDesign; }
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureType.cs (3)
127public sealed override MethodInfo[] GetMethods(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);
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (12)
561MethodInfo[]? finalists = null;
562MethodInfo? finalist = null;
567MethodInfo[] semiFinalists = GetMethods(this, name, bindingFlags)!;
571static MethodInfo[]? GetMethods(RuntimeType thisType, string name, BindingFlags bindingFlags)
572=> thisType.GetMember(name, MemberTypes.Method, bindingFlags) as MethodInfo[];
574List<MethodInfo>? results = null;
578MethodInfo semiFinalist = semiFinalists[i];
590results ??= new List<MethodInfo>(semiFinalists.Length) { finalist };
615List<MethodInfo>? results = null;
619MethodInfo? semiFinalist = null;
642results ??= new List<MethodInfo>(semiFinalists.Length) { finalist };
676object? result = ((MethodInfo)invokeMethod).Invoke(target, bindingFlags, binder, providedArgs, culture);
src\libraries\System.Private.CoreLib\src\System\Type.cs (16)
295public MethodInfo? GetMethod(string name) => GetMethod(name, DefaultLookup);
298public MethodInfo? GetMethod(string name, BindingFlags bindingAttr)
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);
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();
393public MethodInfo[] GetMethods() => GetMethods(DefaultLookup);
396public abstract MethodInfo[] GetMethods(BindingFlags bindingAttr);
src\System\RuntimeType.CoreCLR.cs (21)
1310MethodInfo? associateMethod = propertyInfo.GetGetMethod() ?? propertyInfo.GetSetMethod();
1635internal MethodInfo GetGenericMethodInfo(RuntimeMethodHandleInternal genericMethod)
2207MethodInfo? methodInfo = memberInfo as MethodInfo;
2498private ListBuilder<MethodInfo> GetMethodCandidates(
2506ListBuilder<MethodInfo> candidates = new ListBuilder<MethodInfo>(cache.Length);
2637public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
2682ListBuilder<MethodInfo> methods = GetMethodCandidates(null, GenericParameterCountAny, bindingAttr, CallingConventions.Any, null, false);
2736im.InterfaceMethods = new MethodInfo[ifaceVirtualMethodCount];
2737im.TargetMethods = new MethodInfo[ifaceVirtualMethodCount];
2746im.InterfaceMethods[i] = (MethodInfo)ifaceMethodBase;
2778protected override MethodInfo? GetMethodImpl(
2786protected override MethodInfo? GetMethodImpl(
2793private MethodInfo? GetMethodImplCommon(
2797ListBuilder<MethodInfo> candidates = GetMethodCandidates(name, genericParameterCount, bindingAttr, callConv, types, false);
2804MethodInfo firstCandidate = candidates[0];
2814MethodInfo methodInfo = candidates[j];
2820return System.DefaultBinder.FindMostDerivedNewSlotMeth(candidates.ToArray(), candidates.Count) as MethodInfo;
2825return binder.SelectMethod(bindingAttr, candidates.ToArray(), types, modifiers) as MethodInfo;
3032ListBuilder<MethodInfo> methods = default;
System.Private.DataContractSerialization (320)
System\Runtime\Serialization\CodeGenerator.cs (31)
17private static MethodInfo? s_getTypeFromHandle;
18private static MethodInfo GetTypeFromHandle
31private static MethodInfo? s_objectEquals;
32private static MethodInfo ObjectEquals
45private static MethodInfo? s_arraySetValue;
46private static MethodInfo ArraySetValue
59private static MethodInfo? s_objectToString;
60private static MethodInfo ObjectToString
73private static MethodInfo? s_stringFormat;
74private static MethodInfo StringFormat
89internal static MethodInfo GetInvokeMethod(Type delegateType)
123MethodInfo signature = GetInvokeMethod(delegateType);
167internal MethodInfo CurrentMethod
283LocalBuilder enumerator, MethodInfo getCurrentMethod)
297internal void EndForEach(MethodInfo moveNextMethod)
416internal static void VerifyParameterCount(MethodInfo methodInfo, int expectedCount)
422internal void Call(object? thisObj, MethodInfo methodInfo)
429internal void Call(object? thisObj, MethodInfo methodInfo, object? param1)
437internal void Call(object? thisObj, MethodInfo methodInfo, object? param1, object? param2)
446internal void Call(object? thisObj, MethodInfo methodInfo, object? param1, object? param2, object? param3)
456internal void Call(object? thisObj, MethodInfo methodInfo, object? param1, object? param2, object? param3, object? param4)
467internal void Call(object? thisObj, MethodInfo methodInfo, object? param1, object? param2, object? param3, object? param4, object? param5)
479internal void Call(object? thisObj, MethodInfo methodInfo, object? param1, object? param2, object? param3, object? param4, object? param5, object? param6)
492internal void Call(MethodInfo methodInfo)
589MethodInfo? getMethod = property.GetMethod;
594else if (memberInfo is MethodInfo method)
620MethodInfo? setMethod = property.SetMethod;
625else if (memberInfo is MethodInfo method)
1104private void LoadThis(object? thisObj, MethodInfo methodInfo)
1113private void LoadParam(object? arg, int oneBasedArgIndex, MethodInfo methodInfo)
1248private static readonly MethodInfo s_stringLength = typeof(string).GetProperty("Length")!.GetMethod!;
System\Runtime\Serialization\CollectionDataContract.cs (34)
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)
246internal MethodInfo? GetEnumeratorMethod => _helper.GetEnumeratorMethod;
248internal MethodInfo? AddMethod => _helper.AddMethod;
407private readonly MethodInfo? _getEnumeratorMethod;
408private readonly MethodInfo? _addMethod;
544CollectionKind kind, Type itemType, MethodInfo getEnumeratorMethod, string? serializationExceptionMessage, string? deserializationExceptionMessage)
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)
686internal MethodInfo? GetEnumeratorMethod => _getEnumeratorMethod;
688internal MethodInfo? AddMethod => _addMethod;
766MethodInfo? buildIncrementCollectionCountDelegate = GetBuildIncrementCollectionCountGenericDelegate(ItemType);
772MethodInfo? buildIncrementCollectionCountDelegate = GetBuildIncrementCollectionCountGenericDelegate(typeof(KeyValuePair<,>).MakeGenericType(ItemType.GetGenericArguments()));
787static MethodInfo GetBuildIncrementCollectionCountGenericDelegate(Type type) => BuildIncrementCollectionCountDelegateMethod.MakeGenericMethod(type);
793private static MethodInfo GetBuildIncrementCollectionCountGenericDelegate(Type type) => BuildIncrementCollectionCountDelegateMethod.MakeGenericMethod(type);
795private static MethodInfo? s_buildIncrementCollectionCountDelegateMethod;
797private static MethodInfo BuildIncrementCollectionCountDelegateMethod =>
821MethodInfo buildCreateGenericDictionaryEnumerator = GetBuildCreateGenericDictionaryEnumeratorGenericMethod(keyValueTypes);
836static MethodInfo GetBuildCreateGenericDictionaryEnumeratorGenericMethod(Type[] keyValueTypes) => GetBuildCreateGenericDictionaryEnumeratorMethodInfo.MakeGenericMethod(keyValueTypes[0], keyValueTypes[1]);
861MethodInfo? getCurrentMethod = enumeratorType.GetMethod(Globals.GetCurrentMethodName, BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes);
894private static MethodInfo? s_buildCreateGenericDictionaryEnumerator;
896private static MethodInfo GetBuildCreateGenericDictionaryEnumeratorMethodInfo =>
987internal static MethodInfo? GetTargetMethodWithName(string name,
1020MethodInfo? addMethod, getEnumeratorMethod;
1290ref MethodInfo? addMethod, ref MethodInfo? getEnumeratorMethod)
1310Type[] addMethodTypeArray, bool addMethodOnInterface, out MethodInfo? getEnumeratorMethod, out MethodInfo? addMethod)
1360private static MethodInfo? GetIEnumerableGetEnumeratorMethod(
System.Private.Windows.Core (12)
System.Private.Windows.Core.TestUtilities (6)
System.Private.Xml (626)
System\Xml\Xsl\IlGen\GenerateHelper.cs (265)
31public readonly MethodInfo? AggAvg;
32public readonly MethodInfo? AggAvgResult;
33public readonly MethodInfo? AggCreate;
34public readonly MethodInfo? AggIsEmpty;
35public readonly MethodInfo? AggMax;
36public readonly MethodInfo? AggMaxResult;
37public readonly MethodInfo? AggMin;
38public readonly MethodInfo? AggMinResult;
39public readonly MethodInfo? AggSum;
40public readonly MethodInfo? AggSumResult;
45public readonly MethodInfo SeqReuse;
46public readonly MethodInfo SeqReuseSgl;
47public readonly MethodInfo SeqAdd;
48public readonly MethodInfo SeqSortByKeys;
52public readonly MethodInfo IListCount;
53public readonly MethodInfo IListItem;
56public readonly MethodInfo? ValueAs;
59public readonly MethodInfo? ToAtomicValue;
173public static readonly MethodInfo AncCreate = typeof(AncestorIterator).GetMethod("Create")!;
174public static readonly MethodInfo AncNext = typeof(AncestorIterator).GetMethod("MoveNext")!;
175public static readonly MethodInfo AncCurrent = typeof(AncestorIterator).GetMethod("get_Current")!;
176public static readonly MethodInfo AncDOCreate = typeof(AncestorDocOrderIterator).GetMethod("Create")!;
177public static readonly MethodInfo AncDONext = typeof(AncestorDocOrderIterator).GetMethod("MoveNext")!;
178public static readonly MethodInfo AncDOCurrent = typeof(AncestorDocOrderIterator).GetMethod("get_Current")!;
179public static readonly MethodInfo AttrContentCreate = typeof(AttributeContentIterator).GetMethod("Create")!;
180public static readonly MethodInfo AttrContentNext = typeof(AttributeContentIterator).GetMethod("MoveNext")!;
181public static readonly MethodInfo AttrContentCurrent = typeof(AttributeContentIterator).GetMethod("get_Current")!;
182public static readonly MethodInfo AttrCreate = typeof(AttributeIterator).GetMethod("Create")!;
183public static readonly MethodInfo AttrNext = typeof(AttributeIterator).GetMethod("MoveNext")!;
184public static readonly MethodInfo AttrCurrent = typeof(AttributeIterator).GetMethod("get_Current")!;
185public static readonly MethodInfo ContentCreate = typeof(ContentIterator).GetMethod("Create")!;
186public static readonly MethodInfo ContentNext = typeof(ContentIterator).GetMethod("MoveNext")!;
187public static readonly MethodInfo ContentCurrent = typeof(ContentIterator).GetMethod("get_Current")!;
188public static readonly MethodInfo ContentMergeCreate = typeof(ContentMergeIterator).GetMethod("Create")!;
189public static readonly MethodInfo ContentMergeNext = typeof(ContentMergeIterator).GetMethod("MoveNext")!;
190public static readonly MethodInfo ContentMergeCurrent = typeof(ContentMergeIterator).GetMethod("get_Current")!;
191public static readonly MethodInfo DescCreate = typeof(DescendantIterator).GetMethod("Create")!;
192public static readonly MethodInfo DescNext = typeof(DescendantIterator).GetMethod("MoveNext")!;
193public static readonly MethodInfo DescCurrent = typeof(DescendantIterator).GetMethod("get_Current")!;
194public static readonly MethodInfo DescMergeCreate = typeof(DescendantMergeIterator).GetMethod("Create")!;
195public static readonly MethodInfo DescMergeNext = typeof(DescendantMergeIterator).GetMethod("MoveNext")!;
196public static readonly MethodInfo DescMergeCurrent = typeof(DescendantMergeIterator).GetMethod("get_Current")!;
197public static readonly MethodInfo DiffCreate = typeof(DifferenceIterator).GetMethod("Create")!;
198public static readonly MethodInfo DiffNext = typeof(DifferenceIterator).GetMethod("MoveNext")!;
199public static readonly MethodInfo DiffCurrent = typeof(DifferenceIterator).GetMethod("get_Current")!;
200public static readonly MethodInfo DodMergeCreate = typeof(DodSequenceMerge).GetMethod("Create")!;
201public static readonly MethodInfo DodMergeAdd = typeof(DodSequenceMerge).GetMethod("AddSequence")!;
202public static readonly MethodInfo DodMergeSeq = typeof(DodSequenceMerge).GetMethod("MergeSequences")!;
203public static readonly MethodInfo ElemContentCreate = typeof(ElementContentIterator).GetMethod("Create")!;
204public static readonly MethodInfo ElemContentNext = typeof(ElementContentIterator).GetMethod("MoveNext")!;
205public static readonly MethodInfo ElemContentCurrent = typeof(ElementContentIterator).GetMethod("get_Current")!;
206public static readonly MethodInfo FollSibCreate = typeof(FollowingSiblingIterator).GetMethod("Create")!;
207public static readonly MethodInfo FollSibNext = typeof(FollowingSiblingIterator).GetMethod("MoveNext")!;
208public static readonly MethodInfo FollSibCurrent = typeof(FollowingSiblingIterator).GetMethod("get_Current")!;
209public static readonly MethodInfo FollSibMergeCreate = typeof(FollowingSiblingMergeIterator).GetMethod("Create")!;
210public static readonly MethodInfo FollSibMergeNext = typeof(FollowingSiblingMergeIterator).GetMethod("MoveNext")!;
211public static readonly MethodInfo FollSibMergeCurrent = typeof(FollowingSiblingMergeIterator).GetMethod("get_Current")!;
212public static readonly MethodInfo IdCreate = typeof(IdIterator).GetMethod("Create")!;
213public static readonly MethodInfo IdNext = typeof(IdIterator).GetMethod("MoveNext")!;
214public static readonly MethodInfo IdCurrent = typeof(IdIterator).GetMethod("get_Current")!;
215public static readonly MethodInfo InterCreate = typeof(IntersectIterator).GetMethod("Create")!;
216public static readonly MethodInfo InterNext = typeof(IntersectIterator).GetMethod("MoveNext")!;
217public static readonly MethodInfo InterCurrent = typeof(IntersectIterator).GetMethod("get_Current")!;
218public static readonly MethodInfo KindContentCreate = typeof(NodeKindContentIterator).GetMethod("Create")!;
219public static readonly MethodInfo KindContentNext = typeof(NodeKindContentIterator).GetMethod("MoveNext")!;
220public static readonly MethodInfo KindContentCurrent = typeof(NodeKindContentIterator).GetMethod("get_Current")!;
221public static readonly MethodInfo NmspCreate = typeof(NamespaceIterator).GetMethod("Create")!;
222public static readonly MethodInfo NmspNext = typeof(NamespaceIterator).GetMethod("MoveNext")!;
223public static readonly MethodInfo NmspCurrent = typeof(NamespaceIterator).GetMethod("get_Current")!;
224public static readonly MethodInfo NodeRangeCreate = typeof(NodeRangeIterator).GetMethod("Create")!;
225public static readonly MethodInfo NodeRangeNext = typeof(NodeRangeIterator).GetMethod("MoveNext")!;
226public static readonly MethodInfo NodeRangeCurrent = typeof(NodeRangeIterator).GetMethod("get_Current")!;
227public static readonly MethodInfo ParentCreate = typeof(ParentIterator).GetMethod("Create")!;
228public static readonly MethodInfo ParentNext = typeof(ParentIterator).GetMethod("MoveNext")!;
229public static readonly MethodInfo ParentCurrent = typeof(ParentIterator).GetMethod("get_Current")!;
230public static readonly MethodInfo PrecCreate = typeof(PrecedingIterator).GetMethod("Create")!;
231public static readonly MethodInfo PrecNext = typeof(PrecedingIterator).GetMethod("MoveNext")!;
232public static readonly MethodInfo PrecCurrent = typeof(PrecedingIterator).GetMethod("get_Current")!;
233public static readonly MethodInfo PreSibCreate = typeof(PrecedingSiblingIterator).GetMethod("Create")!;
234public static readonly MethodInfo PreSibNext = typeof(PrecedingSiblingIterator).GetMethod("MoveNext")!;
235public static readonly MethodInfo PreSibCurrent = typeof(PrecedingSiblingIterator).GetMethod("get_Current")!;
236public static readonly MethodInfo PreSibDOCreate = typeof(PrecedingSiblingDocOrderIterator).GetMethod("Create")!;
237public static readonly MethodInfo PreSibDONext = typeof(PrecedingSiblingDocOrderIterator).GetMethod("MoveNext")!;
238public static readonly MethodInfo PreSibDOCurrent = typeof(PrecedingSiblingDocOrderIterator).GetMethod("get_Current")!;
239public static readonly MethodInfo SortKeyCreate = typeof(XmlSortKeyAccumulator).GetMethod("Create")!;
240public static readonly MethodInfo SortKeyDateTime = typeof(XmlSortKeyAccumulator).GetMethod("AddDateTimeSortKey")!;
241public static readonly MethodInfo SortKeyDecimal = typeof(XmlSortKeyAccumulator).GetMethod("AddDecimalSortKey")!;
242public static readonly MethodInfo SortKeyDouble = typeof(XmlSortKeyAccumulator).GetMethod("AddDoubleSortKey")!;
243public static readonly MethodInfo SortKeyEmpty = typeof(XmlSortKeyAccumulator).GetMethod("AddEmptySortKey")!;
244public static readonly MethodInfo SortKeyFinish = typeof(XmlSortKeyAccumulator).GetMethod("FinishSortKeys")!;
245public static readonly MethodInfo SortKeyInt = typeof(XmlSortKeyAccumulator).GetMethod("AddIntSortKey")!;
246public static readonly MethodInfo SortKeyInteger = typeof(XmlSortKeyAccumulator).GetMethod("AddIntegerSortKey")!;
247public static readonly MethodInfo SortKeyKeys = typeof(XmlSortKeyAccumulator).GetMethod("get_Keys")!;
248public static readonly MethodInfo SortKeyString = typeof(XmlSortKeyAccumulator).GetMethod("AddStringSortKey")!;
249public static readonly MethodInfo UnionCreate = typeof(UnionIterator).GetMethod("Create")!;
250public static readonly MethodInfo UnionNext = typeof(UnionIterator).GetMethod("MoveNext")!;
251public static readonly MethodInfo UnionCurrent = typeof(UnionIterator).GetMethod("get_Current")!;
252public static readonly MethodInfo XPFollCreate = typeof(XPathFollowingIterator).GetMethod("Create")!;
253public static readonly MethodInfo XPFollNext = typeof(XPathFollowingIterator).GetMethod("MoveNext")!;
254public static readonly MethodInfo XPFollCurrent = typeof(XPathFollowingIterator).GetMethod("get_Current")!;
255public static readonly MethodInfo XPFollMergeCreate = typeof(XPathFollowingMergeIterator).GetMethod("Create")!;
256public static readonly MethodInfo XPFollMergeNext = typeof(XPathFollowingMergeIterator).GetMethod("MoveNext")!;
257public static readonly MethodInfo XPFollMergeCurrent = typeof(XPathFollowingMergeIterator).GetMethod("get_Current")!;
258public static readonly MethodInfo XPPrecCreate = typeof(XPathPrecedingIterator).GetMethod("Create")!;
259public static readonly MethodInfo XPPrecNext = typeof(XPathPrecedingIterator).GetMethod("MoveNext")!;
260public static readonly MethodInfo XPPrecCurrent = typeof(XPathPrecedingIterator).GetMethod("get_Current")!;
261public static readonly MethodInfo XPPrecDOCreate = typeof(XPathPrecedingDocOrderIterator).GetMethod("Create")!;
262public static readonly MethodInfo XPPrecDONext = typeof(XPathPrecedingDocOrderIterator).GetMethod("MoveNext")!;
263public static readonly MethodInfo XPPrecDOCurrent = typeof(XPathPrecedingDocOrderIterator).GetMethod("get_Current")!;
264public static readonly MethodInfo XPPrecMergeCreate = typeof(XPathPrecedingMergeIterator).GetMethod("Create")!;
265public static readonly MethodInfo XPPrecMergeNext = typeof(XPathPrecedingMergeIterator).GetMethod("MoveNext")!;
266public static readonly MethodInfo XPPrecMergeCurrent = typeof(XPathPrecedingMergeIterator).GetMethod("get_Current")!;
269public static readonly MethodInfo AddNewIndex = typeof(XmlQueryRuntime).GetMethod("AddNewIndex")!;
270public static readonly MethodInfo ChangeTypeXsltArg = typeof(XmlQueryRuntime).GetMethod("ChangeTypeXsltArgument", new[] { typeof(int), typeof(object), typeof(Type) })!;
271public static readonly MethodInfo ChangeTypeXsltResult = typeof(XmlQueryRuntime).GetMethod("ChangeTypeXsltResult")!;
272public static readonly MethodInfo CompPos = typeof(XmlQueryRuntime).GetMethod("ComparePosition")!;
273public static readonly MethodInfo Context = typeof(XmlQueryRuntime).GetMethod("get_ExternalContext")!;
274public static readonly MethodInfo CreateCollation = typeof(XmlQueryRuntime).GetMethod("CreateCollation")!;
275public static readonly MethodInfo DocOrder = typeof(XmlQueryRuntime).GetMethod("DocOrderDistinct")!;
276public static readonly MethodInfo EndRtfConstr = typeof(XmlQueryRuntime).GetMethod("EndRtfConstruction")!;
277public static readonly MethodInfo EndSeqConstr = typeof(XmlQueryRuntime).GetMethod("EndSequenceConstruction")!;
278public static readonly MethodInfo FindIndex = typeof(XmlQueryRuntime).GetMethod("FindIndex")!;
279public static readonly MethodInfo GenId = typeof(XmlQueryRuntime).GetMethod("GenerateId")!;
280public static readonly MethodInfo GetAtomizedName = typeof(XmlQueryRuntime).GetMethod("GetAtomizedName")!;
281public static readonly MethodInfo GetCollation = typeof(XmlQueryRuntime).GetMethod("GetCollation")!;
282public static readonly MethodInfo GetEarly = typeof(XmlQueryRuntime).GetMethod("GetEarlyBoundObject")!;
283public static readonly MethodInfo GetNameFilter = typeof(XmlQueryRuntime).GetMethod("GetNameFilter")!;
284public static readonly MethodInfo GetOutput = typeof(XmlQueryRuntime).GetMethod("get_Output")!;
285public static readonly MethodInfo GetGlobalValue = typeof(XmlQueryRuntime).GetMethod("GetGlobalValue")!;
286public static readonly MethodInfo GetTypeFilter = typeof(XmlQueryRuntime).GetMethod("GetTypeFilter")!;
287public static readonly MethodInfo GlobalComputed = typeof(XmlQueryRuntime).GetMethod("IsGlobalComputed")!;
288public static readonly MethodInfo ItemMatchesCode = typeof(XmlQueryRuntime).GetMethod("MatchesXmlType", new[] { typeof(XPathItem), typeof(XmlTypeCode) })!;
289public static readonly MethodInfo ItemMatchesType = typeof(XmlQueryRuntime).GetMethod("MatchesXmlType", new[] { typeof(XPathItem), typeof(int) })!;
290public static readonly MethodInfo QNameEqualLit = typeof(XmlQueryRuntime).GetMethod("IsQNameEqual", new[] { typeof(XPathNavigator), typeof(int), typeof(int) })!;
291public static readonly MethodInfo QNameEqualNav = typeof(XmlQueryRuntime).GetMethod("IsQNameEqual", new[] { typeof(XPathNavigator), typeof(XPathNavigator) })!;
292public static readonly MethodInfo RtfConstr = typeof(XmlQueryRuntime).GetMethod("TextRtfConstruction")!;
293public static readonly MethodInfo SendMessage = typeof(XmlQueryRuntime).GetMethod("SendMessage")!;
294public static readonly MethodInfo SeqMatchesCode = typeof(XmlQueryRuntime).GetMethod("MatchesXmlType", new[] { typeof(IList<XPathItem>), typeof(XmlTypeCode) })!;
295public static readonly MethodInfo SeqMatchesType = typeof(XmlQueryRuntime).GetMethod("MatchesXmlType", new[] { typeof(IList<XPathItem>), typeof(int) })!;
296public static readonly MethodInfo SetGlobalValue = typeof(XmlQueryRuntime).GetMethod("SetGlobalValue")!;
297public static readonly MethodInfo StartRtfConstr = typeof(XmlQueryRuntime).GetMethod("StartRtfConstruction")!;
298public static readonly MethodInfo StartSeqConstr = typeof(XmlQueryRuntime).GetMethod("StartSequenceConstruction")!;
299public static readonly MethodInfo TagAndMappings = typeof(XmlQueryRuntime).GetMethod("ParseTagName", new[] { typeof(string), typeof(int) })!;
300public static readonly MethodInfo TagAndNamespace = typeof(XmlQueryRuntime).GetMethod("ParseTagName", new[] { typeof(string), typeof(string) })!;
301public static readonly MethodInfo ThrowException = typeof(XmlQueryRuntime).GetMethod("ThrowException")!;
302public static readonly MethodInfo XsltLib = typeof(XmlQueryRuntime).GetMethod("get_XsltFunctions")!;
305public static readonly MethodInfo GetDataSource = typeof(XmlQueryContext).GetMethod("GetDataSource")!;
306public static readonly MethodInfo GetDefaultDataSource = typeof(XmlQueryContext).GetMethod("get_DefaultDataSource")!;
307public static readonly MethodInfo GetParam = typeof(XmlQueryContext).GetMethod("GetParameter")!;
308public static readonly MethodInfo InvokeXsltLate = GetInvokeXsltLateBoundFunction();
312private static MethodInfo GetInvokeXsltLateBoundFunction() => typeof(XmlQueryContext).GetMethod("InvokeXsltLateBoundFunction")!;
315public static readonly MethodInfo IndexAdd = typeof(XmlILIndex).GetMethod("Add")!;
316public static readonly MethodInfo IndexLookup = typeof(XmlILIndex).GetMethod("Lookup")!;
319public static readonly MethodInfo ItemIsNode = typeof(XPathItem).GetMethod("get_IsNode")!;
320public static readonly MethodInfo Value = typeof(XPathItem).GetMethod("get_Value")!;
321public static readonly MethodInfo ValueAsAny = typeof(XPathItem).GetMethod("ValueAs", new[] { typeof(Type), typeof(IXmlNamespaceResolver) })!;
324public static readonly MethodInfo NavClone = typeof(XPathNavigator).GetMethod("Clone")!;
325public static readonly MethodInfo NavLocalName = typeof(XPathNavigator).GetMethod("get_LocalName")!;
326public static readonly MethodInfo NavMoveAttr = typeof(XPathNavigator).GetMethod("MoveToAttribute", new[] { typeof(string), typeof(string) })!;
327public static readonly MethodInfo NavMoveId = typeof(XPathNavigator).GetMethod("MoveToId")!;
328public static readonly MethodInfo NavMoveParent = typeof(XPathNavigator).GetMethod("MoveToParent")!;
329public static readonly MethodInfo NavMoveRoot = typeof(XPathNavigator).GetMethod("MoveToRoot")!;
330public static readonly MethodInfo NavMoveTo = typeof(XPathNavigator).GetMethod("MoveTo")!;
331public static readonly MethodInfo NavNmsp = typeof(XPathNavigator).GetMethod("get_NamespaceURI")!;
332public static readonly MethodInfo NavPrefix = typeof(XPathNavigator).GetMethod("get_Prefix")!;
333public static readonly MethodInfo NavSamePos = typeof(XPathNavigator).GetMethod("IsSamePosition")!;
334public static readonly MethodInfo NavType = typeof(XPathNavigator).GetMethod("get_NodeType")!;
337public static readonly MethodInfo StartElemLitName = typeof(XmlQueryOutput).GetMethod("WriteStartElement", new[] { typeof(string), typeof(string), typeof(string) })!;
338public static readonly MethodInfo StartElemLocName = typeof(XmlQueryOutput).GetMethod("WriteStartElementLocalName", new[] { typeof(string) })!;
339public static readonly MethodInfo EndElemStackName = typeof(XmlQueryOutput).GetMethod("WriteEndElement")!;
340public static readonly MethodInfo StartAttrLitName = typeof(XmlQueryOutput).GetMethod("WriteStartAttribute", new[] { typeof(string), typeof(string), typeof(string) })!;
341public static readonly MethodInfo StartAttrLocName = typeof(XmlQueryOutput).GetMethod("WriteStartAttributeLocalName", new[] { typeof(string) })!;
342public static readonly MethodInfo EndAttr = typeof(XmlQueryOutput).GetMethod("WriteEndAttribute")!;
343public static readonly MethodInfo Text = typeof(XmlQueryOutput).GetMethod("WriteString")!;
344public static readonly MethodInfo NoEntText = typeof(XmlQueryOutput).GetMethod("WriteRaw", new[] { typeof(string) })!;
346public static readonly MethodInfo StartTree = typeof(XmlQueryOutput).GetMethod("StartTree")!;
347public static readonly MethodInfo EndTree = typeof(XmlQueryOutput).GetMethod("EndTree")!;
349public static readonly MethodInfo StartElemLitNameUn = typeof(XmlQueryOutput).GetMethod("WriteStartElementUnchecked", new[] { typeof(string), typeof(string), typeof(string) })!;
350public static readonly MethodInfo StartElemLocNameUn = typeof(XmlQueryOutput).GetMethod("WriteStartElementUnchecked", new[] { typeof(string) })!;
351public static readonly MethodInfo StartContentUn = typeof(XmlQueryOutput).GetMethod("StartElementContentUnchecked")!;
352public static readonly MethodInfo EndElemLitNameUn = typeof(XmlQueryOutput).GetMethod("WriteEndElementUnchecked", new[] { typeof(string), typeof(string), typeof(string) })!;
353public static readonly MethodInfo EndElemLocNameUn = typeof(XmlQueryOutput).GetMethod("WriteEndElementUnchecked", new[] { typeof(string) })!;
354public static readonly MethodInfo StartAttrLitNameUn = typeof(XmlQueryOutput).GetMethod("WriteStartAttributeUnchecked", new[] { typeof(string), typeof(string), typeof(string) })!;
355public static readonly MethodInfo StartAttrLocNameUn = typeof(XmlQueryOutput).GetMethod("WriteStartAttributeUnchecked", new[] { typeof(string) })!;
356public static readonly MethodInfo EndAttrUn = typeof(XmlQueryOutput).GetMethod("WriteEndAttributeUnchecked")!;
357public static readonly MethodInfo NamespaceDeclUn = typeof(XmlQueryOutput).GetMethod("WriteNamespaceDeclarationUnchecked")!;
358public static readonly MethodInfo TextUn = typeof(XmlQueryOutput).GetMethod("WriteStringUnchecked")!;
359public static readonly MethodInfo NoEntTextUn = typeof(XmlQueryOutput).GetMethod("WriteRawUnchecked")!;
361public static readonly MethodInfo StartRoot = typeof(XmlQueryOutput).GetMethod("WriteStartRoot")!;
362public static readonly MethodInfo EndRoot = typeof(XmlQueryOutput).GetMethod("WriteEndRoot")!;
363public static readonly MethodInfo StartElemCopyName = typeof(XmlQueryOutput).GetMethod("WriteStartElementComputed", new[] { typeof(XPathNavigator) })!;
364public static readonly MethodInfo StartElemMapName = typeof(XmlQueryOutput).GetMethod("WriteStartElementComputed", new[] { typeof(string), typeof(int) })!;
365public static readonly MethodInfo StartElemNmspName = typeof(XmlQueryOutput).GetMethod("WriteStartElementComputed", new[] { typeof(string), typeof(string) })!;
366public static readonly MethodInfo StartElemQName = typeof(XmlQueryOutput).GetMethod("WriteStartElementComputed", new[] { typeof(XmlQualifiedName) })!;
367public static readonly MethodInfo StartAttrCopyName = typeof(XmlQueryOutput).GetMethod("WriteStartAttributeComputed", new[] { typeof(XPathNavigator) })!;
368public static readonly MethodInfo StartAttrMapName = typeof(XmlQueryOutput).GetMethod("WriteStartAttributeComputed", new[] { typeof(string), typeof(int) })!;
369public static readonly MethodInfo StartAttrNmspName = typeof(XmlQueryOutput).GetMethod("WriteStartAttributeComputed", new[] { typeof(string), typeof(string) })!;
370public static readonly MethodInfo StartAttrQName = typeof(XmlQueryOutput).GetMethod("WriteStartAttributeComputed", new[] { typeof(XmlQualifiedName) })!;
371public static readonly MethodInfo NamespaceDecl = typeof(XmlQueryOutput).GetMethod("WriteNamespaceDeclaration")!;
372public static readonly MethodInfo StartComment = typeof(XmlQueryOutput).GetMethod("WriteStartComment")!;
373public static readonly MethodInfo CommentText = typeof(XmlQueryOutput).GetMethod("WriteCommentString")!;
374public static readonly MethodInfo EndComment = typeof(XmlQueryOutput).GetMethod("WriteEndComment")!;
375public static readonly MethodInfo StartPI = typeof(XmlQueryOutput).GetMethod("WriteStartProcessingInstruction")!;
376public static readonly MethodInfo PIText = typeof(XmlQueryOutput).GetMethod("WriteProcessingInstructionString")!;
377public static readonly MethodInfo EndPI = typeof(XmlQueryOutput).GetMethod("WriteEndProcessingInstruction")!;
378public static readonly MethodInfo WriteItem = typeof(XmlQueryOutput).GetMethod("WriteItem")!;
379public static readonly MethodInfo CopyOf = typeof(XmlQueryOutput).GetMethod("XsltCopyOf")!;
380public static readonly MethodInfo StartCopy = typeof(XmlQueryOutput).GetMethod("StartCopy")!;
381public static readonly MethodInfo EndCopy = typeof(XmlQueryOutput).GetMethod("EndCopy")!;
384public static readonly MethodInfo DecAdd = typeof(decimal).GetMethod("Add")!;
385public static readonly MethodInfo DecCmp = typeof(decimal).GetMethod("Compare", new[] { typeof(decimal), typeof(decimal) })!;
386public static readonly MethodInfo DecEq = typeof(decimal).GetMethod("Equals", new[] { typeof(decimal), typeof(decimal) })!;
387public static readonly MethodInfo DecSub = typeof(decimal).GetMethod("Subtract")!;
388public static readonly MethodInfo DecMul = typeof(decimal).GetMethod("Multiply")!;
389public static readonly MethodInfo DecDiv = typeof(decimal).GetMethod("Divide")!;
390public static readonly MethodInfo DecRem = typeof(decimal).GetMethod("Remainder")!;
391public static readonly MethodInfo DecNeg = typeof(decimal).GetMethod("Negate")!;
392public static readonly MethodInfo QNameEq = typeof(XmlQualifiedName).GetMethod("Equals")!;
393public static readonly MethodInfo StrEq = typeof(string).GetMethod("Equals", new[] { typeof(string), typeof(string) })!;
394public static readonly MethodInfo StrCat2 = typeof(string).GetMethod("Concat", new[] { typeof(string), typeof(string) })!;
395public static readonly MethodInfo StrCat3 = typeof(string).GetMethod("Concat", new[] { typeof(string), typeof(string), typeof(string) })!;
396public static readonly MethodInfo StrCat4 = typeof(string).GetMethod("Concat", new[] { typeof(string), typeof(string), typeof(string), typeof(string) })!;
397public static readonly MethodInfo StrCmp = typeof(string).GetMethod("CompareOrdinal", new[] { typeof(string), typeof(string) })!;
398public static readonly MethodInfo StrLen = typeof(string).GetMethod("get_Length")!;
401public static readonly MethodInfo DblToDec = typeof(XsltConvert).GetMethod("ToDecimal", new[] { typeof(double) })!;
402public static readonly MethodInfo DblToInt = typeof(XsltConvert).GetMethod("ToInt", new[] { typeof(double) })!;
403public static readonly MethodInfo DblToLng = typeof(XsltConvert).GetMethod("ToLong", new[] { typeof(double) })!;
404public static readonly MethodInfo DblToStr = typeof(XsltConvert).GetMethod("ToString", new[] { typeof(double) })!;
405public static readonly MethodInfo DecToDbl = typeof(XsltConvert).GetMethod("ToDouble", new[] { typeof(decimal) })!;
406public static readonly MethodInfo DTToStr = typeof(XsltConvert).GetMethod("ToString", new[] { typeof(DateTime) })!;
407public static readonly MethodInfo IntToDbl = typeof(XsltConvert).GetMethod("ToDouble", new[] { typeof(int) })!;
408public static readonly MethodInfo LngToDbl = typeof(XsltConvert).GetMethod("ToDouble", new[] { typeof(long) })!;
409public static readonly MethodInfo StrToDbl = typeof(XsltConvert).GetMethod("ToDouble", new[] { typeof(string) })!;
410public static readonly MethodInfo StrToDT = typeof(XsltConvert).GetMethod("ToDateTime", new[] { typeof(string) })!;
412public static readonly MethodInfo ItemToBool = typeof(XsltConvert).GetMethod("ToBoolean", new[] { typeof(XPathItem) })!;
413public static readonly MethodInfo ItemToDbl = typeof(XsltConvert).GetMethod("ToDouble", new[] { typeof(XPathItem) })!;
414public static readonly MethodInfo ItemToStr = typeof(XsltConvert).GetMethod("ToString", new[] { typeof(XPathItem) })!;
415public static readonly MethodInfo ItemToNode = typeof(XsltConvert).GetMethod("ToNode", new[] { typeof(XPathItem) })!;
416public static readonly MethodInfo ItemToNodes = typeof(XsltConvert).GetMethod("ToNodeSet", new[] { typeof(XPathItem) })!;
418public static readonly MethodInfo ItemsToBool = typeof(XsltConvert).GetMethod("ToBoolean", new[] { typeof(IList<XPathItem>) })!;
419public static readonly MethodInfo ItemsToDbl = typeof(XsltConvert).GetMethod("ToDouble", new[] { typeof(IList<XPathItem>) })!;
420public static readonly MethodInfo ItemsToNode = typeof(XsltConvert).GetMethod("ToNode", new[] { typeof(IList<XPathItem>) })!;
421public static readonly MethodInfo ItemsToNodes = typeof(XsltConvert).GetMethod("ToNodeSet", new[] { typeof(IList<XPathItem>) })!;
422public static readonly MethodInfo ItemsToStr = typeof(XsltConvert).GetMethod("ToString", new[] { typeof(IList<XPathItem>) })!;
425public static readonly MethodInfo StrCatCat = typeof(StringConcat).GetMethod("Concat")!;
426public static readonly MethodInfo StrCatClear = typeof(StringConcat).GetMethod("Clear")!;
427public static readonly MethodInfo StrCatResult = typeof(StringConcat).GetMethod("GetResult")!;
428public static readonly MethodInfo StrCatDelim = typeof(StringConcat).GetMethod("set_Delimiter")!;
431public static readonly MethodInfo NavsToItems = typeof(XmlILStorageConverter).GetMethod("NavigatorsToItems")!;
432public static readonly MethodInfo ItemsToNavs = typeof(XmlILStorageConverter).GetMethod("ItemsToNavigators")!;
435public static readonly MethodInfo SetDod = typeof(XmlQueryNodeSequence).GetMethod("set_IsDocOrderDistinct")!;
438public static readonly MethodInfo GetTypeFromHandle = typeof(Type).GetMethod("GetTypeFromHandle")!;
439public static readonly MethodInfo InitializeArray = typeof(System.Runtime.CompilerServices.RuntimeHelpers).GetMethod("InitializeArray")!;
487private MethodInfo? _methSyncToNav;
801public void TailCall(MethodInfo meth)
810private void TraceCall(OpCode opcode, MethodInfo meth)
838public void Call(MethodInfo meth)
951MethodInfo? meth = null;
994MethodInfo? meth = null;
1011MethodInfo? meth = null;
1183MethodInfo? meth = null;
1216MethodInfo? meth = null;
1246MethodInfo? meth = null;
1376MethodInfo? meth;
1403MethodInfo? meth = null;
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (25)
50public void Visit(QilExpression qil, GenerateHelper helper, MethodInfo methRoot)
88MethodInfo? methGlobal;
116MethodInfo methGlobal;
215MethodInfo methFunc;
1274private QilBinary CreateSetIterator(QilBinary ndSet, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, MethodInfo methCurrent)
1382private QilUnary CreateAggregator(QilUnary ndAgg, string aggName, XmlILStorageMethods methods, MethodInfo methAgg, MethodInfo methResult)
2550MethodInfo methInfo = XmlILAnnotation.Write(ndFunc).FunctionBinding!;
3797MethodInfo? meth;
3826private static bool GetXsltConvertMethod(XmlQueryType typSrc, XmlQueryType typDst, out MethodInfo? meth)
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)
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (6)
111private static MethodInfo? FindBestMethod(MethodInfo[] methods, bool ignoreCase, bool publicOnly, string name, XPathResultType[]? argTypes)
193MethodInfo? method = FindBestMethod(extension.GetType().GetMethods(bindingFlags), /*ignoreCase:*/true, /*publicOnly:*/false, name, argTypes);
204MethodInfo? method = FindBestMethod(extension.GetType().GetMethods(bindingFlags), /*ignoreCase:*/false, /*publicOnly:*/true, name, argTypes);
957private readonly MethodInfo _method;
960public FuncExtension(object extension, MethodInfo method)
System.Reflection (1)
System.Reflection.Context (73)
System\Reflection\Context\Custom\CustomType.cs (12)
142public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
145MethodInfo[] methods = base.GetMethods(bindingAttr);
155List<MethodInfo> results = new List<MethodInfo>(methods);
184protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers)
186MethodInfo? method = base.GetMethodImpl(name, bindingAttr, binder, callConvention, types, modifiers);
220List<MethodInfo> matchingMethods = new List<MethodInfo>();
229MethodInfo? accessor = getPropertyGetter ? newDeclaredProperty.GetGetMethod() : newDeclaredProperty.GetSetMethod();
250MethodInfo? accessor = getPropertyGetter ? inheritedProperty.GetGetMethod() : inheritedProperty.GetSetMethod();
268MethodInfo match = matchingMethods[0];
281return (MethodInfo?)binder.SelectMethod(bindingAttr, matchingMethods.ToArray(), types, modifiers);
System.Reflection.DispatchProxy (26)
System\Reflection\DispatchProxyGenerator.cs (25)
51private static readonly MethodInfo s_dispatchProxyInvokeMethod = typeof(DispatchProxy).GetMethod("Invoke", BindingFlags.NonPublic | BindingFlags.Instance)!;
52private static readonly MethodInfo s_getTypeFromHandleMethod = typeof(Type).GetMethod("GetTypeFromHandle", new Type[] { typeof(RuntimeTypeHandle) })!;
53private static readonly MethodInfo s_makeGenericMethodMethod = GetGenericMethodMethodInfo();
58private static MethodInfo GetGenericMethodMethodInfo() =>
59typeof(MethodInfo).GetMethod("MakeGenericMethod", new Type[] { typeof(Type[]) })!;
83MethodInfo[] methodInfos)
91public MethodInfo[] MethodInfos { get; }
259private readonly List<MethodInfo> _methodInfos;
271_fields.Add(tb.DefineField("_methodInfos", typeof(MethodInfo[]), FieldAttributes.Private));
273_methodInfos = new List<MethodInfo>();
322var propertyMap = new Dictionary<MethodInfo, PropertyAccessorInfo>();
332var eventMap = new Dictionary<MethodInfo, EventAccessorInfo>();
344foreach (MethodInfo mi in iface.GetRuntimeMethods())
411private MethodBuilder AddMethodImpl(MethodInfo mi, int methodInfoIndex)
479LocalBuilder methodInfoLocal = il.DeclareLocal(typeof(MethodInfo));
765public MethodInfo? InterfaceGetMethod { get; }
766public MethodInfo? InterfaceSetMethod { get; }
770public PropertyAccessorInfo(MethodInfo? interfaceGetMethod, MethodInfo? interfaceSetMethod)
779public MethodInfo? InterfaceAddMethod { get; }
780public MethodInfo? InterfaceRemoveMethod { get; }
781public MethodInfo? InterfaceRaiseMethod { get; }
786public EventAccessorInfo(MethodInfo? interfaceAddMethod, MethodInfo? interfaceRemoveMethod, MethodInfo? interfaceRaiseMethod)
System.Reflection.Emit (79)
System\Reflection\Emit\ModuleBuilderImpl.cs (20)
216foreach (List<(MethodInfo ifaceMethod, MethodInfo targetMethod)> mapList in typeBuilder._methodOverrides.Values)
218foreach ((MethodInfo ifaceMethod, MethodInfo targetMethod) pair in mapList)
618if (pair.Key is KeyValuePair<MethodInfo, Type[]> pair2)
752case MethodInfo method:
763method = (MethodInfo)GetOriginalMemberIfConstructedType(method);
778private EntityHandle GetMethodReference(MethodInfo methodInfo, Type[] optionalParameterTypes)
780MethodInfo method = (MethodInfo)GetOriginalMemberIfConstructedType(methodInfo);
782KeyValuePair<MethodInfo, BlobBuilder> pair = new(method, signature);
793private BlobBuilder GetMethodSignature(MethodInfo method, Type[]? optionalParameterTypes) =>
1173public override int GetMethodMetadataToken(MethodInfo method) => GetTokenForHandle(TryGetMethodHandle(method));
1175internal EntityHandle TryGetMethodHandle(MethodInfo method)
1191private bool IsArrayMethodTypeIsTypeBuilder(MethodInfo method) => method is ArrayMethod arrayMethod &&
1194private bool IsConstructedFromMethodBuilderOrTypeBuilder(MethodInfo method) => method.IsConstructedGenericMethod &&
1197internal EntityHandle TryGetMethodHandle(MethodInfo method, Type[] optionalParameterTypes)
1324protected override MethodInfo GetArrayMethodCore(Type arrayClass, string methodName,
1347protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder,
1359public override MethodInfo[] GetMethods(BindingFlags bindingFlags)
System\Reflection\Emit\TypeBuilderImpl.cs (28)
42internal Dictionary<Type, List<(MethodInfo ifaceMethod, MethodInfo targetMethod)>>? _methodOverrides;
314protected override void DefineMethodOverrideCore(MethodInfo methodInfoBody, MethodInfo methodInfoDeclaration)
325if (_methodOverrides.TryGetValue(baseType, out List<(MethodInfo ifaceMethod, MethodInfo targetMethod)>? im))
336im = new List<(MethodInfo ifaceMethod, MethodInfo targetMethod)>();
689internal static BindingFlags GetBindingFlags(MethodInfo method)
784private MethodInfo[] GetMethods(string name, BindingFlags bindingAttr)
788MethodInfo[] candidates = GetMethods(bindingAttr);
789List<MethodInfo> methods = new List<MethodInfo>();
790foreach (MethodInfo method in candidates)
802public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
806List<MethodInfo> methods = new List<MethodInfo>();
824protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder,
829MethodInfo? found = null;
992MethodInfo? getMethod = property.GetMethod;
993MethodInfo? setMethod = property.SetMethod;
1180MethodInfo[] methods = [];
1265MethodInfo[] interfaceMethods = interfaceType.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
1270InterfaceMethods = new MethodInfo[interfaceMethods.Length],
1271TargetMethods = new MethodInfo[interfaceMethods.Length]
1276MethodInfo interfaceMethod = interfaceMethods[i];
1277MethodInfo? targetMethod = GetMethodImpl(interfaceMethod.Name, GetBindingFlags(interfaceMethod), null, interfaceMethod.CallingConvention, GetParameterTypes(interfaceMethod.GetParameters()), null);
1340MethodInfo[] methods = GetMethods(bindingAttr);
System.Reflection.MetadataLoadContext (101)
System\Reflection\Runtime\BindingFlagSupport\MethodPolicies.cs (11)
12internal sealed class MethodPolicies : MemberPolicies<MethodInfo>
14public sealed override IEnumerable<MethodInfo> GetDeclaredMembers(TypeInfo typeInfo)
19public sealed override IEnumerable<MethodInfo> CoreGetDeclaredMembers(RuntimeTypeInfo type, NameFilter? filter, RuntimeTypeInfo reflectedType)
26public sealed override void GetMemberAttributes(MethodInfo member, out MethodAttributes visibility, out bool isStatic, out bool isVirtual, out bool isNewSlot)
35public sealed override bool ImplicitlyOverrides(MethodInfo? baseMember, MethodInfo? derivedMember)
43public sealed override bool IsSuppressedByMoreDerivedMember(MethodInfo member, MethodInfo[] priorMembers, int startIndex, int endIndex)
50MethodInfo prior = priorMembers[i];
62public sealed override bool OkToIgnoreAmbiguity(MethodInfo m1, MethodInfo m2)
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.cs (4)
49internal MethodInfo? ComputeEntryPoint(bool fileRefEntryPointAllowed)
68return mdh.ResolveMethod<MethodInfo>(this, default);
114public sealed override MethodInfo[] GetMethods(BindingFlags bindingFlags) => GetModuleType().GetMethods(bindingFlags);
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);
System\Reflection\TypeLoading\RuntimeTypeInfo.BindingFlags.cs (11)
52public sealed override MethodInfo[] GetMethods(BindingFlags bindingAttr) => Query<MethodInfo>(bindingAttr).ToArray();
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)
76return Query<MethodInfo>(name, bindingAttr).Disambiguate();
81QueryResult<MethodInfo> queryResult = Query<MethodInfo>(name, bindingAttr);
82ListBuilder<MethodInfo> candidates = default;
83foreach (MethodInfo candidate in queryResult)
99return binder.SelectMethod(bindingAttr, candidates.ToArray(), types, modifiers) as MethodInfo;
System.Reflection.TypeExtensions (19)
System.Resources.Extensions (12)
System.Runtime (1)
System.Runtime.InteropServices (7)
System.Runtime.Serialization.Formatters (12)
System.Security.Cryptography (4)
System.Security.Cryptography.Xml (1)
System.ServiceModel.NetNamedPipe.Tests (1)
System.ServiceModel.Primitives.Tests (1)
System.Text.Json (29)
System.Text.RegularExpressions (80)
System\Text\RegularExpressions\RegexCompiler.cs (79)
32private static MethodInfo CaptureMethod => field ??= RegexRunnerMethod("Capture");
33private static MethodInfo TransferCaptureMethod => field ??= RegexRunnerMethod("TransferCapture");
34private static MethodInfo UncaptureMethod => field ??= RegexRunnerMethod("Uncapture");
35private static MethodInfo IsMatchedMethod => field ??= RegexRunnerMethod("IsMatched");
36private static MethodInfo MatchLengthMethod => field ??= RegexRunnerMethod("MatchLength");
37private static MethodInfo MatchIndexMethod => field ??= RegexRunnerMethod("MatchIndex");
38private static MethodInfo IsBoundaryMethod => field ??= typeof(RegexRunner).GetMethod("IsBoundary", BindingFlags.NonPublic | BindingFlags.Static, [typeof(ReadOnlySpan<char>), typeof(int)])!;
39private static MethodInfo IsWordCharMethod => field ??= RegexRunnerMethod("IsWordChar");
40private static MethodInfo IsECMABoundaryMethod => field ??= typeof(RegexRunner).GetMethod("IsECMABoundary", BindingFlags.NonPublic | BindingFlags.Static, [typeof(ReadOnlySpan<char>), typeof(int)])!;
41private static MethodInfo CrawlposMethod => field ??= RegexRunnerMethod("Crawlpos");
42private static MethodInfo CharInClassMethod => field ??= RegexRunnerMethod("CharInClass");
43private static MethodInfo CheckTimeoutMethod => field ??= RegexRunnerMethod("CheckTimeout");
45private static MethodInfo RegexCaseEquivalencesTryFindCaseEquivalencesForCharWithIBehaviorMethod => field ??= typeof(RegexCaseEquivalences).GetMethod("TryFindCaseEquivalencesForCharWithIBehavior", BindingFlags.Static | BindingFlags.Public)!;
46private static MethodInfo CharIsDigitMethod => field ??= typeof(char).GetMethod("IsDigit", [typeof(char)])!;
47private static MethodInfo CharIsWhiteSpaceMethod => field ??= typeof(char).GetMethod("IsWhiteSpace", [typeof(char)])!;
48private static MethodInfo CharIsControlMethod => field ??= typeof(char).GetMethod("IsControl", [typeof(char)])!;
49private static MethodInfo CharIsLetterMethod => field ??= typeof(char).GetMethod("IsLetter", [typeof(char)])!;
50private static MethodInfo CharIsAsciiDigitMethod => field ??= typeof(char).GetMethod("IsAsciiDigit", [typeof(char)])!;
51private static MethodInfo CharIsAsciiLetterMethod => field ??= typeof(char).GetMethod("IsAsciiLetter", [typeof(char)])!;
52private static MethodInfo CharIsAsciiLetterLowerMethod => field ??= typeof(char).GetMethod("IsAsciiLetterLower", [typeof(char)])!;
53private static MethodInfo CharIsAsciiLetterUpperMethod => field ??= typeof(char).GetMethod("IsAsciiLetterUpper", [typeof(char)])!;
54private static MethodInfo CharIsAsciiLetterOrDigitMethod => field ??= typeof(char).GetMethod("IsAsciiLetterOrDigit", [typeof(char)])!;
55private static MethodInfo CharIsAsciiHexDigitMethod => field ??= typeof(char).GetMethod("IsAsciiHexDigit", [typeof(char)])!;
56private static MethodInfo CharIsAsciiHexDigitLowerMethod => field ??= typeof(char).GetMethod("IsAsciiHexDigitLower", [typeof(char)])!;
57private static MethodInfo CharIsAsciiHexDigitUpperMethod => field ??= typeof(char).GetMethod("IsAsciiHexDigitUpper", [typeof(char)])!;
58private static MethodInfo CharIsLetterOrDigitMethod => field ??= typeof(char).GetMethod("IsLetterOrDigit", [typeof(char)])!;
59private static MethodInfo CharIsLowerMethod => field ??= typeof(char).GetMethod("IsLower", [typeof(char)])!;
60private static MethodInfo CharIsUpperMethod => field ??= typeof(char).GetMethod("IsUpper", [typeof(char)])!;
61private static MethodInfo CharIsNumberMethod => field ??= typeof(char).GetMethod("IsNumber", [typeof(char)])!;
62private static MethodInfo CharIsPunctuationMethod => field ??= typeof(char).GetMethod("IsPunctuation", [typeof(char)])!;
63private static MethodInfo CharIsSeparatorMethod => field ??= typeof(char).GetMethod("IsSeparator", [typeof(char)])!;
64private static MethodInfo CharIsSymbolMethod => field ??= typeof(char).GetMethod("IsSymbol", [typeof(char)])!;
65private static MethodInfo CharGetUnicodeInfoMethod => field ??= typeof(char).GetMethod("GetUnicodeCategory", [typeof(char)])!;
66private static MethodInfo SpanGetItemMethod => field ??= typeof(ReadOnlySpan<char>).GetMethod("get_Item", [typeof(int)])!;
67private static MethodInfo SpanGetLengthMethod => field ??= typeof(ReadOnlySpan<char>).GetMethod("get_Length")!;
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));
70private static MethodInfo SpanIndexOfSpanStringComparisonMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOf", [typeof(ReadOnlySpan<char>), typeof(ReadOnlySpan<char>), typeof(StringComparison)])!;
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));
75private static MethodInfo SpanIndexOfAnySearchValuesStringMethod => field ??= typeof(MemoryExtensions).GetMethod("IndexOfAny", [typeof(ReadOnlySpan<char>), typeof(SearchValues<string>)])!;
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));
96private static MethodInfo SpanSliceIntMethod => field ??= typeof(ReadOnlySpan<char>).GetMethod("Slice", [typeof(int)])!;
97private static MethodInfo SpanSliceIntIntMethod => field ??= typeof(ReadOnlySpan<char>).GetMethod("Slice", [typeof(int), typeof(int)])!;
98private static MethodInfo SpanStartsWithSpanMethod => field ??= typeof(MemoryExtensions).GetMethod("StartsWith", [typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0))])!.MakeGenericMethod(typeof(char));
99private static MethodInfo SpanStartsWithSpanComparisonMethod => field ??= typeof(MemoryExtensions).GetMethod("StartsWith", [typeof(ReadOnlySpan<char>), typeof(ReadOnlySpan<char>), typeof(StringComparison)])!;
100private static MethodInfo StringAsSpanMethod => field ??= typeof(MemoryExtensions).GetMethod("AsSpan", [typeof(string)])!;
101private static MethodInfo StringGetCharsMethod => field ??= typeof(string).GetMethod("get_Chars", [typeof(int)])!;
102private static MethodInfo ArrayResizeMethod => field ??= typeof(Array).GetMethod("Resize")!.MakeGenericMethod(typeof(int));
103private static MethodInfo MathMinIntIntMethod => field ??= typeof(Math).GetMethod("Min", [typeof(int), typeof(int)])!;
104private static MethodInfo MemoryMarshalGetArrayDataReferenceSearchValuesMethod => field ??= typeof(MemoryMarshal).GetMethod("GetArrayDataReference", [Type.MakeGenericMethodParameter(0).MakeArrayType()])!.MakeGenericMethod(typeof(SearchValues<char>))!;
105private static MethodInfo UnsafeAsMethod => field ??= typeof(Unsafe).GetMethod("As", [typeof(object)])!;
131private static MethodInfo RegexRunnerMethod(string methname) => typeof(RegexRunner).GetMethod(methname, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static)!;
256protected void Callvirt(MethodInfo mt) => _ilg!.Emit(OpCodes.Callvirt, mt);
259protected void Call(MethodInfo mt) => _ilg!.Emit(OpCodes.Call, mt);
5343protected void EmitScan(RegexOptions options, MethodInfo tryFindNextStartingPositionMethod, MethodInfo tryMatchAtCurrentPositionMethod)
6217static MethodInfo MakeUnsafeAs(Type type)
System.Windows.Controls.Ribbon (1)
System.Windows.Forms (4)
System.Windows.Forms.Design (32)
System.Windows.Forms.Design.Tests (1)
System.Windows.Forms.Interop.Tests (1)
System.Windows.Forms.Tests (5)
System.Xaml (190)
System\Xaml\Runtime\DynamicMethodRuntime.cs (18)
31private static MethodInfo s_GetTypeFromHandleMethod;
32private static MethodInfo s_InvokeMemberMethod;
56private Dictionary<MethodInfo, PropertyGetDelegate> _propertyGetDelegates;
57private Dictionary<MethodInfo, PropertySetDelegate> _propertySetDelegates;
63private Dictionary<MethodInfo, PropertyGetDelegate> PropertyGetDelegates
69_propertyGetDelegates = new Dictionary<MethodInfo, PropertyGetDelegate>();
76private Dictionary<MethodInfo, PropertySetDelegate> PropertySetDelegates
82_propertySetDelegates = new Dictionary<MethodInfo, PropertySetDelegate>();
227MethodInfo factory = GetFactoryMethod(type, methodName, args, BF_AllStaticMembers);
240MethodInfo getter = member.Invoker.UnderlyingGetter;
258MethodInfo setter = member.Invoker.UnderlyingSetter;
282MethodInfo helper = targetType.GetMethod(KnownStrings.CreateDelegateHelper,
318MethodInfo method = typeof(Delegate).GetMethod(KnownStrings.CreateDelegate,
341private FactoryDelegate CreateFactoryDelegate(MethodInfo factory)
421private PropertyGetDelegate CreateGetDelegate(MethodInfo getter)
439private PropertySetDelegate CreateSetDelegate(MethodInfo setter)
472private Type GetTargetType(MethodInfo instanceMethod)
501private static void Emit_Call(ILGenerator ilGenerator, MethodInfo method)
System\Xaml\Schema\CollectionReflector.cs (28)
16private static MethodInfo s_getEnumeratorMethod;
17private static MethodInfo s_listAddMethod;
18private static MethodInfo s_dictionaryAddMethod;
29internal static XamlCollectionKind LookupCollectionKind(Type type, out MethodInfo addMethod)
82internal static MethodInfo LookupAddMethod(Type type, XamlCollectionKind collectionKind)
84MethodInfo result = null;
110private static bool TryGetICollectionAdder(Type type, out MethodInfo addMethod)
128private static bool TryGetCollectionAdder(Type type, bool mayBeICollection, out MethodInfo addMethod)
175private static bool TryGetIDictionaryAdder(Type type, out MethodInfo addMethod)
193private static bool TryGetDictionaryAdder(Type type, bool mayBeIDictionary, out MethodInfo addMethod)
238internal static MethodInfo GetAddMethod(Type type, Type contentType)
243internal static MethodInfo GetEnumeratorMethod(Type type)
255internal static MethodInfo GetIsReadOnlyMethod(Type collectionType, Type itemType)
260MethodInfo isReadOnlyMethod = genericICollection.GetProperty(KnownStrings.IsReadOnly).GetGetMethod();
267private static MethodInfo LookupEnumeratorMethod(Type type)
269MethodInfo result = GetMethod(type, KnownStrings.GetEnumerator, Type.EmptyTypes);
305private static MethodInfo GetAddMethod(Type type, int paramCount, out bool hasMoreThanOne)
307MethodInfo result = null;
313MethodInfo method = (MethodInfo)mi;
353private static MethodInfo GetMethod(Type type, string name, Type[] argTypes)
355MethodInfo result = type.GetMethod(name, GetBindingFlags(type), null, argTypes, null);
364private static MethodInfo GetPublicMethod(Type type, string name, int argCount)
369MethodInfo method = (MethodInfo)mi;
405private static MethodInfo IEnumerableGetEnumeratorMethod
418private static MethodInfo IListAddMethod
431private static MethodInfo IDictionaryAddMethod
System\Xaml\Schema\TypeReflector.cs (76)
57private NullableReference<MethodInfo> _isReadOnlyMethod;
65private NullableReference<MethodInfo> _addMethod;
67private NullableReference<MethodInfo> _getEnumeratorMethod;
230internal MethodInfo IsReadOnlyMethod
386internal MethodInfo AddMethod
394internal MethodInfo GetEnumeratorMethod
632private static bool IsPrivateOrNull(MethodInfo mi)
641private void PickAttachablePropertyAccessors(List<MethodInfo> getters,
642List<MethodInfo> setters, out MethodInfo getter, out MethodInfo setter)
644List<KeyValuePair<MethodInfo, MethodInfo>> candidates =
645new List<KeyValuePair<MethodInfo, MethodInfo>>();
649foreach (MethodInfo curSetter in setters)
651foreach (MethodInfo curGetter in getters)
658candidates.Add(new KeyValuePair<MethodInfo, MethodInfo>(curGetter, curSetter));
689private MethodInfo PickAttachableEventAdder(IEnumerable<MethodInfo> adders)
694foreach (MethodInfo adder in adders)
706internal bool LookupAttachableProperty(string name, out MethodInfo getter, out MethodInfo setter)
709List<MethodInfo> setters = LookupStaticSetters(name);
710List<MethodInfo> getters = LookupStaticGetters(name);
723internal MethodInfo LookupAttachableEvent(string name)
726List<MethodInfo> adders = LookupStaticAdders(name);
735private void LookupAllStaticAccessors(out Dictionary<string, List<MethodInfo>> getters,
736out Dictionary<string, List<MethodInfo>> setters, out Dictionary<string, List<MethodInfo>> adders)
738getters = new Dictionary<string, List<MethodInfo>>();
739setters = new Dictionary<string, List<MethodInfo>>();
740adders = new Dictionary<string, List<MethodInfo>>();
742MethodInfo[] allMethods = UnderlyingType.GetMethods(AttachableProperties_BF);
754private void LookupAllStaticAccessorsHelper(MethodInfo[] allMethods, Dictionary<string, List<MethodInfo>> getters,
755Dictionary<string, List<MethodInfo>> setters, Dictionary<string, List<MethodInfo>> adders, bool isUnderlyingTypePublic)
757foreach (MethodInfo method in allMethods)
778private List<MethodInfo> LookupStaticAdders(string name)
782List<MethodInfo> preferredAdders, otherAdders;
787private List<MethodInfo> LookupStaticGetters(string name)
790List<MethodInfo> preferredGetters, otherGetters;
795private List<MethodInfo> LookupStaticSetters(string name)
798List<MethodInfo> preferredSetters, otherSetters;
805private void PrioritizeAccessors(MemberInfo[] accessors, bool isEvent, bool isGetter, out List<MethodInfo> preferredAccessors, out List<MethodInfo> otherAccessors)
812foreach (MethodInfo accessor in accessors)
818preferredAccessors = new List<MethodInfo>();
827otherAccessors = new List<MethodInfo>();
836foreach (MethodInfo accessor in accessors)
842preferredAccessors = new List<MethodInfo>();
851private bool IsAttachablePropertyAccessor(bool isEvent, bool isGetter, MethodInfo accessor)
866private static void AddToMultiDict(Dictionary<string, List<MethodInfo>> dict, string name, MethodInfo value, bool isUnderlyingTypePublic)
868List<MethodInfo> list;
903list = new List<MethodInfo>();
909private bool IsAttachablePropertyGetter(MethodInfo mi, out string name)
926private bool IsAttachablePropertyGetter(MethodInfo mi)
933private bool IsAttachablePropertySetter(MethodInfo mi, out string name)
950private bool IsAttachablePropertySetter(MethodInfo mi)
957private bool IsAttachableEventAdder(MethodInfo mi, out string name)
975private bool IsAttachableEventAdder(MethodInfo mi)
991Dictionary<string, List<MethodInfo>> getters;
992Dictionary<string, List<MethodInfo>> setters;
993Dictionary<string, List<MethodInfo>> adders;
1002Dictionary<string, List<MethodInfo>> getters, Dictionary<string, List<MethodInfo>> setters)
1004foreach (KeyValuePair<string, List<MethodInfo>> nameAndSetterList in setters)
1010List<MethodInfo> getterList;
1015MethodInfo getter, setter;
1031foreach (KeyValuePair<string, List<MethodInfo>> nameAndGetterList in getters)
1045List<XamlMember> result, Dictionary<string, List<MethodInfo>> adders)
1047foreach (KeyValuePair<string, List<MethodInfo>> nameAndAdderList in adders)
1053MethodInfo adder = PickAttachableEventAdder(nameAndAdderList.Value);
System\Xaml\XamlMember.cs (24)
88public XamlMember(string attachablePropertyName, MethodInfo getter, MethodInfo setter,
94public XamlMember(string attachablePropertyName, MethodInfo getter, MethodInfo setter,
100internal XamlMember(string attachablePropertyName, MethodInfo getter, MethodInfo setter,
104MethodInfo accessor = getter ?? setter;
123public XamlMember(string attachableEventName, MethodInfo adder, XamlSchemaContext schemaContext)
128public XamlMember(string attachableEventName, MethodInfo adder, XamlSchemaContext schemaContext,
134internal XamlMember(string attachableEventName, MethodInfo adder, XamlSchemaContext schemaContext,
432internal MethodInfo Getter
470internal MethodInfo Setter
499MethodInfo getter = Getter;
518MethodInfo setter = Setter;
625MethodInfo getter = Getter;
668MethodInfo setter = Setter;
681MethodInfo accessor = UnderlyingMember as MethodInfo;
763protected virtual MethodInfo LookupUnderlyingGetter()
777protected virtual MethodInfo LookupUnderlyingSetter()
840private static void ValidateGetter(MethodInfo method, string argumentName)
853private static void ValidateSetter(MethodInfo method, string argumentName)
1017MethodInfo mi = underlyingMember as MethodInfo;
System.Xaml.Tests (71)
System\Xaml\XamlMemberTests.cs (16)
168public void Ctor_String_MethodInfo_MethodInfo_XamlSchemaContext(string attachablePropertyName, MethodInfo getter, MethodInfo setter, XamlSchemaContext schemaContext)
191public void Ctor_String_MethodInfo_MethodInfo_XamlSchemaContext_XamlMemberInvoker(string attachablePropertyName, MethodInfo getter, MethodInfo setter, XamlSchemaContext schemaContext, XamlMemberInvoker invoker)
214MethodInfo getter = typeof(AccessorClass).GetMethod(nameof(AccessorClass.GetMethod))!;
232MethodInfo getter = typeof(AccessorClass).GetMethod(getterName)!;
242MethodInfo setter = typeof(AccessorClass).GetMethod(setterName)!;
255public void Ctor_String_MethodInfo_XamlSchemaContext(string attachablePropertyName, MethodInfo adder, XamlSchemaContext schemaContext)
276public void Ctor_String_MethodInfo_XamlSchemaContext_XamlMemberInvoker(string attachablePropertyName, MethodInfo adder, XamlSchemaContext schemaContext, XamlMemberInvoker invoker)
299MethodInfo adder = typeof(AccessorClass).GetMethod(nameof(AccessorClass.SetMethod))!;
316MethodInfo adder = typeof(AccessorClass).GetMethod(adderName)!;
1897public void LookupUnderlyingGetter_Invoke_ReturnsExpected(SubXamlMember member, MethodInfo expected)
2031public void LookupUnderlyingSetter_Invoke_ReturnsExpected(SubXamlMember member, MethodInfo expected)
2390public override MethodInfo[] GetAccessors(bool nonPublic)
2405public override MethodInfo? GetGetMethod(bool nonPublic)
2415public override MethodInfo? GetSetMethod(bool nonPublic)
System\Xaml\XamlMemberTests.Mocks.cs (18)
24public SubXamlMember(string attachablePropertyName, MethodInfo? getter, MethodInfo? setter, XamlSchemaContext schemaContext) : base(attachablePropertyName, getter, setter, schemaContext) { }
26public SubXamlMember(string attachablePropertyName, MethodInfo? getter, MethodInfo? setter, XamlSchemaContext schemaContext, XamlMemberInvoker invoker) : base(attachablePropertyName, getter, setter, schemaContext, invoker) { }
32public SubXamlMember(string attachableEventName, MethodInfo adder, XamlSchemaContext schemaContext) : base(attachableEventName, adder, schemaContext) { }
34public SubXamlMember(string attachableEventName, MethodInfo adder, XamlSchemaContext schemaContext, XamlMemberInvoker invoker) : base(attachableEventName, adder, schemaContext, invoker) { }
66public MethodInfo LookupUnderlyingGetterEntry() => LookupUnderlyingGetter();
70public MethodInfo LookupUnderlyingSetterEntry() => LookupUnderlyingSetter();
83public CustomXamlMember(string attachablePropertyName, MethodInfo getter, MethodInfo setter, XamlSchemaContext schemaContext) : base(attachablePropertyName, getter, setter, schemaContext) { }
85public CustomXamlMember(string attachablePropertyName, MethodInfo getter, MethodInfo setter, XamlSchemaContext schemaContext, XamlMemberInvoker invoker) : base(attachablePropertyName, getter, setter, schemaContext, invoker) { }
91public CustomXamlMember(string attachableEventName, MethodInfo adder, XamlSchemaContext schemaContext) : base(attachableEventName, adder, schemaContext) { }
93public CustomXamlMember(string attachableEventName, MethodInfo adder, XamlSchemaContext schemaContext, XamlMemberInvoker invoker) : base(attachableEventName, adder, schemaContext, invoker) { }
185public Optional<MethodInfo?> LookupUnderlyingGetterResult { get; set; }
186protected override MethodInfo LookupUnderlyingGetter()
197public Optional<MethodInfo?> LookupUnderlyingSetterResult { get; set; }
198protected override MethodInfo LookupUnderlyingSetter()
Templates.Blazor.WebAssembly.Auth.Tests (2)
Templates.Blazor.WebAssembly.Tests (2)
Templates.Mvc.Tests (2)
Templates.Tests (2)
Test.Utilities (5)
Text.Analyzers (5)
VisualBasicRuntimeTest (1)
WindowsFormsIntegration (1)
xunit.assert (5)