120 references to MethodsToGen
Microsoft.Extensions.Configuration.Binder.SourceGeneration (120)
ConfigurationBindingGenerator.Emitter.cs (1)
36if (!ShouldEmitMethods(MethodsToGen.Any))
ConfigurationBindingGenerator.Parser.cs (5)
128MethodsToGen overload = typeParseInfo.BindingOverload; 130if ((MethodsToGen.ConfigBinder_Any & overload) is not 0) 134else if ((MethodsToGen.OptionsBuilderExt_Any & overload) is not 0) 140Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & overload) is not 0); 146private void EnqueueTargetTypeForRootInvocation(ITypeSymbol? typeSymbol, MethodsToGen overload, BinderInvocation invocation)
Emitter\ConfigurationBinder.cs (22)
15if (!ShouldEmitMethods(MethodsToGen.ConfigBinder_Any)) 32if (ShouldEmitMethods(MethodsToGen.ConfigBinder_Get_T)) 34EmitStartDefinition_Get_Or_GetValue_Overload(MethodsToGen.ConfigBinder_Get_T, documentation); 39if (ShouldEmitMethods(MethodsToGen.ConfigBinder_Get_T_BinderOptions)) 41EmitStartDefinition_Get_Or_GetValue_Overload(MethodsToGen.ConfigBinder_Get_T_BinderOptions, documentation); 46if (ShouldEmitMethods(MethodsToGen.ConfigBinder_Get_TypeOf)) 48EmitStartDefinition_Get_Or_GetValue_Overload(MethodsToGen.ConfigBinder_Get_TypeOf, documentation); 53if (ShouldEmitMethods(MethodsToGen.ConfigBinder_Get_TypeOf_BinderOptions)) 55EmitStartDefinition_Get_Or_GetValue_Overload(MethodsToGen.ConfigBinder_Get_TypeOf_BinderOptions, documentation); 66if (ShouldEmitMethods(MethodsToGen.ConfigBinder_GetValue_T_key)) 68EmitStartDefinition_Get_Or_GetValue_Overload(MethodsToGen.ConfigBinder_GetValue_T_key, documentation); 73if (ShouldEmitMethods(MethodsToGen.ConfigBinder_GetValue_T_key_defaultValue)) 75EmitStartDefinition_Get_Or_GetValue_Overload(MethodsToGen.ConfigBinder_GetValue_T_key_defaultValue, documentation); 81if (ShouldEmitMethods(MethodsToGen.ConfigBinder_GetValue_TypeOf_key)) 83EmitStartDefinition_Get_Or_GetValue_Overload(MethodsToGen.ConfigBinder_GetValue_TypeOf_key, documentation); 88if (ShouldEmitMethods(MethodsToGen.ConfigBinder_GetValue_TypeOf_key_defaultValue)) 90EmitStartDefinition_Get_Or_GetValue_Overload(MethodsToGen.ConfigBinder_GetValue_TypeOf_key_defaultValue, documentation); 107if (!ShouldEmitMethods(MethodsToGen.ConfigBinder_Bind)) 114if (ShouldEmitMethods(MethodsToGen.ConfigBinder_Bind_instance)) 123if (ShouldEmitMethods(MethodsToGen.ConfigBinder_Bind_instance_BinderOptions)) 132if (ShouldEmitMethods(MethodsToGen.ConfigBinder_Bind_key_instance)) 170private void EmitStartDefinition_Get_Or_GetValue_Overload(MethodsToGen overload, string documentation)
Emitter\CoreBindingHelpers.cs (1)
465ShouldEmitMethods(MethodsToGen.ConfigBinder_Bind_instance_BinderOptions))
Emitter\Helpers.cs (4)
141private bool ShouldEmitMethods(MethodsToGen methods) => (_interceptorInfo.MethodsToGen & methods) != 0; 143private void EmitInterceptsLocationAnnotations(MethodsToGen overload) 152overload is MethodsToGen.ServiceCollectionExt_Configure_T_name_BinderOptions || 153overload is MethodsToGen.OptionsBuilderExt_Bind_T_BinderOptions);
Emitter\OptionsBuilderConfigurationExtensions.cs (8)
12if (!ShouldEmitMethods(MethodsToGen.OptionsBuilderExt_Any)) 25if (!ShouldEmitMethods(MethodsToGen.OptionsBuilderExt_Bind)) 33if (ShouldEmitMethods(MethodsToGen.OptionsBuilderExt_Bind_T)) 35EmitMethodStartBlock(MethodsToGen.OptionsBuilderExt_Bind_T, "Bind", paramList, documentation); 41MethodsToGen.OptionsBuilderExt_Bind_T_BinderOptions, 58if (!ShouldEmitMethods(MethodsToGen.OptionsBuilderExt_BindConfiguration_T_path_BinderOptions)) 66EmitMethodStartBlock(MethodsToGen.OptionsBuilderExt_BindConfiguration, "BindConfiguration", paramList, documentation); 95private void EmitMethodStartBlock(MethodsToGen method, string methodName, string paramList, string documentation)
Emitter\OptionsConfigurationServiceCollectionExtensions.cs (9)
12if (!ShouldEmitMethods(MethodsToGen.ServiceCollectionExt_Any)) 27if (ShouldEmitMethods(MethodsToGen.ServiceCollectionExt_Configure_T)) 29EmitStartMethod(MethodsToGen.ServiceCollectionExt_Configure_T, configParam); 34if (ShouldEmitMethods(MethodsToGen.ServiceCollectionExt_Configure_T_name)) 37MethodsToGen.ServiceCollectionExt_Configure_T_name, 43if (ShouldEmitMethods(MethodsToGen.ServiceCollectionExt_Configure_T_BinderOptions)) 46MethodsToGen.ServiceCollectionExt_Configure_T_BinderOptions, 55EmitStartMethod(MethodsToGen.ServiceCollectionExt_Configure_T_name_BinderOptions, paramList: $"string? {Identifier.name}, " + configParam + $", {TypeDisplayString.NullableActionOfBinderOptions} {Identifier.configureOptions}"); 66private void EmitStartMethod(MethodsToGen overload, string paramList)
Parser\ConfigurationBinder.cs (27)
50MethodsToGen overload = MethodsToGen.None; 54overload = MethodsToGen.ConfigBinder_Bind_instance; 60overload = MethodsToGen.ConfigBinder_Bind_key_instance; 64overload = MethodsToGen.ConfigBinder_Bind_instance_BinderOptions; 68if (overload is MethodsToGen.None) 75MethodsToGen.ConfigBinder_Bind_instance => 1, 76MethodsToGen.ConfigBinder_Bind_instance_BinderOptions => 1, 77MethodsToGen.ConfigBinder_Bind_key_instance => 2, 145MethodsToGen overload = MethodsToGen.None; 159overload = MethodsToGen.ConfigBinder_Get_T; 163overload = MethodsToGen.ConfigBinder_Get_T_BinderOptions; 177overload = MethodsToGen.ConfigBinder_Get_TypeOf; 181overload = MethodsToGen.ConfigBinder_Get_TypeOf_BinderOptions; 195MethodsToGen overload = MethodsToGen.None; 209overload = MethodsToGen.ConfigBinder_GetValue_T_key; 213overload = MethodsToGen.ConfigBinder_GetValue_T_key_defaultValue; 232overload = MethodsToGen.ConfigBinder_GetValue_TypeOf_key; 236overload = MethodsToGen.ConfigBinder_GetValue_TypeOf_key_defaultValue; 256MethodsToGen overload = typeParseInfo.BindingOverload; 258Debug.Assert((MethodsToGen.ConfigBinder_Any & overload) is not 0); 260if ((MethodsToGen.ConfigBinder_Bind & overload) is not 0) 270Debug.Assert((MethodsToGen.ConfigBinder_Get & overload) is not 0 || 271(MethodsToGen.ConfigBinder_GetValue & overload) is not 0); 273bool registered = (MethodsToGen.ConfigBinder_Get & overload) is not 0
Parser\Extensions.cs (2)
23public MethodsToGen BindingOverload { get; private init; } 27public static TypeParseInfo Create(ITypeSymbol typeSymbol, MethodsToGen overload, BinderInvocation invocation, ContainingTypeDiagnosticInfo? containingTypeDiagInfo = null) =>
Parser\OptionsBuilderConfigurationExtensions.cs (10)
56MethodsToGen overload = paramCount switch 582 => MethodsToGen.OptionsBuilderExt_Bind_T, 60MethodsToGen.OptionsBuilderExt_Bind_T_BinderOptions, 61_ => MethodsToGen.None 64if (overload is not MethodsToGen.None) 82EnqueueTargetTypeForRootInvocation(type, MethodsToGen.OptionsBuilderExt_BindConfiguration_T_path_BinderOptions, invocation); 88MethodsToGen overload = typeParseInfo.BindingOverload; 89Debug.Assert((MethodsToGen.OptionsBuilderExt_Any & overload) is not 0); 96if ((MethodsToGen.OptionsBuilderExt_Bind & overload) is not 0) 98if (!TryRegisterTypeForOverloadGen_ServiceCollectionExt(MethodsToGen.ServiceCollectionExt_Configure_T_name_BinderOptions, complexTypeSpec))
Parser\OptionsConfigurationServiceCollectionExtensions.cs (8)
33MethodsToGen overload; 37overload = MethodsToGen.ServiceCollectionExt_Configure_T; 47overload = MethodsToGen.ServiceCollectionExt_Configure_T_name; 52overload = MethodsToGen.ServiceCollectionExt_Configure_T_BinderOptions; 64overload = MethodsToGen.ServiceCollectionExt_Configure_T_name_BinderOptions; 81MethodsToGen overload = typeParseInfo.BindingOverload; 90private bool TryRegisterTypeForOverloadGen_ServiceCollectionExt(MethodsToGen overload, ComplexTypeSpec typeSpec) 92Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & overload) is not 0);
Specs\InterceptorInfo.cs (23)
20public required MethodsToGen MethodsToGen { get; init; } 31public IEnumerable<InvocationLocationInfo>? GetInfo(MethodsToGen interceptor) 33Debug.Assert((MethodsToGen.ConfigBinder_Bind & interceptor) is 0); 36if (((MethodsToGen.ConfigBinder_Any & ~MethodsToGen.ConfigBinder_Bind) & interceptor) is not 0) 40else if ((MethodsToGen.OptionsBuilderExt_Any & interceptor) is not 0) 46Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & interceptor) is not 0); 63public MethodsToGen MethodsToGen { get; set; } 65public void RegisterInterceptor_ConfigBinder_Bind(MethodsToGen overload, ComplexTypeSpec type, IInvocationOperation invocation) 67Debug.Assert((MethodsToGen.ConfigBinder_Bind & overload) is not 0); 71case MethodsToGen.ConfigBinder_Bind_instance: 74case MethodsToGen.ConfigBinder_Bind_instance_BinderOptions: 77case MethodsToGen.ConfigBinder_Bind_key_instance: 91public void RegisterInterceptor(MethodsToGen overload, IInvocationOperation operation) 93Debug.Assert((MethodsToGen.ConfigBinder_Bind & overload) is 0); 95if (((MethodsToGen.ConfigBinder_Any & ~MethodsToGen.ConfigBinder_Bind) & overload) is not 0) 99else if ((MethodsToGen.OptionsBuilderExt_Any & overload) is not 0) 105Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & overload) is not 0); 138public void RegisterInterceptor(MethodsToGen overload, ComplexTypeSpec type, IInvocationOperation invocation) 156public sealed class Builder(MethodsToGen Overload, ComplexTypeSpec TargetType) 171public InvocationLocationInfo(MethodsToGen interceptor, IInvocationOperation invocation) 208public MethodsToGen Interceptor { get; }