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