6 types derived from ConstructorInfo
System.Private.CoreLib (4)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\ConstructorBuilder.cs (1)
6public abstract class ConstructorBuilder : ConstructorInfo
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\ConstructorOnTypeBuilderInstantiation.cs (1)
8internal sealed partial class ConstructorOnTypeBuilderInstantiation : ConstructorInfo
src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeConstructorInfo.cs (1)
11internal sealed partial class RuntimeConstructorInfo : ConstructorInfo
src\System\Reflection\RuntimeConstructorInfo.CoreCLR.cs (1)
15internal sealed partial class RuntimeConstructorInfo : ConstructorInfo, IRuntimeMethodInfo
System.Reflection.Context (1)
System\Reflection\Context\Delegation\DelegatingConstructorInfo.cs (1)
10internal class DelegatingConstructorInfo : ConstructorInfo
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\General\TypeExtensions.net.cs (1)
31internal abstract class LeveledConstructorInfo : ConstructorInfo
990 references to ConstructorInfo
Aspire.Hosting.Tests (1)
UserSecretsParameterDefaultTests.cs (1)
16private static readonly ConstructorInfo s_userSecretsIdAttrCtor = typeof(UserSecretsIdAttribute).GetConstructor([typeof(string)])!;
dotnet-svcutil-lib (58)
FrameworkFork\Microsoft.CodeDom\Compiler\CompilerInfo.cs (2)
79ConstructorInfo ci = CodeDomProviderType.GetConstructor(new Type[] { typeof(IDictionary<string, string>) }); 94ConstructorInfo constructor = CodeDomProviderType.GetConstructor(new Type[] { typeof(IDictionary<string, string>) });
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (4)
643internal void Call(ConstructorInfo ctor) 649internal void New(ConstructorInfo constructorInfo) 1171ConstructorInfo Decimal_ctor = typeof(Decimal).GetConstructor( 1184ConstructorInfo DateTime_ctor = typeof(DateTime).GetConstructor(new Type[] { typeof(Int64) });
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (1)
1256ConstructorInfo ctor = type.GetConstructor(new Type[0]);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (7)
169ConstructorInfo Hashtable_ctor = typeof(Hashtable).GetConstructor(CodeGenerator.EmptyTypeArray); 275ConstructorInfo readerCtor = CreatedTypes[readerClass].GetConstructor(CodeGenerator.EmptyTypeArray); 286ConstructorInfo writerCtor = CreatedTypes[writerClass].GetConstructor(CodeGenerator.EmptyTypeArray); 420ConstructorInfo ctor = CreatedTypes[(string)serializers[key]].GetConstructor(CodeGenerator.EmptyTypeArray); 459ConstructorInfo ctor = CreatedTypes[(string)serializers[xmlMappings[i].Key]].GetConstructor(CodeGenerator.EmptyTypeArray); 500ConstructorInfo ctor = CreatedTypes[readerType].GetConstructor(CodeGenerator.EmptyTypeArray); 531ConstructorInfo baseCtor = typeof(XmlSerializerImplementation).GetConstructor(CodeGenerator.EmptyTypeArray);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (4)
258ConstructorInfo XmlQualifiedName_ctor = typeof(XmlQualifiedName).GetConstructor(new Type[] { typeof(String), typeof(String) }); 1253ConstructorInfo StringBuilder_ctor = typeof(StringBuilder).GetConstructor(CodeGenerator.EmptyTypeArray); 2510ConstructorInfo ctor = type.GetConstructor(CodeGenerator.EmptyTypeArray); 2551ConstructorInfo XElement_ctor = type.GetConstructor(new Type[] { xName });
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (6)
271internal ConstructorInfo KeyValuePairAdapterConstructorInfo 290internal ConstructorInfo GetNonAttributedTypeConstructor() 1361private ConstructorInfo _keyValuePairCtorInfo; 1379internal ConstructorInfo KeyValuePairAdapterConstructorInfo 1389internal ConstructorInfo GetNonAttributedTypeConstructor() 1399ConstructorInfo ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Array.Empty<Type>());
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (2)
614internal void Call(ConstructorInfo ctor) 621internal void New(ConstructorInfo constructorInfo)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (8)
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) 433internal ConstructorInfo Constructor 577private readonly ConstructorInfo _constructor; 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) 827internal ConstructorInfo Constructor 1083ConstructorInfo defaultCtor = null;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (4)
2236static internal bool ConstructorRequiresMemberAccess(ConstructorInfo ctor) 2293else if (member is ConstructorInfo) 2295ConstructorInfo constructor = (ConstructorInfo)member;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (2)
1029internal static ConstructorInfo GetConstructor(this Type type, BindingFlags bindingFlags, Type[] parameterTypes) 1033return constructorInfo != null ? (ConstructorInfo)constructorInfo : null;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlDataContract.cs (4)
355private ConstructorInfo GetConstructor() 362ConstructorInfo ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Array.Empty<Type>()); 419ConstructorInfo ctor = GetConstructor(); 430ConstructorInfo XElement_ctor = type.GetConstructor(
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (4)
90private static ConstructorInfo s_dictionaryEnumeratorCtor; 91internal static ConstructorInfo DictionaryEnumeratorCtor 215private static ConstructorInfo s_hashtableCtor; 216internal static ConstructorInfo HashtableCtor
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatReaderGenerator.cs (1)
504ConstructorInfo constructor = collectionContract.Constructor;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatWriterGenerator.cs (1)
426ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(Globals.ScanAllMembers, new Type[] { ctorParam });
FrameworkFork\System.ServiceModel\Extensions\ReflectionExtensions.cs (3)
26public static ConstructorInfo GetConstructor(this Type type, BindingFlags bindingAttr, object binder, Type[] types, object[] modifiers) 172public static bool IsPublic(this ConstructorInfo ci) 176public static object Invoke(this ConstructorInfo ci, BindingFlags invokeAttr, object binder, object[] parameters, CultureInfo culture)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (3)
25private ConstructorInfo[] _handlerCtors; 51_handlerCtors = new ConstructorInfo[handlers.Length]; 69ConstructorInfo ctorInfo = handler.GetConstructor(Array.Empty<Type>());
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ClientClassGenerator.cs (1)
145private static void DebugCheckTable_ValidateCtor(ConstructorInfo ctor, string[] paramNames)
Metadata\ServiceDescriptor.cs (1)
275ConstructorInfo ctor = wsdlImporterType.GetConstructor(
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
49var ctor = typeof(ConsoleCancelEventArgs)
Microsoft.AspNetCore.Authentication.Test (2)
JwtBearerTests.cs (1)
1039var constructor = ExceptionType.GetTypeInfo().GetConstructor(new[] { typeof(string) });
JwtBearerTests_Handler.cs (1)
1109var constructor = ExceptionType.GetTypeInfo().GetConstructor(new[] { typeof(string) });
Microsoft.AspNetCore.Components (9)
src\Http\Routing\src\ParameterPolicyActivator.cs (9)
99ConstructorInfo? activationConstructor; 146private static List<ConstructorInfo> GetMatchingConstructors(ConstructorInfo[] constructors, IServiceProvider? serviceProvider, int argumentsLength) 148var result = new List<ConstructorInfo>(); 149foreach (var constructor in constructors) 159private static ConstructorInfo GetLongestConstructor(List<ConstructorInfo> constructors, Type parameterPolicyType) 164ConstructorInfo? longest = null; 167foreach (var constructor in constructors)
Microsoft.AspNetCore.Components.Endpoints (1)
FormMapping\Metadata\FormDataTypeMetadata.cs (1)
20public ConstructorInfo? Constructor { get; set; }
Microsoft.AspNetCore.Connections.Abstractions (3)
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (3)
35foreach (var constructor in instanceType.GetConstructors()) 99private readonly ConstructorInfo _constructor; 103public ConstructorMatcher(ConstructorInfo constructor)
Microsoft.AspNetCore.DataProtection (2)
SimpleActivator.cs (2)
41var ctorParameterless = implementationType.GetConstructor(Type.EmptyTypes); 49var ctorWhichTakesServiceProvider = implementationType.GetConstructor(_serviceProviderTypeArray);
Microsoft.AspNetCore.Http.Extensions (11)
RequestDelegateFactory.cs (3)
111private static readonly ConstructorInfo DefaultEndpointFilterInvocationContextConstructor = typeof(DefaultEndpointFilterInvocationContext).GetConstructor(new[] { typeof(HttpContext), typeof(object[]) })!; 121private static readonly ConstructorInfo FormDataReaderConstructor = typeof(FormDataReader).GetConstructor(new[] { typeof(IReadOnlyDictionary<FormKey, StringValues>), typeof(CultureInfo), typeof(Memory<char>), typeof(IFormFileCollection) })!; 624var constructor = constructorType.MakeGenericType(factoryContext.ArgumentTypes!).GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance).SingleOrDefault();
src\Components\Endpoints\src\FormMapping\Metadata\FormDataTypeMetadata.cs (1)
20public ConstructorInfo? Constructor { get; set; }
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
20private static readonly ConstructorInfo _objectMethodExecutorAwaitableConstructor =
src\Shared\ParameterBindingMethodCache.cs (6)
48private readonly ConcurrentDictionary<Type, (ConstructorInfo?, ConstructorParameter[])> _constructorCache = new(); 313public (ConstructorInfo?, ConstructorParameter[]) FindConstructor(Type type) 315static (ConstructorInfo? constructor, ConstructorParameter[] parameters) Finder(Type type) 317var constructor = GetConstructor(type); 359private static ConstructorInfo? GetConstructor(Type type) 377var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0);
Microsoft.AspNetCore.InternalTesting (1)
xunit\AspNetTestAssemblyRunner.cs (1)
58var ctorWithDiagnostics = fixtureAttribute
Microsoft.AspNetCore.InternalTesting.Tests (4)
TestableAssembly.cs (4)
52var frameworkConstructor = typeof(TestFrameworkAttribute) 58var fixtureConstructor = typeof(AssemblyFixtureAttribute).GetConstructor(new[] { typeof(Type) }); 61var outputConstructor = typeof(TestOutputDirectoryAttribute).GetConstructor( 77var factConstructor = typeof(FactAttribute).GetConstructor(Array.Empty<Type>());
Microsoft.AspNetCore.Mvc.Abstractions (11)
ModelBinding\Metadata\ModelMetadataIdentity.cs (3)
18ConstructorInfo? constructorInfo = null) 108public static ModelMetadataIdentity ForConstructor(ConstructorInfo constructor, Type modelType) 177public ConstructorInfo? ConstructorInfo { get; }
ModelBinding\ModelMetadataProvider.cs (2)
59/// <param name="constructor">The <see cref="ConstructorInfo"/>.</param> 62public virtual ModelMetadata GetMetadataForConstructor(ConstructorInfo constructor, Type modelType)
src\Shared\ParameterBindingMethodCache.cs (6)
48private readonly ConcurrentDictionary<Type, (ConstructorInfo?, ConstructorParameter[])> _constructorCache = new(); 313public (ConstructorInfo?, ConstructorParameter[]) FindConstructor(Type type) 315static (ConstructorInfo? constructor, ConstructorParameter[] parameters) Finder(Type type) 317var constructor = GetConstructor(type); 359private static ConstructorInfo? GetConstructor(Type type) 377var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0);
Microsoft.AspNetCore.Mvc.Core (13)
ModelBinding\Metadata\BindingMetadata.cs (2)
103/// Gets or sets the <see cref="ConstructorInfo"/> used to model bind and validate the model type. 105public ConstructorInfo? BoundConstructor { get; set; }
ModelBinding\Metadata\DefaultBindingMetadataProvider.cs (5)
74if (GetBoundConstructor(context.Key.ModelType) is ConstructorInfo constructorInfo) 80internal static ConstructorInfo? GetBoundConstructor(Type type) 96private static ConstructorInfo? GetRecordTypeConstructor(Type type, ConstructorInfo[] constructors) 113var constructor = constructors[0];
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (5)
135public override ModelMetadata GetMetadataForConstructor(ConstructorInfo constructorInfo, Type modelType) 183private ModelMetadataCacheEntry GetCacheEntry(ConstructorInfo constructor, Type modelType) 233var constructor = constructorKey.ConstructorInfo; 253static Func<object?[], object> CreateObjectFactory(ConstructorInfo constructor) 265ConstructorInfo constructor,
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
20private static readonly ConstructorInfo _objectMethodExecutorAwaitableConstructor =
Microsoft.AspNetCore.Mvc.Core.Test (16)
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (10)
668var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); 686var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); 704var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); 723var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); 740var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); 771var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); 793var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); 806var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); 837var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); 865var result = DefaultBindingMetadataProvider.GetBoundConstructor(type);
ModelBinding\Metadata\DefaultModelMetadataTest.cs (6)
1331var constructor = modelType.GetConstructors().Single(); 1375var constructor = modelType.GetConstructors().Single(); 1420var constructor = modelType.GetConstructors().Single(); 1465var constructor = modelType.GetConstructors().Single(); 1510var constructor = modelType.GetConstructors().Single(); 1555var constructor = modelType.GetConstructors().Single();
Microsoft.AspNetCore.Mvc.Formatters.Xml (1)
EnumerableWrapperProvider.cs (1)
16private readonly ConstructorInfo _wrappingTypeConstructor;
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewDataDictionaryFactory.cs (2)
17var constructor = type.GetConstructor(new[] { typeof(IModelMetadataProvider), typeof(ModelStateDictionary) }); 38var constructor = type.GetConstructor(new[] { typeof(ViewDataDictionary) });
Microsoft.AspNetCore.OpenApi (7)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
20private static readonly ConstructorInfo _objectMethodExecutorAwaitableConstructor =
src\Shared\ParameterBindingMethodCache.cs (6)
48private readonly ConcurrentDictionary<Type, (ConstructorInfo?, ConstructorParameter[])> _constructorCache = new(); 313public (ConstructorInfo?, ConstructorParameter[]) FindConstructor(Type type) 315static (ConstructorInfo? constructor, ConstructorParameter[] parameters) Finder(Type type) 317var constructor = GetConstructor(type); 359private static ConstructorInfo? GetConstructor(Type type) 377var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0);
Microsoft.AspNetCore.Routing (9)
ParameterPolicyActivator.cs (9)
99ConstructorInfo? activationConstructor; 146private static List<ConstructorInfo> GetMatchingConstructors(ConstructorInfo[] constructors, IServiceProvider? serviceProvider, int argumentsLength) 148var result = new List<ConstructorInfo>(); 149foreach (var constructor in constructors) 159private static ConstructorInfo GetLongestConstructor(List<ConstructorInfo> constructors, Type parameterPolicyType) 164ConstructorInfo? longest = null; 167foreach (var constructor in constructors)
Microsoft.AspNetCore.Shared.Tests (4)
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (3)
35foreach (var constructor in instanceType.GetConstructors()) 99private readonly ConstructorInfo _constructor; 103public ConstructorMatcher(ConstructorInfo constructor)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
20private static readonly ConstructorInfo _objectMethodExecutorAwaitableConstructor =
Microsoft.AspNetCore.SignalR.Core (5)
Internal\TypedClientBuilder.cs (4)
21private static readonly ConstructorInfo ObjectConstructor = typeof(object).GetConstructors().Single(); 58var ctor = BuildConstructor(type, proxyField); 94private static ConstructorInfo BuildConstructor(TypeBuilder type, FieldInfo proxyField) 239private static void BuildFactoryMethod(TypeBuilder type, ConstructorInfo ctor)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
20private static readonly ConstructorInfo _objectMethodExecutorAwaitableConstructor =
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
TestConnectionMultiplexer.cs (1)
426var ctor = typeof(ChannelMessageQueue).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic,
Microsoft.Build (6)
BackEnd\Components\Communications\TranslatorExtensions.cs (5)
23private static Lazy<ConcurrentDictionary<Type, ConstructorInfo>> parameterlessConstructorCache = new Lazy<ConcurrentDictionary<Type, ConstructorInfo>>(() => new ConcurrentDictionary<Type, ConstructorInfo>()); 82var parameterlessConstructor = parameterlessConstructorCache.Value.GetOrAdd( 86ConstructorInfo constructor = null;
Evaluation\Expander.cs (1)
5596functionResult = ((ConstructorInfo)memberInfo).Invoke(args);
Microsoft.Build.Engine.UnitTests (1)
BackEnd\TaskThatThrows.cs (1)
28ConstructorInfo? ctor = exceptionType.GetConstructor([typeof(string)]);
Microsoft.Build.Tasks.CodeAnalysis (3)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes) 118public static T? InvokeConstructor<T>(this ConstructorInfo? constructorInfo, params object?[] args) 138public static object? InvokeConstructor(this ConstructorInfo constructorInfo, params object?[] args)
Microsoft.Build.Tasks.Core (1)
StateFileBase.cs (1)
100foreach (var constructor in constructors)
Microsoft.CodeAnalysis (3)
InternalUtilities\ReflectionUtilities.cs (3)
102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes) 118public static T? InvokeConstructor<T>(this ConstructorInfo? constructorInfo, params object?[] args) 138public static object? InvokeConstructor(this ConstructorInfo constructorInfo, params object?[] args)
Microsoft.CodeAnalysis.CodeStyle (3)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes) 118public static T? InvokeConstructor<T>(this ConstructorInfo? constructorInfo, params object?[] args) 138public static object? InvokeConstructor(this ConstructorInfo constructorInfo, params object?[] args)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ObjectFormatterTests.cs (1)
885var constructor = typeof(object).GetTypeInfo().DeclaredConstructors.Single();
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (3)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes) 118public static T? InvokeConstructor<T>(this ConstructorInfo? constructorInfo, params object?[] args) 138public static object? InvokeConstructor(this ConstructorInfo constructorInfo, params object?[] args)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (6)
Debugger\MemberInfo\ConstructorInfoImpl.cs (2)
18internal readonly System.Reflection.ConstructorInfo Constructor; 20internal ConstructorInfoImpl(System.Reflection.ConstructorInfo constructor)
Debugger\MemberInfo\TypeImpl.cs (1)
217return new ConstructorInfoImpl((System.Reflection.ConstructorInfo)member);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes) 118public static T? InvokeConstructor<T>(this ConstructorInfo? constructorInfo, params object?[] args) 138public static object? InvokeConstructor(this ConstructorInfo constructorInfo, params object?[] args)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Protocol\Converters\SumConverter.cs (2)
150public UnionTypeInfo(Type type, ConstructorInfo constructor, KindAttribute? kindAttribute) 171public ConstructorInfo Constructor { get; }
Microsoft.CodeAnalysis.Test.Utilities (4)
Metadata\ILValidation.cs (1)
209private static ConstructorInfo s_blobCtor;
Platform\Custom\MetadataSignatureHelper.cs (3)
457private static void AppendConstructorInfo(ConstructorInfo constructor, StringBuilder sb) 672foreach (var constructor in type.GetConstructors(BINDING_FLAGS).OrderBy((member) => member.Name)) 721foreach (var constructor in type.GetConstructors(BINDING_FLAGS))
Microsoft.CodeAnalysis.Workspaces (3)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes) 118public static T? InvokeConstructor<T>(this ConstructorInfo? constructorInfo, params object?[] args) 138public static object? InvokeConstructor(this ConstructorInfo constructorInfo, params object?[] args)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (3)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
102internal static ConstructorInfo? GetDeclaredConstructor(this TypeInfo typeInfo, params Type[] paramTypes) 118public static T? InvokeConstructor<T>(this ConstructorInfo? constructorInfo, params object?[] args) 138public static object? InvokeConstructor(this ConstructorInfo constructorInfo, params object?[] args)
Microsoft.CSharp (11)
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (1)
467ConstructorInfo constructor = ((ExprMethodInfo)list.OptionalElement).ConstructorInfo;
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (2)
61if (mi1 is ConstructorInfo ctor1) 63return mi2 is ConstructorInfo ctor2
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MethodInfo.cs (4)
96public ConstructorInfo ConstructorInfo 108ConstructorInfo ctorInfo = (ConstructorInfo)methSym.AssociatedMemberInfo; 118foreach (ConstructorInfo c in type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static))
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
171new PredefinedTypeInfo(PredefinedType.PT_CONSTRUCTORINFO, typeof(System.Reflection.ConstructorInfo), "System.Reflection.ConstructorInfo"),
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (3)
197else if (member is ConstructorInfo ctor) 1309foreach (ConstructorInfo c in t.GetConstructors()) 1339Debug.Assert(method != null || member is ConstructorInfo);
Microsoft.DotNet.Internal.DependencyInjection.Testing (3)
DependencyInjectionValidation.cs (3)
96ConstructorInfo[] constructors = type 108foreach (ConstructorInfo ctor in constructors) 126ConstructorInfo ctor,
Microsoft.DotNet.Open.Api.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
49var ctor = typeof(ConsoleCancelEventArgs)
Microsoft.Extensions.AI.Abstractions (9)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (9)
152TryGetDeserializationConstructor(type, useDefaultCtorInAnnotatedStructs: true, out ConstructorInfo? ctor)) 340out ConstructorInfo? deserializationCtor) 342ConstructorInfo? ctorWithAttribute = null; 343ConstructorInfo? publicParameterlessCtor = null; 344ConstructorInfo? lonePublicCtor = null; 346ConstructorInfo[] constructors = type.GetConstructors(BindingFlags.Public | BindingFlags.Instance); 353foreach (ConstructorInfo constructor in constructors) 372foreach (ConstructorInfo constructor in type.GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance)) 396static bool HasJsonConstructorAttribute(ConstructorInfo constructorInfo) =>
Microsoft.Extensions.ApiDescription.Tool.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
49var ctor = typeof(ConsoleCancelEventArgs)
Microsoft.Extensions.Configuration.Binder (2)
ConfigurationBinder.cs (2)
510ConstructorInfo[] constructors = type.GetConstructors(BindingFlags.Public | BindingFlags.Instance); 527ConstructorInfo constructor = constructors[0];
Microsoft.Extensions.DependencyInjection (7)
ServiceLookup\CallSiteFactory.cs (3)
467ConstructorInfo[] constructors = implementationType.GetConstructors(); 477ConstructorInfo constructor = constructors[0]; 497ConstructorInfo? bestConstructor = null;
ServiceLookup\ConstructorCallSite.cs (3)
11internal ConstructorInfo ConstructorInfo { get; } 14public ConstructorCallSite(ResultCache cache, Type serviceType, ConstructorInfo constructorInfo) : this(cache, serviceType, constructorInfo, Array.Empty<ServiceCallSite>()) 18public ConstructorCallSite(ResultCache cache, Type serviceType, ConstructorInfo constructorInfo, ServiceCallSite[] parameterCallSites) : base(cache)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (1)
37private static readonly ConstructorInfo CacheKeyCtor = typeof(ServiceCacheKey).GetConstructors()[0];
Microsoft.Extensions.DependencyInjection.Abstractions (13)
ActivatorUtilities.cs (13)
186FindApplicableConstructor(instanceType, argumentTypes, constructors, out ConstructorInfo constructorInfo, out int?[] parameterMap); 254ConstructorInfo[] constructors = type.GetConstructors(); 336FindApplicableConstructor(instanceType, argumentTypes, constructors: null, out ConstructorInfo constructor, out int?[] parameterMap); 396ConstructorInfo constructor, 451FindApplicableConstructor(instanceType, argumentTypes, constructors: null, out ConstructorInfo constructor, out int?[] parameterMap); 569out ConstructorInfo matchingConstructor, 572ConstructorInfo? constructorInfo; 586private static ConstructorInfoEx FindConstructorEx(ConstructorInfo constructorInfo, ConstructorInfoEx[] constructorExs) 604[NotNullWhen(true)] out ConstructorInfo? matchingConstructor, 610foreach (ConstructorInfo? constructor in instanceType.GetConstructors()) 638[NotNullWhen(true)] out ConstructorInfo? matchingConstructor, 724public readonly ConstructorInfo Info; 740public ConstructorInfoEx(ConstructorInfo constructor)
Microsoft.Extensions.SecretManager.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
49var ctor = typeof(ConsoleCancelEventArgs)
Microsoft.ML.Core (7)
CommandLine\CmdParser.cs (1)
1417private readonly ConstructorInfo _ctorCustom;
ComponentModel\ComponentCatalog.cs (6)
36internal static AccessModifier Accessmodifier(this ConstructorInfo constructorInfo) 174public ConstructorInfo Constructor { get; } 200internal LoadableClassInfo(LoadableClassAttributeBase attr, MethodInfo getter, ConstructorInfo ctor, MethodInfo create, bool requireEnvironment) 312var ctor = ArgType.GetConstructor(Type.EmptyTypes); 459out MethodInfo getter, out ConstructorInfo ctor, out MethodInfo create, out bool requireEnvironment) 694ConstructorInfo ctor = null;
Microsoft.ML.Data (9)
Data\DataViewUtils.cs (1)
874var constructor = pipeType.GetConstructor(new Type[] { typeof(object) });
DataView\CacheDataView.cs (1)
1301var constructor = pipeType.GetConstructor(_pipeConstructorTypes);
Prediction\Calibrator.cs (1)
830var genericCtor = constructed.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, constructorArgs, null);
Scorers\PredictionTransformer.cs (4)
790var genericCtor = CreateConstructor(model.GetType(), predictionTransformerType); 801var genericCtor = CreateConstructor(model.GetType(), predictionTransformerType); 807private static ConstructorInfo CreateConstructor(Type modelType, Type predictionTransformerType) 820var genericCtor = constructedType.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, constructorArgs, null);
Transforms\Hashing.cs (1)
1520var constructorInfo = t.GetConstructor(consTypes);
Transforms\RowShufflingTransformer.cs (1)
388var constructor = pipeType.GetConstructor(_pipeConstructorTypes);
Microsoft.ML.Transforms (1)
GroupTransform.cs (1)
456var cons = type.MakeGenericType(colType.RawType).GetConstructor(new[] { typeof(DataViewRow), typeof(int) });
Microsoft.VisualBasic.Core (9)
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (1)
1222IsStatic = DirectCast(Member, ConstructorInfo).IsStatic
Microsoft\VisualBasic\CompilerServices\Symbols.vb (1)
660Return DirectCast(member, ConstructorInfo).IsStatic
Microsoft\VisualBasic\CompilerServices\Utils.vb (6)
198If TypeOf mi1 Is ConstructorInfo AndAlso TypeOf mi2 Is ConstructorInfo Then 199Dim ctor1 As ConstructorInfo = DirectCast(mi1, ConstructorInfo) 200Dim ctor2 As ConstructorInfo = DirectCast(mi2, ConstructorInfo)
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (1)
2296Return DirectCast(Member, ConstructorInfo).IsPublic
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
420[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.ConstructorInfo))]
netstandard (1)
netstandard.cs (1)
1387[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.ConstructorInfo))]
PresentationBuildTasks (9)
MS\Internal\MarkupCompiler\MarkupCompiler.cs (3)
1862else if (desc.MemberInfo is ConstructorInfo) // instance ctor invoke 1864ConstructorInfo ci = (ConstructorInfo)desc.MemberInfo;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (4)
1208ConstructorInfo[] constructors = extensionType.GetConstructors(BindingFlags.Public | BindingFlags.Instance); 1210foreach (ConstructorInfo ctor in constructors) 1311ConstructorInfo[] infos = data.TargetType.GetConstructors(BindingFlags.Public | BindingFlags.Instance); 1314ConstructorInfo info = infos[i];
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsCache.cs (1)
230ConstructorInfo cinfo = data.Constructor;
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
330ConstructorInfo cinfo = cad.Constructor;
PresentationCore (11)
MS\Internal\TextFormatting\FullTextLine.cs (1)
423ConstructorInfo constructor = t.GetConstructor(
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\WindowsRuntime\ReflectionHelper.cs (3)
310ConstructorInfo constructor = type.GetConstructor(Type.EmptyTypes); 335ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(TArg1) }); 362ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(TArg1), typeof(TArg2) });
System\Windows\FontStyleConverter.cs (1)
109ConstructorInfo ci = typeof(FontStyle).GetConstructor(new Type[]{typeof(int)});
System\Windows\Ink\StrokeCollectionConverter.cs (1)
147ConstructorInfo ci = typeof(StrokeCollection).GetConstructor(new Type[] { typeof(Stream) });
System\Windows\Media\Animation\KeySplineConverter.cs (1)
110ConstructorInfo ci = typeof(KeySpline).GetConstructor(new Type[]
System\Windows\Media\PixelFormatConverter.cs (1)
114ConstructorInfo ci = typeof(PixelFormat).GetConstructor(new Type[]{typeof(string)});
System\Windows\Media\RequestCachePolicyConverter.cs (2)
127ConstructorInfo ci = typeof(HttpRequestCachePolicy).GetConstructor(new Type[] { typeof(HttpRequestCachePolicy) }); 142ConstructorInfo ci = typeof(RequestCachePolicy).GetConstructor(new Type[] { typeof(RequestCachePolicy) });
System\Windows\TextDecorationCollectionConverter.cs (1)
184ConstructorInfo ci = typeof(TextDecorationCollection).GetConstructor(
PresentationFramework (26)
MS\Internal\Annotations\Serializer.cs (1)
110private ConstructorInfo _ctor;
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (1)
884var objReferenceConstructor = HelperType.GetConstructor(BindingFlags.NonPublic | BindingFlags.CreateInstance | BindingFlags.Instance, null, new[] { fromAbiMethod.ReturnType }, null);
MS\Internal\WindowsRuntime\Generated\WinRT\ObjectReference.cs (1)
83var ctor = typeof(T).GetConstructor(new[] { typeof(IObjectReference) });
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\WindowsRuntime\ReflectionHelper.cs (3)
310ConstructorInfo constructor = type.GetConstructor(Type.EmptyTypes); 335ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(TArg1) }); 362ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(TArg1), typeof(TArg2) });
System\Windows\Controls\DataGridLengthConverter.cs (1)
146ConstructorInfo ci = typeof(DataGridLength).GetConstructor(new Type[] { typeof(double), typeof(DataGridLengthUnitType) });
System\Windows\Controls\VirtualizationCacheLengthConverter.cs (1)
152ConstructorInfo ci = typeof(VirtualizationCacheLength).GetConstructor(new Type[] { typeof(double), typeof(VirtualizationCacheLengthUnit) });
System\Windows\CornerRadiusConverter.cs (1)
149ConstructorInfo ci = typeof(CornerRadius).GetConstructor(new Type[] { typeof(double), typeof(double), typeof(double), typeof(double) });
System\Windows\Data\ListCollectionView.cs (1)
3350private ConstructorInfo _itemConstructor;
System\Windows\Data\ObjectDataProvider.cs (1)
398ConstructorInfo[] ciAry = _objectType.GetConstructors();
System\Windows\FigureLengthConverter.cs (1)
164ConstructorInfo ci = typeof(FigureLength).GetConstructor(new Type[] { typeof(double), typeof(FigureUnitType) });
System\Windows\GridLengthConverter.cs (1)
183ConstructorInfo ci = typeof(GridLength).GetConstructor(new Type[] { typeof(double), typeof(GridUnitType) });
System\Windows\LengthConverter.cs (1)
159ConstructorInfo ci = typeof(double).GetConstructor(new Type[] { typeof(double) });
System\Windows\Markup\BamlRecordReader.cs (2)
1505ConstructorInfo[] infos = data.Constructors; 1508ConstructorInfo info = infos[i];
System\Windows\Markup\MarkupExtensionParser.cs (2)
1208ConstructorInfo[] constructors = extensionType.GetConstructors(BindingFlags.Public | BindingFlags.Instance); 1210foreach (ConstructorInfo ctor in constructors)
System\Windows\Markup\Primitives\ElementMarkupObject.cs (2)
389ConstructorInfo ctorInfo = instanceDescriptor.MemberInfo as ConstructorInfo;
System\Windows\Markup\XamlTypeMapper.cs (3)
3663internal ConstructorData(ConstructorInfo[] constructors) 3699internal ConstructorInfo[] Constructors 3708private ConstructorInfo[] _constructors;
System\Windows\Standard\ErrorCodes.cs (1)
440ConstructorInfo cons = e.GetType().GetConstructor(new[] { typeof(string) });
System\Windows\ThemeModeConverter.cs (1)
113ConstructorInfo ci = typeof(ThemeMode).GetConstructor(new Type[] { typeof(string) });
System\Windows\ThicknessConverter.cs (1)
138ConstructorInfo ci = typeof(Thickness).GetConstructor(new Type[] { typeof(double), typeof(double), typeof(double), typeof(double) });
System.CodeDom (2)
System\CodeDom\Compiler\CompilerInfo.cs (2)
53ConstructorInfo ci = CodeDomProviderType.GetConstructor(new Type[] { typeof(IDictionary<string, string>) }); 70ConstructorInfo constructor = CodeDomProviderType.GetConstructor(new Type[] { typeof(IDictionary<string, string>) });
System.ComponentModel.Composition (28)
Microsoft\Internal\GenerationServices.cs (1)
39private static readonly ConstructorInfo ObjectCtor = typeof(object).GetConstructor(Type.EmptyTypes)!;
Microsoft\Internal\ReflectionInvoke.cs (1)
16public static object SafeInvoke(this ConstructorInfo constructor, params object?[]? arguments)
Microsoft\Internal\ReflectionServices.cs (1)
27public static bool IsVisible(this ConstructorInfo constructor)
System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs (8)
22private ConstructorInfo? _constructor; 47public ConstructorInfo? GetConstructor() 184private static ConstructorInfo? SelectPartConstructor(Type type) 196ConstructorInfo[] constructors = type.GetConstructors(flags); 211ConstructorInfo? importingConstructor = null; 212ConstructorInfo? defaultConstructor = null; 213foreach (ConstructorInfo constructor in constructors) 427ConstructorInfo? constructor = GetConstructor();
System\ComponentModel\Composition\MetadataViewGenerator.cs (1)
76private static readonly ConstructorInfo ObjectCtor = typeof(object).GetConstructor(Type.EmptyTypes)!;
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (5)
29private ConstructorInfo? _constructor; 70public ConstructorInfo? GetConstructor() 74ConstructorInfo? genericConstructor = _originalPartCreationInfo.GetConstructor(); 75ConstructorInfo? result = null; 78foreach (ConstructorInfo constructor in GetPartType().GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
System\ComponentModel\Composition\ReflectionModel\ImportingMember.cs (1)
145ConstructorInfo? constructor = ImportType.ActualType.GetConstructor(Type.EmptyTypes);
System\ComponentModel\Composition\ReflectionModel\IReflectionPartCreationInfo.cs (1)
14ConstructorInfo? GetConstructor();
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (2)
262ConstructorInfo? constructor = null; 415private object CreateInstance(ConstructorInfo constructor, object?[] arguments)
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePartDefinition.cs (3)
21private volatile ConstructorInfo? _constructor; 41public ConstructorInfo? GetConstructor() 45ConstructorInfo? constructor = _creationInfo.GetConstructor();
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (4)
324private ConstructorInfo? _constructor; 355public ConstructorInfo? GetConstructor() 359ConstructorInfo[]? constructors = null; 363.OfType<ConstructorInfo>()
System.ComponentModel.Composition.Registration (22)
src\libraries\Common\src\System\Composition\Diagnostics\CompositionTrace.cs (1)
142public static void Registration_ParameterImportConventionOverridden(ParameterInfo parameter, ConstructorInfo constructor)
System\ComponentModel\Composition\Registration\PartBuilder.cs (18)
24private Func<ConstructorInfo[], ConstructorInfo> _constructorFilter; 74public PartBuilder SelectConstructor(Func<ConstructorInfo[], ConstructorInfo> constructorFilter) 79public PartBuilder SelectConstructor(Func<ConstructorInfo[], ConstructorInfo> constructorFilter, 364ConstructorInfo[] constructors = type.GetConstructors(); 367foreach (ConstructorInfo ci in constructors) 380ConstructorInfo constructorInfo = _constructorFilter(constructors); 391foreach (ConstructorInfo constructorInfo in FindLongestConstructors(constructors)) 405ConstructorInfo[] constructors = type.GetConstructors(); 407foreach (ConstructorInfo constructorInfo in FindLongestConstructors(constructors)) 413private static void ConfigureConstructorAttributes(ConstructorInfo constructorInfo, ref List<Tuple<object, List<Attribute>>> configuredMembers, Action<ParameterInfo, ImportBuilder> configureConstructorImports) 538private static IEnumerable<ConstructorInfo> FindLongestConstructors(ConstructorInfo[] constructors) 540ConstructorInfo longestConstructor = null; 544foreach (ConstructorInfo candidateConstructor in constructors) 563foreach (ConstructorInfo candidateConstructor in constructors)
System\ComponentModel\Composition\Registration\PartBuilderOfT.cs (3)
75private ConstructorInfo _constructorInfo; 83public ConstructorInfo SelectConstructor(ConstructorInfo[] _)
System.ComponentModel.TypeConverter (17)
System\ComponentModel\AttributeCollection.cs (1)
269ConstructorInfo? ci = reflect.UnderlyingSystemType.GetConstructor(Type.EmptyTypes);
System\ComponentModel\DecimalConverter.cs (1)
48ConstructorInfo? ctor = typeof(decimal).GetConstructor(new Type[] { typeof(int[]) });
System\ComponentModel\Design\Serialization\InstanceDescriptor.cs (3)
53else if (member is ConstructorInfo ci) 128if (MemberInfo is ConstructorInfo) 130return ((ConstructorInfo)MemberInfo).Invoke(translatedArguments);
System\ComponentModel\GuidConverter.cs (1)
60ConstructorInfo? ctor = typeof(Guid).GetConstructor(new Type[] { typeof(string) });
System\ComponentModel\NullableConverter.cs (3)
18private static readonly ConstructorInfo s_nullableConstructor = typeof(Nullable<>).GetConstructor(typeof(Nullable<>).GetGenericArguments())!; 110ConstructorInfo ci = (ConstructorInfo)NullableType.GetMemberWithSameMetadataDefinitionAs(s_nullableConstructor);
System\ComponentModel\PropertyDescriptor.cs (1)
229ConstructorInfo? ctor = type.GetConstructor(typeArgs);
System\ComponentModel\UriTypeConverter.cs (1)
73ConstructorInfo? ctor = typeof(Uri).GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(string), typeof(UriKind) }, null);
System\ComponentModel\VersionConverter.cs (1)
74ConstructorInfo? ctor = typeof(Version).GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(int), typeof(int), typeof(int), typeof(int) }, null);
System\Drawing\PointConverter.cs (1)
84ConstructorInfo? ctor = typeof(Point).GetConstructor(new Type[] { typeof(int), typeof(int) });
System\Drawing\RectangleConverter.cs (1)
84ConstructorInfo? ctor = typeof(Rectangle).GetConstructor(new Type[] {
System\Drawing\SizeConverter.cs (1)
82ConstructorInfo? ctor = typeof(Size).GetConstructor(new Type[] { typeof(int), typeof(int) });
System\Drawing\SizeFConverter.cs (1)
79ConstructorInfo? ctor = typeof(SizeF).GetConstructor(new Type[] { typeof(float), typeof(float) });
System\Security\Authentication\ExtendedProtection\ExtendedProtectionPolicyTypeConverter.cs (1)
52ConstructorInfo? constructor = typeof(ExtendedProtectionPolicy).GetConstructor(parameterTypes);
System.Composition.Convention (24)
src\libraries\Common\src\System\Composition\Diagnostics\CompositionTrace.cs (1)
142public static void Registration_ParameterImportConventionOverridden(ParameterInfo parameter, ConstructorInfo constructor)
System\Composition\Convention\ConventionBuilder.cs (2)
198if (mi != null && (mi is ConstructorInfo || mi is TypeInfo || mi is PropertyInfo || mi is MethodInfo)) 233else if (member is PropertyInfo || member is ConstructorInfo || member is MethodInfo)
System\Composition\Convention\PartConventionBuilder.cs (18)
29private Func<IEnumerable<ConstructorInfo>, ConstructorInfo> _constructorFilter; 113public PartConventionBuilder SelectConstructor(Func<IEnumerable<ConstructorInfo>, ConstructorInfo> constructorSelector) 130public PartConventionBuilder SelectConstructor(Func<IEnumerable<ConstructorInfo>, ConstructorInfo> constructorSelector, 600ConstructorInfo[] constructors = type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly); 603foreach (ConstructorInfo ci in constructors) 616ConstructorInfo constructorInfo = _constructorFilter(constructors); 626foreach (ConstructorInfo constructorInfo in FindLongestConstructors(constructors)) 638ConstructorInfo[] constructors = type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly); 640foreach (ConstructorInfo constructorInfo in FindLongestConstructors(constructors)) 646private static void ConfigureConstructorAttributes(ConstructorInfo constructorInfo, ref List<Tuple<object, List<Attribute>>> configuredMembers, Action<ParameterInfo, ImportConventionBuilder> configureConstructorImports) 826private static IEnumerable<ConstructorInfo> FindLongestConstructors(ConstructorInfo[] constructors) 828ConstructorInfo longestConstructor = null; 832foreach (ConstructorInfo candidateConstructor in constructors) 851foreach (ConstructorInfo candidateConstructor in constructors)
System\Composition\Convention\PartConventionBuilderOfT.cs (3)
134private ConstructorInfo _constructorInfo; 142public ConstructorInfo SelectConstructor(IEnumerable<ConstructorInfo> _)
System.Composition.Hosting (2)
System\Composition\Hosting\Providers\Metadata\MetadataViewProvider.cs (2)
28var dictionaryConstructor = ti.DeclaredConstructors.SingleOrDefault(ci => 43var parameterlessConstructor = ti.DeclaredConstructors.SingleOrDefault(ci => ci.IsPublic && ci.GetParameters().Length == 0);
System.Composition.TypedParts (5)
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (5)
33private ConstructorInfo _constructor; 87foreach (var c in _partType.DeclaredConstructors.Where(ci => ci.IsPublic && !(ci.IsStatic))) 136private ConstructorInfo GetConstructorInfoFromGenericType(TypeInfo type) 141ConstructorInfo constructor = null; 145ConstructorInfo constructorInfo = genericPartTypeInfo.DeclaredConstructors.ElementAt(index);
System.Configuration.ConfigurationManager (15)
System\Configuration\MgmtConfigurationRecord.cs (9)
137ConstructorInfo ctor = TypeUtil.GetConstructor(type, typeof(ConfigurationSection), true); 146ConstructorInfo ctor = (ConstructorInfo)factoryRecord.Factory; 165private ConstructorInfo CreateSectionGroupFactory(FactoryRecord factoryRecord) 171ConstructorInfo ctor = TypeUtil.GetConstructor(type, 177private ConstructorInfo EnsureSectionGroupFactory(FactoryRecord factoryRecord) 179ConstructorInfo factory = (ConstructorInfo)factoryRecord.Factory; 261ConstructorInfo ctor = EnsureSectionGroupFactory(factoryRecord);
System\Configuration\RuntimeConfigurationRecord.cs (1)
84private ConstructorInfo _sectionCtor;
System\Configuration\TypeUtil.cs (2)
140internal static ConstructorInfo GetConstructor(Type type, Type baseType, bool throwOnError) 148ConstructorInfo ctor = type.GetConstructor(BindingFlags, null, CallingConventions.HasThis, Type.EmptyTypes,
System\Diagnostics\TraceUtils.cs (3)
57ConstructorInfo ctorInfo = objectType.GetConstructor(Array.Empty<Type>()); 66ConstructorInfo ctorInfo = objectType.GetConstructor(new Type[] { typeof(string) }); 92ConstructorInfo[] ctorInfos = objectType.GetConstructors();
System.Data.Common (5)
System\Data\Common\DataColumnMapping.cs (1)
173ConstructorInfo ctor = typeof(DataColumnMapping).GetConstructor(types)!;
System\Data\Common\DataTableMapping.cs (1)
197ConstructorInfo ctor = typeof(DataTableMapping).GetConstructor(types)!;
System\Data\ConstraintConverter.cs (2)
40Reflection.ConstructorInfo ctor = typeof(UniqueConstraint).GetConstructor(new Type[] { typeof(string), typeof(string[]), typeof(bool) })!; 49System.Reflection.ConstructorInfo ctor =
System\Data\RelationshipConverter.cs (1)
42System.Reflection.ConstructorInfo? ctor;
System.Linq.Expressions (54)
System\Dynamic\Utils\CachedReflectionInfo.cs (2)
16private static ConstructorInfo? s_InvalidCastException_Ctor_String; 17public static ConstructorInfo InvalidCastException_Ctor_String =>
System\Dynamic\Utils\TypeUtils.cs (3)
20private static readonly ConstructorInfo s_nullableConstructor = typeof(Nullable<>).GetConstructor(typeof(Nullable<>).GetGenericArguments())!; 93public static ConstructorInfo GetNullableConstructor(Type nullableType) 97return (ConstructorInfo)nullableType.GetMemberWithSameMetadataDefinitionAs(s_nullableConstructor);
System\Linq\Expressions\Common\CachedReflectionInfo.cs (16)
12private static ConstructorInfo? s_Nullable_Boolean_Ctor; 14public static ConstructorInfo Nullable_Boolean_Ctor 17private static ConstructorInfo? s_Decimal_Ctor_Int32; 18public static ConstructorInfo Decimal_Ctor_Int32 => 21private static ConstructorInfo? s_Decimal_Ctor_UInt32; 22public static ConstructorInfo Decimal_Ctor_UInt32 => 25private static ConstructorInfo? s_Decimal_Ctor_Int64; 26public static ConstructorInfo Decimal_Ctor_Int64 => 29private static ConstructorInfo? s_Decimal_Ctor_UInt64; 30public static ConstructorInfo Decimal_Ctor_UInt64 => 33private static ConstructorInfo? s_Decimal_Ctor_Int32_Int32_Int32_Bool_Byte; 34public static ConstructorInfo Decimal_Ctor_Int32_Int32_Int32_Bool_Byte => 85private static ConstructorInfo? s_DictionaryOfStringInt32_Ctor_Int32; 86public static ConstructorInfo DictionaryOfStringInt32_Ctor_Int32 => 138private static ConstructorInfo? s_Closure_ObjectArray_ObjectArray; 139public static ConstructorInfo Closure_ObjectArray_ObjectArray =>
System\Linq\Expressions\Compiler\ILGen.cs (7)
21Debug.Assert(methodBase is MethodInfo || methodBase is ConstructorInfo); 23var ctor = methodBase as ConstructorInfo; 289internal static void EmitNew(this ILGenerator il, ConstructorInfo ci) 807ConstructorInfo ci = TypeUtils.GetNullableConstructor(typeTo); 827ConstructorInfo ci = TypeUtils.GetNullableConstructor(typeTo); 966ConstructorInfo? ci = arrayType.GetConstructor(types);
System\Linq\Expressions\Compiler\LambdaCompiler.Binary.cs (1)
484ConstructorInfo ci = TypeUtils.GetNullableConstructor(resultType);
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (2)
1164ConstructorInfo ci = TypeUtils.GetNullableConstructor(resultType); 1268ConstructorInfo ci = TypeUtils.GetNullableConstructor(resultType);
System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs (1)
167ConstructorInfo ci = TypeUtils.GetNullableConstructor(resultType);
System\Linq\Expressions\Expression.DebuggerProxy.cs (1)
359public ConstructorInfo? Constructor => _node.Constructor;
System\Linq\Expressions\Interpreter\InstructionList.cs (2)
792public void EmitNew(ConstructorInfo constructorInfo, ParameterInfo[] parameters) 797public void EmitByRefNew(ConstructorInfo constructorInfo, ParameterInfo[] parameters, ByRefUpdater[] updaters)
System\Linq\Expressions\Interpreter\NewInstruction.cs (3)
12protected readonly ConstructorInfo _constructor; 15public NewInstruction(ConstructorInfo constructor, int argumentCount) 74internal ByRefNewInstruction(ConstructorInfo target, int argumentCount, ByRefUpdater[] byrefArgs)
System\Linq\Expressions\NewExpression.cs (16)
22internal NewExpression(ConstructorInfo? constructor, IReadOnlyList<Expression> arguments, ReadOnlyCollection<MemberInfo>? members) 44public ConstructorInfo? Constructor { get; } 112/// <param name="constructor">The <see cref="ConstructorInfo"/> to set the <see cref="NewExpression.Constructor"/> property equal to.</param> 114public static NewExpression New(ConstructorInfo constructor) 122/// <param name="constructor">The <see cref="ConstructorInfo"/> to set the <see cref="NewExpression.Constructor"/> property equal to.</param> 125public static NewExpression New(ConstructorInfo constructor, params Expression[]? arguments) 133/// <param name="constructor">The <see cref="ConstructorInfo"/> to set the <see cref="NewExpression.Constructor"/> property equal to.</param> 136public static NewExpression New(ConstructorInfo constructor, IEnumerable<Expression>? arguments) 157/// <param name="constructor">The <see cref="ConstructorInfo"/> to set the <see cref="NewExpression.Constructor"/> property equal to.</param> 162public static NewExpression New(ConstructorInfo constructor, IEnumerable<Expression>? arguments, IEnumerable<MemberInfo>? members) 182/// <param name="constructor">The <see cref="ConstructorInfo"/> to set the <see cref="NewExpression.Constructor"/> property equal to.</param> 187public static NewExpression New(ConstructorInfo constructor, IEnumerable<Expression>? arguments, params MemberInfo[]? members) 196/// <returns>A <see cref="NewExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.New"/> and the <see cref="NewExpression.Constructor"/> property set to the <see cref="ConstructorInfo"/> that represents the parameterless constructor of the specified type.</returns> 207ConstructorInfo? ci = type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).SingleOrDefault(c => c.GetParametersCached().Length == 0); 220private static void ValidateNewArgs(ConstructorInfo constructor, ref ReadOnlyCollection<Expression> arguments, ref ReadOnlyCollection<MemberInfo> members) 354private static void ValidateConstructor(ConstructorInfo constructor, string paramName)
System.Net.Security (3)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (3)
109ConstructorInfo? socketsHttpHandlerCtor = socketsHttpHandlerType.GetConstructor(Type.EmptyTypes); 112ConstructorInfo? httpClientCtor = httpClientType.GetConstructor(new Type[] { httpMessageHandlerType }); 114ConstructorInfo? httpRequestMessageCtor = httpRequestMessageType.GetConstructor(Type.EmptyTypes);
System.Private.CoreLib (128)
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInfo.cs (4)
25public static bool operator ==(ConstructorInfo? left, ConstructorInfo? right) 43public static bool operator !=(ConstructorInfo? left, ConstructorInfo? right) => !(left == right);
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (4)
15/// Invokes the method reflected by the provided <see cref="ConstructorInfo"/>. 18/// Used for better performance than <seealso cref="ConstructorInfo.Invoke"/> when compatibility with that method 20/// Unlike <see cref="ConstructorInfo.Invoke"/>, the invoke methods do not look up default values for arguments when 49public static ConstructorInvoker Create(ConstructorInfo constructor)
src\libraries\System.Private.CoreLib\src\System\Reflection\CustomAttributeData.cs (1)
87public virtual ConstructorInfo Constructor => null!;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\AssemblyBuilder.cs (2)
38public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) 46protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\ConstructorBuilder.cs (2)
33public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) 41protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\ConstructorOnTypeBuilderInstantiation.cs (4)
11internal static ConstructorInfo GetConstructor(ConstructorInfo constructor, TypeBuilderInstantiation type) 18internal ConstructorInfo _ctor; 23internal ConstructorOnTypeBuilderInstantiation(ConstructorInfo constructor, TypeBuilderInstantiation type)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\EnumBuilder.cs (2)
35public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) 38protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\EventBuilder.cs (2)
22public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) 30protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\FieldBuilder.cs (2)
17public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) 25protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\GenericTypeParameterBuilder.cs (2)
14public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) => SetCustomAttributeCore(con, binaryAttribute); 16protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\ILGenerator.cs (2)
51public abstract void Emit(OpCode opcode, ConstructorInfo con); 98ConstructorInfo con = excType.GetConstructor(Type.EmptyTypes) ?? throw new ArgumentException(SR.Arg_NoDefCTorWithoutTypeName, nameof(excType));
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilder.cs (3)
51public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) 59internal void SetCustomAttribute(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) 64protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\ModuleBuilder.cs (3)
170public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) 178protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute); 190public abstract int GetMethodMetadataToken(ConstructorInfo constructor);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\ParameterBuilder.cs (2)
20public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) 27protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\PropertyBuilder.cs (2)
22public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) 30protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute);
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (2)
368protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, 375public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilder.cs (4)
272public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) 280protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute); 374public static ConstructorInfo GetConstructor(Type type, ConstructorInfo constructor)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (2)
165protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) { throw new NotSupportedException(); } 168public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) { throw new NotSupportedException(); }
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (1)
225il.Emit(OpCodes.Newobj, (ConstructorInfo)method);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBase.cs (1)
32this is ConstructorInfo &&
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (2)
101protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, 105public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) => throw new NotSupportedException(SR.NotSupported_ModifiedType);
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (3)
97case ConstructorInfo ctor: 98var metaCtor = (ConstructorInfo)GetMemberMetadataDefinition(ctor);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureType.cs (2)
109public sealed override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) => throw new NotSupportedException(SR.NotSupported_SignatureType); 181protected sealed override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) => throw new NotSupportedException(SR.NotSupported_SignatureType);
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeDelegator.cs (2)
61protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, 68public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) => typeImpl.GetConstructors(bindingAttr);
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeInfo.cs (1)
48public virtual IEnumerable<ConstructorInfo> DeclaredConstructors
src\libraries\System.Private.CoreLib\src\System\Type.cs (9)
153public ConstructorInfo? TypeInitializer 160public ConstructorInfo? GetConstructor(Type[] types) => GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, types, null); 178/// A <see cref="ConstructorInfo"/> object representing the constructor that matches the specified requirements, if found; otherwise, null. 181public ConstructorInfo? GetConstructor(BindingFlags bindingAttr, Type[] types) => GetConstructor(bindingAttr, binder: null, types, modifiers: null); 184public ConstructorInfo? GetConstructor(BindingFlags bindingAttr, Binder? binder, Type[] types, ParameterModifier[]? modifiers) => GetConstructor(bindingAttr, binder, CallingConventions.Any, types, modifiers); 187public ConstructorInfo? GetConstructor(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 199protected abstract ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers); 202public ConstructorInfo[] GetConstructors() => GetConstructors(BindingFlags.Public | BindingFlags.Instance); 205public abstract ConstructorInfo[] GetConstructors(BindingFlags bindingAttr);
src\libraries\System.Private.CoreLib\src\System\Type.Helpers.cs (3)
150ConstructorInfo?[]? c = null; 283if (c[i] is ConstructorInfo ci) 438attr = ((ConstructorInfo)m).Attributes;
src\System\Reflection\Emit\CustomAttributeBuilder.cs (6)
24private readonly ConstructorInfo m_con; 28internal ConstructorInfo Ctor => m_con; 34public CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs) : 41public CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs, PropertyInfo[] namedProperties, object?[] propertyValues) : 48public CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs, FieldInfo[] namedFields, object?[] fieldValues) : 55public CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs, PropertyInfo[] namedProperties, object?[] propertyValues, FieldInfo[] namedFields, object?[] fieldValues)
src\System\Reflection\Emit\DynamicILGenerator.cs (1)
109public override void Emit(OpCode opcode, ConstructorInfo con)
src\System\Reflection\Emit\RuntimeAssemblyBuilder.cs (1)
286protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
src\System\Reflection\Emit\RuntimeConstructorBuilder.cs (2)
83ConstructorInfo rci = GetTypeBuilder().GetConstructor(m_methodBuilder.m_parameterTypes!)!; 160protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
src\System\Reflection\Emit\RuntimeEnumBuilder.cs (3)
92protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, 100public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) 277protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
src\System\Reflection\Emit\RuntimeEventBuilder.cs (1)
83protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
src\System\Reflection\Emit\RuntimeFieldBuilder.cs (1)
153protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
src\System\Reflection\Emit\RuntimeGenericTypeParameterBuilder.cs (3)
103protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) { throw new NotSupportedException(); } 106public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) { throw new NotSupportedException(); } 218protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
src\System\Reflection\Emit\RuntimeILGenerator.cs (1)
666public override void Emit(OpCode opcode, ConstructorInfo con)
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (4)
248else if (method is ConstructorInfo ci) 699protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) 712private static bool IsKnownCA(ConstructorInfo con) 718private void ParseCA(ConstructorInfo con)
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (4)
224public override int GetMethodMetadataToken(ConstructorInfo constructor) 366tkParent = GetMethodMetadataToken((method as ConstructorInfo)!); 1110tk = GetMethodMetadataToken((method as ConstructorInfo)!); 1284protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
src\System\Reflection\Emit\RuntimeParameterBuilder.cs (1)
20protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
src\System\Reflection\Emit\RuntimePropertyBuilder.cs (1)
100protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (12)
24private readonly ConstructorInfo? m_con; 28public CustAttr(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) 575internal void SetGenParamCustomAttribute(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) 662protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, 672public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) 1104if ((method.Attributes & MethodAttributes.SpecialName) != 0 && method.Name.Equals(ConstructorInfo.ConstructorName)) 1213ConstructorInfo.TypeConstructorName, attr, CallingConventions.Standard, null, m_module, this); 1246ConstructorInfo? con = null; 1311name = ConstructorInfo.ConstructorName; 1315name = ConstructorInfo.TypeConstructorName; 1735internal void SetCustomAttribute(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) 1740protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
src\System\Reflection\RuntimeCustomAttributeData.cs (3)
237private ConstructorInfo m_ctor = null!; 403ConstructorInfo[] allCtors = type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); 415public override ConstructorInfo Constructor => m_ctor;
src\System\RuntimeHandles.cs (2)
195Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic, 219Debug.Assert(type.GetConstructor(Type.EmptyTypes) is ConstructorInfo c && c.IsPublic,
src\System\RuntimeType.CoreCLR.cs (13)
2539private ListBuilder<ConstructorInfo> GetConstructorCandidates( 2547ListBuilder<ConstructorInfo> candidates = new ListBuilder<ConstructorInfo>(cache.Length); 2659public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) 2699ListBuilder<ConstructorInfo> constructors = GetConstructorCandidates(null, bindingAttr, CallingConventions.Any, null, false); 2845protected override ConstructorInfo? GetConstructorImpl( 2849ListBuilder<ConstructorInfo> candidates = GetConstructorCandidates(null, bindingAttr, CallingConventions.Any, types, false); 2856ConstructorInfo firstCandidate = candidates[0]; 2865return System.DefaultBinder.ExactBinding(candidates.ToArray(), types) as ConstructorInfo; 2868return binder.SelectMethod(bindingAttr, candidates.ToArray(), types, modifiers) as ConstructorInfo; 3049ListBuilder<ConstructorInfo> constructors = default; 3885ListBuilder<ConstructorInfo> candidates = GetConstructorCandidates(null, bindingAttr, CallingConventions.Any, null, false); 3950instance = ((ConstructorInfo)invokeMethod).Invoke(bindingAttr, binder, args, culture);
System.Private.DataContractSerialization (48)
System\Runtime\Serialization\ClassDataContract.cs (8)
137internal ConstructorInfo? GetISerializableConstructor() 142private ConstructorInfo? _nonAttributedTypeConstructor; 144internal ConstructorInfo? GetNonAttributedTypeConstructor() 165ConstructorInfo? ci = GetNonAttributedTypeConstructor(); 1243internal ConstructorInfo? GetISerializableConstructor() 1248ConstructorInfo? ctor = UnderlyingType.GetConstructor(Globals.ScanAllMembers, SerInfoCtorArgs); 1255internal ConstructorInfo? GetNonAttributedTypeConstructor() 1265ConstructorInfo? ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Type.EmptyTypes);
System\Runtime\Serialization\CodeGenerator.cs (2)
508internal void Call(ConstructorInfo ctor) 513internal void New(ConstructorInfo constructorInfo)
System\Runtime\Serialization\CollectionDataContract.cs (8)
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) 250internal ConstructorInfo? Constructor => _helper.Constructor; 409private readonly ConstructorInfo? _constructor; 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) 690internal ConstructorInfo? Constructor => _constructor; 1103ConstructorInfo? defaultCtor = null;
System\Runtime\Serialization\DataContract.cs (2)
2161internal static bool ConstructorRequiresMemberAccess(ConstructorInfo? ctor) 2216else if (member is ConstructorInfo constructor)
System\Runtime\Serialization\Json\JsonFormatGeneratorStatics.cs (4)
21private static ConstructorInfo? s_extensionDataObjectCtor; 55private static ConstructorInfo? s_serializationExceptionCtor; 116public static ConstructorInfo ExtensionDataObjectCtor => s_extensionDataObjectCtor ?? 310public static ConstructorInfo SerializationExceptionCtor
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (2)
454ConstructorInfo? ctor = classContract.UnderlyingType.GetConstructor(Globals.ScanAllMembers, JsonFormatGeneratorStatics.SerInfoCtorArgs); 604ConstructorInfo constructor = collectionContract.Constructor!;
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (2)
420ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(Globals.ScanAllMembers, new Type[] { Globals.TypeOfIDictionaryEnumerator })!; 428ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(Globals.ScanAllMembers, new Type[] { ctorParam })!;
System\Runtime\Serialization\ReflectionReader.cs (4)
337ConstructorInfo iSerializableConstructor = classContract.GetISerializableConstructor()!; 483var ci = arrayType.GetConstructor(s_arrayConstructorParameters)!; 490ConstructorInfo ci = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public, Type.EmptyTypes)!; 508ConstructorInfo ci = collectionContract.Constructor!;
System\Runtime\Serialization\XmlDataContract.cs (5)
247private ConstructorInfo? GetConstructor() 252ConstructorInfo? ctor = UnderlyingType.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Type.EmptyTypes); 302ConstructorInfo ctor = GetConstructor()!; 313ConstructorInfo? XElement_ctor = type.GetConstructor( 377ConstructorInfo ctor = GetConstructor()!;
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (8)
77private static ConstructorInfo? s_dictionaryEnumeratorCtor; 78internal static ConstructorInfo DictionaryEnumeratorCtor 208private static ConstructorInfo? s_serializationExceptionCtor; 209internal static ConstructorInfo SerializationExceptionCtor => s_serializationExceptionCtor ??= typeof(SerializationException).GetConstructor(new Type[] { typeof(string) })!; 211private static ConstructorInfo? s_extensionDataObjectCtor; 212internal static ConstructorInfo ExtensionDataObjectCtor => s_extensionDataObjectCtor ??= typeof(ExtensionDataObject).GetConstructor(Globals.ScanAllMembers, Type.EmptyTypes)!; 214private static ConstructorInfo? s_hashtableCtor; 215internal static ConstructorInfo HashtableCtor
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (2)
493ConstructorInfo ctor = classContract.GetISerializableConstructor()!; 639ConstructorInfo constructor = collectionContract.Constructor!;
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (1)
505ConstructorInfo dictEnumCtor = enumeratorType.GetConstructor(Globals.ScanAllMembers, new Type[] { ctorParam })!;
System.Private.Windows.Core (4)
System\Private\Windows\Core\BinaryFormat\Deserializer\PendingSerializationInfo.cs (3)
61ConstructorInfo constructor = GetDeserializationConstructor(type); 65private static ConstructorInfo GetDeserializationConstructor( 68foreach (ConstructorInfo constructor in type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly))
System\Private\Windows\Core\Nrbf\SerializationRecordExtensions.cs (1)
244ConstructorInfo? ctor = typeof(Color).GetConstructor(
System.Private.Windows.Core.TestUtilities (1)
ReflectionHelper.cs (1)
30var ctor = type.GetConstructor(
System.Private.Xml (44)
System\Xml\Serialization\CodeGenerator.cs (6)
409internal void Call(ConstructorInfo ctor) 415internal void New(ConstructorInfo constructorInfo) 817ConstructorInfo Decimal_ctor = typeof(decimal).GetConstructor( 830ConstructorInfo DateTime_ctor = typeof(DateTime).GetConstructor( 843ConstructorInfo TimeSpan_ctor = typeof(TimeSpan).GetConstructor( 855ConstructorInfo DateTimeOffset_ctor = typeof(DateTimeOffset).GetConstructor(
System\Xml\Serialization\Compilation.cs (1)
460ConstructorInfo AssemblyVersionAttribute_ctor = typeof(AssemblyVersionAttribute).GetConstructor(
System\Xml\Serialization\Compiler.cs (1)
44ConstructorInfo[] ctors = type.GetConstructors();
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (2)
1343ConstructorInfo? ci = GetDefaultConstructor(type); 1357private static ConstructorInfo? GetDefaultConstructor(
System\Xml\Serialization\Types.cs (1)
1231ConstructorInfo? ctor = type.GetConstructor(BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic, Type.EmptyTypes);
System\Xml\Serialization\XmlSerializationILGen.cs (7)
176ConstructorInfo Hashtable_ctor = typeof(Hashtable).GetConstructor( 284ConstructorInfo readerCtor = CreatedTypes[readerClass].GetConstructor( 297ConstructorInfo writerCtor = CreatedTypes[writerClass].GetConstructor( 427ConstructorInfo ctor = CreatedTypes[(string)serializers[key]].GetConstructor( 468ConstructorInfo ctor = CreatedTypes[(string)serializers[xmlMappings[i].Key!]].GetConstructor( 511ConstructorInfo ctor = CreatedTypes[readerType].GetConstructor( 545ConstructorInfo baseCtor = typeof(XmlSerializerImplementation).GetConstructor(
System\Xml\Serialization\XmlSerializationReaderILGen.cs (3)
983ConstructorInfo Hashtable_ctor = typeof(Hashtable).GetConstructor( 1451ConstructorInfo XmlQualifiedName_ctor = typeof(XmlQualifiedName).GetConstructor( 1918ConstructorInfo ctor = xmlnsMember.Mapping.TypeDesc!.Type!.GetConstructor(
System\Xml\Serialization\XmlSerializationWriterILGen.cs (10)
262ConstructorInfo XmlQualifiedName_ctor = typeof(XmlQualifiedName).GetConstructor( 1211ConstructorInfo StringBuilder_ctor = typeof(StringBuilder).GetConstructor( 2390ConstructorInfo ctor = type.GetConstructor( 2432ConstructorInfo XElement_ctor = type.GetConstructor( 2460LocalBuilder enumerator = ilg.DeclareLocal(typeof(IEnumerator<>).MakeGenericType(typeof(ConstructorInfo)), "e"); 2462MethodInfo getEnumerator = typeof(IEnumerable<>).MakeGenericType(typeof(ConstructorInfo)).GetMethod("GetEnumerator")!; 2472LocalBuilder constructorInfo = ilg.DeclareLocal(typeof(ConstructorInfo), "constructorInfo"); 2477MethodInfo constructorIsStatic = typeof(ConstructorInfo).GetMethod("get_IsStatic")!; 2481MethodInfo constructorGetParameters = typeof(ConstructorInfo).GetMethod("GetParameters")!; 2489MethodInfo constructorInvoke = typeof(ConstructorInfo).GetMethod("Invoke", new Type[] { typeof(object[]) })!;
System\Xml\Xsl\IlGen\GenerateHelper.cs (10)
156public static readonly ConstructorInfo DecFromParts = typeof(decimal).GetConstructor(new[] { typeof(int), typeof(int), typeof(int), typeof(bool), typeof(byte) })!; 157public static readonly ConstructorInfo DecFromInt32 = typeof(decimal).GetConstructor(new[] { typeof(int) })!; 158public static readonly ConstructorInfo DecFromInt64 = typeof(decimal).GetConstructor(new[] { typeof(long) })!; 159public static readonly ConstructorInfo Debuggable = typeof(DebuggableAttribute).GetConstructor(new[] { typeof(DebuggableAttribute.DebuggingModes) })!; 160public static readonly ConstructorInfo NonUserCode = typeof(DebuggerNonUserCodeAttribute).GetConstructor(Type.EmptyTypes)!; 161public static readonly ConstructorInfo QName = typeof(XmlQualifiedName).GetConstructor(new[] { typeof(string), typeof(string) })!; 162public static readonly ConstructorInfo StepThrough = typeof(DebuggerStepThroughAttribute).GetConstructor(Type.EmptyTypes)!; 163public static readonly ConstructorInfo Transparent = typeof(SecurityTransparentAttribute).GetConstructor(Type.EmptyTypes)!; 855public void Construct(ConstructorInfo constr) 1584public void Emit(OpCode opcode, ConstructorInfo constrInfo)
System\Xml\Xsl\IlGen\XmlILModule.cs (1)
227public ConstructorInfo DefineTypeInitializer()
System\Xml\Xsl\Runtime\EarlyBoundInfo.cs (1)
16private readonly ConstructorInfo _constrInfo; // Constructor for the early bound function object
System\Xml\Xsl\XmlIlGenerator.cs (1)
358ConstructorInfo cctor;
System.Reflection (1)
System.Reflection.cs (1)
9[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.ConstructorInfo))]
System.Reflection.Context (19)
System\Reflection\Context\Custom\AttributeUtils.cs (1)
93ConstructorInfo provider = constructor.UnderlyingConstructor;
System\Reflection\Context\Custom\CustomConstructorInfo.cs (1)
10public CustomConstructorInfo(ConstructorInfo template, CustomReflectionContext context)
System\Reflection\Context\CustomReflectionContext.Projector.cs (5)
105public override ConstructorInfo? ProjectConstructor(ConstructorInfo? value) 136ConstructorInfo? constructor = value as ConstructorInfo; 235output = ProjectConstructor((ConstructorInfo)value);
System\Reflection\Context\Delegation\DelegatingConstructorInfo.cs (2)
12public DelegatingConstructorInfo(ConstructorInfo constructor) 89public ConstructorInfo UnderlyingConstructor { get; }
System\Reflection\Context\Delegation\DelegatingCustomAttributeData.cs (1)
20public override ConstructorInfo Constructor
System\Reflection\Context\Delegation\DelegatingType.cs (2)
303protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 308public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
System\Reflection\Context\Projection\ProjectingConstructorInfo.cs (1)
13public ProjectingConstructorInfo(ConstructorInfo constructor, Projector projector)
System\Reflection\Context\Projection\ProjectingCustomAttributeData.cs (1)
23public override ConstructorInfo Constructor
System\Reflection\Context\Projection\ProjectingType.cs (3)
182protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) 189public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) 232ConstructorInfo[] constructors = GetConstructors(bindingAttr);
System\Reflection\Context\Projection\Projector.cs (2)
56public abstract ConstructorInfo? ProjectConstructor(ConstructorInfo? value);
System.Reflection.DispatchProxy (7)
src\libraries\Common\src\System\Reflection\Emit\IgnoreAccessChecksToAttributeBuilder.cs (2)
19public static ConstructorInfo AddToModule(ModuleBuilder mb) 77ConstructorInfo attributeUsageConstructorInfo =
System\Reflection\DispatchProxyGenerator.cs (5)
116private ConstructorInfo? _ignoresAccessChecksToAttributeConstructor; 141internal ConstructorInfo IgnoresAccessChecksAttributeConstructor => 235ConstructorInfo attributeConstructor = IgnoresAccessChecksAttributeConstructor; 295ConstructorInfo baseCtor = _proxyBaseType.GetConstructor(Type.EmptyTypes)!; 454ConstructorInfo exCtor = typeof(NotSupportedException).GetConstructor([typeof(string)])!;
System.Reflection.Emit (40)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (2)
368protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, 375public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
System\Reflection\Emit\ConstructorBuilderImpl.cs (1)
41protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) =>
System\Reflection\Emit\CustomAttributeWrapper.cs (5)
11private readonly ConstructorInfo _constructorInfo; 14public CustomAttributeWrapper(ConstructorInfo constructorInfo, ReadOnlySpan<byte> binaryAttribute) 20public ConstructorInfo Ctor => _constructorInfo; 26public ConstructorInfo _ctor; 37internal static CustomAttributeInfo DecodeCustomAttribute(ConstructorInfo ctor, ReadOnlySpan<byte> binaryAttribute)
System\Reflection\Emit\EnumBuilderImpl.cs (3)
41protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) => 106protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, 109public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) => throw new NotSupportedException();
System\Reflection\Emit\EventBuilderImpl.cs (1)
52protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
System\Reflection\Emit\FieldBuilderImpl.cs (1)
53protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
System\Reflection\Emit\GenericTypeParameterBuilderImpl.cs (3)
51protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) 103protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) => throw new NotSupportedException(); 105public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) => throw new NotSupportedException();
System\Reflection\Emit\ILGeneratorImpl.cs (1)
421public override void Emit(OpCode opcode, ConstructorInfo con)
System\Reflection\Emit\MethodBuilderImpl.cs (4)
99return _name.Equals(ConstructorInfo.ConstructorName) || _name.Equals(ConstructorInfo.TypeConstructorName); 170internal void SetCustomAttribute(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) => 173protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
System\Reflection\Emit\ModuleBuilderImpl.cs (5)
745case ConstructorInfo ctor: 746ctor = (ConstructorInfo)GetOriginalMemberIfConstructedType(ctor); 1154public override int GetMethodMetadataToken(ConstructorInfo constructor) => GetTokenForHandle(TryGetConstructorHandle(constructor)); 1156internal EntityHandle TryGetConstructorHandle(ConstructorInfo constructor) 1333protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
System\Reflection\Emit\ParameterBuilderImpl.cs (1)
39protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
System\Reflection\Emit\PersistedAssemblyBuilder.cs (1)
194protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
System\Reflection\Emit\PropertyBuilderImpl.cs (1)
63protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute)
System\Reflection\Emit\PseudoCustomAttributesData.cs (1)
292internal static MarshallingData CreateMarshallingData(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute, bool isField)
System\Reflection\Emit\TypeBuilderImpl.cs (10)
184name = ConstructorInfo.ConstructorName; 188name = ConstructorInfo.TypeConstructorName; 213ConstructorInfo? con; 425return new ConstructorBuilderImpl(ConstructorInfo.TypeConstructorName, attr, CallingConventions.Standard, null, null, null, _module, this); 472protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) 503internal void SetCustomAttribute(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) 508private void ParseStructLayoutAttribute(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute) 664protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, 755public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) 759List<ConstructorInfo> ctors = new();
System.Reflection.MetadataLoadContext (78)
System\Reflection\MetadataLoadContext.KnownConstructors.cs (17)
11internal ConstructorInfo? TryGetFieldOffsetCtor() => _lazyFieldOffset ??= TryGetConstructor(CoreType.FieldOffsetAttribute, CoreType.Int32); 12private volatile ConstructorInfo? _lazyFieldOffset; 14internal ConstructorInfo? TryGetInCtor() => _lazyIn ??= TryGetConstructor(CoreType.InAttribute); 15private volatile ConstructorInfo? _lazyIn; 17internal ConstructorInfo? TryGetOutCtor() => _lazyOut ??= TryGetConstructor(CoreType.OutAttribute); 18private volatile ConstructorInfo? _lazyOut; 20internal ConstructorInfo? TryGetOptionalCtor() => _lazyOptional ??= TryGetConstructor(CoreType.OptionalAttribute); 21private volatile ConstructorInfo? _lazyOptional; 23internal ConstructorInfo? TryGetPreserveSigCtor() => _lazyPreserveSig ??= TryGetConstructor(CoreType.PreserveSigAttribute); 24private volatile ConstructorInfo? _lazyPreserveSig; 26internal ConstructorInfo? TryGetComImportCtor() => _lazyComImport ??= TryGetConstructor(CoreType.ComImportAttribute); 27private volatile ConstructorInfo? _lazyComImport; 29internal ConstructorInfo? TryGetDllImportCtor() => _lazyDllImport ??= TryGetConstructor(CoreType.DllImportAttribute, CoreType.String); 30private volatile ConstructorInfo? _lazyDllImport; 32internal ConstructorInfo? TryGetMarshalAsCtor() => _lazyMarshalAs ??= TryGetConstructor(CoreType.MarshalAsAttribute, CoreType.UnmanagedType); 33private volatile ConstructorInfo? _lazyMarshalAs; 35private ConstructorInfo? TryGetConstructor(CoreType attributeCoreType, params CoreType[] parameterCoreTypes)
System\Reflection\Runtime\BindingFlagSupport\ConstructorPolicies.cs (10)
13internal sealed class ConstructorPolicies : MemberPolicies<ConstructorInfo> 15public sealed override IEnumerable<ConstructorInfo> GetDeclaredMembers(TypeInfo typeInfo) 20public sealed override IEnumerable<ConstructorInfo> CoreGetDeclaredMembers(RuntimeTypeInfo type, NameFilter? filter, RuntimeTypeInfo reflectedType) 34public sealed override void GetMemberAttributes(ConstructorInfo member, out MethodAttributes visibility, out bool isStatic, out bool isVirtual, out bool isNewSlot) 43public sealed override bool ImplicitlyOverrides(ConstructorInfo? baseMember, ConstructorInfo? derivedMember) => false; 45public sealed override bool IsSuppressedByMoreDerivedMember(ConstructorInfo member, ConstructorInfo[] priorMembers, int startIndex, int endIndex) 50public sealed override bool OkToIgnoreAmbiguity(ConstructorInfo m1, ConstructorInfo m2)
System\Reflection\Runtime\BindingFlagSupport\MemberPolicies.cs (1)
199else if (t.Equals(typeof(ConstructorInfo)))
System\Reflection\TypeLoading\Constructors\RoSyntheticConstructor.cs (1)
32protected sealed override string ComputeName() => ConstructorInfo.ConstructorName;
System\Reflection\TypeLoading\CustomAttributes\CustomAttributeHelpers.cs (1)
98ConstructorInfo? ci = loader.TryGetMarshalAsCtor();
System\Reflection\TypeLoading\CustomAttributes\Ecma\EcmaCustomAttributeData.cs (2)
57protected sealed override ConstructorInfo ComputeConstructor() 77ConstructorInfo? ci = declaringType.GetConstructor(bf, null, parameterTypes, null);
System\Reflection\TypeLoading\CustomAttributes\RoCustomAttributeData.cs (3)
19public sealed override ConstructorInfo Constructor => _lazyConstructorInfo ??= ComputeConstructor(); 20protected abstract ConstructorInfo ComputeConstructor(); 21private volatile ConstructorInfo? _lazyConstructorInfo;
System\Reflection\TypeLoading\CustomAttributes\RoPseudoCustomAttributeData.cs (4)
10private readonly ConstructorInfo _constructor; 19internal RoPseudoCustomAttributeData(ConstructorInfo constructor, Func<CustomAttributeArguments> argumentsPromise) 25internal RoPseudoCustomAttributeData(ConstructorInfo constructor, IList<CustomAttributeTypedArgument>? fixedArguments = null, IList<CustomAttributeNamedArgument>? namedArguments = null) 39protected sealed override ConstructorInfo ComputeConstructor() => _constructor;
System\Reflection\TypeLoading\Fields\RoField.cs (1)
57ConstructorInfo? ci = Loader.TryGetFieldOffsetCtor();
System\Reflection\TypeLoading\General\Ecma\EcmaHelpers.cs (2)
109return stringComparer.Equals(nameHandle, ConstructorInfo.ConstructorName) || stringComparer.Equals(nameHandle, ConstructorInfo.TypeConstructorName);
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.cs (1)
59ConstructorInfo? ci = Loader.TryGetPreserveSigCtor();
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.DllImport.cs (1)
27ConstructorInfo? ctor = Loader.TryGetDllImportCtor();
System\Reflection\TypeLoading\Parameters\RoFatMethodParameter.cs (3)
41ConstructorInfo? ci = Loader.TryGetInCtor(); 48ConstructorInfo? ci = Loader.TryGetOutCtor(); 55ConstructorInfo? ci = Loader.TryGetOptionalCtor();
System\Reflection\TypeLoading\RuntimeTypeInfo.BindingFlags.cs (10)
12public sealed override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) => Query<ConstructorInfo>(bindingAttr).ToArray(); 14protected sealed override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) 18QueryResult<ConstructorInfo> queryResult = Query<ConstructorInfo>(bindingAttr); 19ListBuilder<ConstructorInfo> candidates = default; 20foreach (ConstructorInfo candidate in queryResult) 32ConstructorInfo firstCandidate = candidates[0]; 39return System.DefaultBinder.ExactBinding(candidates.ToArray(), types) as ConstructorInfo; 43return binder.SelectMethod(bindingAttr, candidates.ToArray(), types, modifiers) as ConstructorInfo;
System\Reflection\TypeLoading\RuntimeTypeInfo.GetMember.cs (1)
51if ((results = QuerySpecificMemberTypeIfRequested(type, optionalName, bindingAttr, predicate, MemberTypes.Constructor, out QueryResult<ConstructorInfo> constructors)) != null)
System\Reflection\TypeLoading\RuntimeTypeInfo.TypeComponentsCache.cs (1)
87perNameCaches[MemberTypeIndex.Constructor] = new PerNameQueryCache<ConstructorInfo>(type, ignoreCase: ignoreCase, immediateTypeOnly: immediateTypeOnly);
System\Reflection\TypeLoading\Types\Ecma\EcmaDefinitionType.BindingFlags.cs (1)
18internal sealed override IEnumerable<ConstructorInfo> SpecializeConstructors(NameFilter? filter, RoInstantiationProviderType declaringType)
System\Reflection\TypeLoading\Types\RoArrayType.cs (2)
73internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) 75if (filter == null || filter.Matches(ConstructorInfo.ConstructorName))
System\Reflection\TypeLoading\Types\RoByRefType.cs (2)
35internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => Array.Empty<ConstructorInfo>();
System\Reflection\TypeLoading\Types\RoConstructedGenericType.cs (1)
139internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => _genericTypeDefinition.SpecializeConstructors(filter, this);
System\Reflection\TypeLoading\Types\RoDefinitionType.cs (3)
72ConstructorInfo? ci = Loader.TryGetComImportCtor(); 233internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => SpecializeConstructors(filter, this); 240internal abstract IEnumerable<ConstructorInfo> SpecializeConstructors(NameFilter? filter, RoInstantiationProviderType declaringType);
System\Reflection\TypeLoading\Types\RoExceptionType.cs (1)
45internal sealed override IEnumerable<ConstructorInfo> SpecializeConstructors(NameFilter? filter, RoInstantiationProviderType declaringType) => throw null!;
System\Reflection\TypeLoading\Types\RoFunctionPointerType.cs (2)
210internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => Array.Empty<ConstructorInfo>();
System\Reflection\TypeLoading\Types\RoGenericParameterType.cs (2)
88internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => Array.Empty<ConstructorInfo>();
System\Reflection\TypeLoading\Types\RoModifiedType.cs (1)
192internal override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => throw new NotSupportedException(SR.NotSupported_ModifiedType);
System\Reflection\TypeLoading\Types\RoPointerType.cs (2)
35internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => Array.Empty<ConstructorInfo>();
System\Reflection\TypeLoading\Types\RoStubType.cs (1)
77internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => throw null!;
System\Reflection\TypeLoading\Types\RoType.cs (1)
380internal abstract IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter);
System.Reflection.TypeExtensions (3)
System\Reflection\TypeExtensions.cs (3)
10public static ConstructorInfo? GetConstructor( 19public static ConstructorInfo[] GetConstructors( 27public static ConstructorInfo[] GetConstructors(
System.Resources.Extensions (3)
System\Resources\Extensions\BinaryFormat\Deserializer\PendingSerializationInfo.cs (3)
62ConstructorInfo constructor = GetDeserializationConstructor(type); 66private static ConstructorInfo GetDeserializationConstructor( 69foreach (ConstructorInfo constructor in type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly))
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
447[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.ConstructorInfo))]
System.Runtime.InteropServices (4)
System\Runtime\InteropServices\Marshalling\ComImportInteropInterfaceDetailsStrategy.cs (4)
73ConstructorInfo ignoresAccessChecksToAttributeConstructor = GetIgnoresAccessChecksToAttributeConstructor(module); 120private static ConstructorInfo GetIgnoresAccessChecksToAttributeConstructor(ModuleBuilder moduleBuilder) 161private static readonly ConstructorInfo s_attributeBaseClassCtor = typeof(Attribute).GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance)[0]; 166private static readonly ConstructorInfo s_attributeUsageCtor = typeof(AttributeUsageAttribute).GetConstructor(new Type[] { typeof(AttributeTargets) })!;
System.Runtime.Serialization.Formatters (3)
System\Runtime\Serialization\ObjectManager.cs (3)
782ConstructorInfo constInfo; 796internal static ConstructorInfo GetDeserializationConstructor( 799foreach (ConstructorInfo ci in t.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly))
System.Security.Cryptography (5)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (3)
109ConstructorInfo? socketsHttpHandlerCtor = socketsHttpHandlerType.GetConstructor(Type.EmptyTypes); 112ConstructorInfo? httpClientCtor = httpClientType.GetConstructor(new Type[] { httpMessageHandlerType }); 114ConstructorInfo? httpRequestMessageCtor = httpRequestMessageType.GetConstructor(Type.EmptyTypes);
System\Security\Cryptography\CryptoConfig.cs (2)
462ConstructorInfo? rci = Type.DefaultBinder.BindToMethod( 469out object? state) as ConstructorInfo;
System.ServiceModel.Http (3)
System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (3)
26private ConstructorInfo[] _handlerCtors; 52_handlerCtors = new ConstructorInfo[handlers.Length]; 70ConstructorInfo ctorInfo = handler.GetConstructor(Array.Empty<Type>());
System.ServiceModel.Primitives (4)
Extensions\ReflectionExtensions.cs (4)
27public static ConstructorInfo GetConstructor(this Type type, Type[] types) 31public static ConstructorInfo GetConstructor(this Type type, BindingFlags bindingAttr, object binder, Type[] types, object[] modifiers) 211public static bool IsPublic(this ConstructorInfo ci) 215public static object Invoke(this ConstructorInfo ci, BindingFlags invokeAttr, object binder, object[] parameters, CultureInfo culture)
System.Text.Json (34)
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (7)
231out ConstructorInfo? deserializationCtor) 233ConstructorInfo? ctorWithAttribute = null; 234ConstructorInfo? publicParameterlessCtor = null; 235ConstructorInfo? lonePublicCtor = null; 237ConstructorInfo[] constructors = type.GetConstructors(BindingFlags.Public | BindingFlags.Instance); 244foreach (ConstructorInfo constructor in constructors) 263foreach (ConstructorInfo constructor in type.GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance))
System\ReflectionExtensions.cs (2)
46private static bool HasJsonConstructorAttribute(ConstructorInfo constructorInfo) 102ConstructorInfo ctorInfo = type.GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, parameterTypes, null)!;
System\Text\Json\Serialization\Converters\Object\ObjectConverterFactory.cs (1)
47if (!typeToConvert.TryGetDeserializationConstructor(useDefaultConstructorInUnannotatedStructs, out ConstructorInfo? constructor))
System\Text\Json\Serialization\JsonConverter.cs (1)
224internal ConstructorInfo? ConstructorInfo { get; set; }
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (1)
192ConstructorInfo? ctor = converterType.GetConstructor(Type.EmptyTypes);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (1)
453ConstructorInfo? defaultCtor = null;
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
639/// the underlying <see cref="ConstructorInfo" /> of the serialized property or field.
System\Text\Json\Serialization\Metadata\MemberAccessor.cs (3)
12public abstract Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? constructorInfo); 14public abstract Func<object[], T> CreateParameterizedConstructor<T>(ConstructorInfo constructor); 16public abstract JsonTypeInfo.ParameterizedConstructorDelegate<T, TArg0, TArg1, TArg2, TArg3>? CreateParameterizedConstructor<T, TArg0, TArg1, TArg2, TArg3>(ConstructorInfo constructor);
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.cs (6)
31public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? ctorInfo) => 34valueFactory: key => _sourceAccessor.CreateParameterlessConstructor(key.declaringType, (ConstructorInfo?)key.member)); 56public override Func<object[], T> CreateParameterizedConstructor<T>(ConstructorInfo constructor) => 59valueFactory: key => _sourceAccessor.CreateParameterizedConstructor<T>((ConstructorInfo)key.member!)); 61public override JsonTypeInfo.ParameterizedConstructorDelegate<T, TArg0, TArg1, TArg2, TArg3>? CreateParameterizedConstructor<T, TArg0, TArg1, TArg2, TArg3>(ConstructorInfo constructor) => 64valueFactory: key => _sourceAccessor.CreateParameterizedConstructor<T, TArg0, TArg1, TArg2, TArg3>((ConstructorInfo)key.member!));
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (8)
21public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? constructorInfo) 37ConstructorInfo.ConstructorName, 71public override Func<object[], T> CreateParameterizedConstructor<T>(ConstructorInfo constructor) => 74private static DynamicMethod CreateParameterizedConstructor(ConstructorInfo constructor) 86ConstructorInfo.ConstructorName, 111CreateParameterizedConstructor<T, TArg0, TArg1, TArg2, TArg3>(ConstructorInfo constructor) => 115private static DynamicMethod? CreateParameterizedConstructor(ConstructorInfo constructor, Type parameterType1, Type parameterType2, Type parameterType3, Type parameterType4) 127ConstructorInfo.ConstructorName,
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (3)
19public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? ctorInfo) 39public override Func<object[], T> CreateParameterizedConstructor<T>(ConstructorInfo constructor) 74CreateParameterizedConstructor<T, TArg0, TArg1, TArg2, TArg3>(ConstructorInfo constructor)
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\RibbonControlLengthConverter.cs (1)
132ConstructorInfo ci = typeof(RibbonControlLength).GetConstructor(new Type[] { typeof(double), typeof(RibbonControlLengthUnitType) });
System.Windows.Forms (13)
System\Windows\Forms\ComponentModel\COM2Interop\COM2IManagedPerPropertyBrowsingHandler.cs (1)
155foreach (var constructor in type.GetConstructors())
System\Windows\Forms\Controls\DataGridView\DataGridViewCellConverter.cs (1)
30ConstructorInfo? ctor = cell.GetType().GetConstructor([]);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyleConverter.cs (1)
40ConstructorInfo? ctor = value.GetType().GetConstructor([]);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnConverter.cs (1)
36ConstructorInfo? ctor;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowConverter.cs (1)
29ConstructorInfo? ctor = row.GetType().GetConstructor([]);
System\Windows\Forms\Controls\ListView\ColumnHeaderConverter.cs (1)
40ConstructorInfo? ctor;
System\Windows\Forms\Controls\ListView\ListViewGroupConverter.cs (1)
95ConstructorInfo ctor = typeof(ListViewGroup).GetConstructor([typeof(string), typeof(HorizontalAlignment)])!;
System\Windows\Forms\Controls\ListView\ListViewItemConverter.cs (1)
47ConstructorInfo? ctor;
System\Windows\Forms\Controls\ListView\ListViewSubItemConverter.cs (1)
30ConstructorInfo? ctor;
System\Windows\Forms\Controls\MonthCalendar\SelectionRangeConverter.cs (1)
122ConstructorInfo? ctor = typeof(SelectionRange).GetConstructor(
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
1657ConstructorInfo? constructor = tabType.GetConstructor([typeof(IServiceProvider)]);
System\Windows\Forms\DataBinding\BindingSource.cs (1)
51private ConstructorInfo? _itemConstructor;
System\Windows\Forms\DataBinding\ListBindingConverter.cs (1)
153ConstructorInfo? ctor = typeof(Binding).GetConstructor(ctorParams);
System.Windows.Forms.Design (6)
System\ComponentModel\Design\DesignSurface.cs (1)
277ConstructorInfo? ctor = TypeDescriptor.GetReflectionType(type).GetConstructor([]);
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (2)
1924ConstructorInfo? ctor = GetReflectionTypeHelper(manager, value).GetConstructor([]); 2000if (descriptor.MemberInfo is ConstructorInfo)
System\ComponentModel\Design\Serialization\ComponentCodeDomSerializer.cs (1)
259ConstructorInfo? ctor = null;
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (1)
304foreach (ConstructorInfo info in TypeDescriptor.GetReflectionType(type).GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.CreateInstance))
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
279ConstructorInfo ctor = t.GetConstructor([]);
System.Windows.Forms.Tests (8)
System\Windows\Forms\AccessibleObjects\DataGridViewAccessibleObjectTests.cs (1)
265ConstructorInfo ctor = type.GetConstructor([typeof(DataGridView)]);
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (1)
25ConstructorInfo ctor = type.GetConstructor([typeof(ListViewGroup), typeof(bool)]);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (1)
21ConstructorInfo ctor = type.GetConstructor([typeof(ListViewItem)]);
System\Windows\Forms\AccessibleObjects\PropertyGridView.PropertyGridViewAccessibleObjectTests.cs (1)
206ConstructorInfo ctor = type.GetConstructor([typeof(PropertyGridView), typeof(PropertyGrid)]);
System\Windows\Forms\ListBindingHelperTests.cs (2)
802public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) 915protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
System\Windows\Forms\PropertyGridInternal\PropertyGridView.GridViewListBoxTests.cs (1)
30ConstructorInfo constructorInfo = gridViewListBoxAccessibleObjectType.GetConstructors()[0];
System\Windows\Forms\TableLayoutStyleTests.cs (1)
136public void TableLayoutStyle_ConverterConvertTo_InstanceDescriptorRowAbsolutePercent_ReturnsExpected(object value, ConstructorInfo expectedConstructor, object[] expectedArguments)
System.Xaml (29)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
330ConstructorInfo cinfo = cad.Constructor;
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\Replacements\TypeUriConverter.cs (1)
46ConstructorInfo constructor = typeof(Uri).GetConstructor(new Type[] { typeof(string), typeof(UriKind) });
System\Xaml\Context\XamlParserContext.cs (2)
169IEnumerable<ConstructorInfo> constructors = xamlType.GetConstructors(); 172foreach (ConstructorInfo ctr in constructors)
System\Xaml\Replacements\DateTimeOffsetConverter2.cs (1)
48ConstructorInfo constructor = typeof(DateTimeOffset).GetConstructor(new Type[]
System\Xaml\Runtime\DynamicMethodRuntime.cs (4)
197ConstructorInfo ctor = null; 205ConstructorInfo[] ctors = type.GetConstructors(BF_AllInstanceMembers); 207ctor = (ConstructorInfo)BindToMethod(BF_AllInstanceMembers, ctors, args); 316private FactoryDelegate CreateFactoryDelegate(ConstructorInfo ctor)
System\Xaml\Schema\XamlTypeInvoker.cs (2)
274private static ConstructorInfo s_actionCtor = 323ConstructorInfo tConstInfo = underlyingType.GetConstructor(Type.EmptyTypes);
System\Xaml\XamlObjectReader.cs (4)
1235else if (memberInfo is ConstructorInfo) 1237var ctor = (ConstructorInfo)memberInfo; 1637foreach (var constructor in valueXamlType.GetConstructors())
System\Xaml\XamlType.cs (13)
611internal IEnumerable<ConstructorInfo> GetConstructors() 615return EmptyList<ConstructorInfo>.Value; 625internal ConstructorInfo GetConstructor(Type[] paramTypes) 631IEnumerable<ConstructorInfo> ctors = GetConstructors(); 632ConstructorInfo[] ctorArray = ctors as ConstructorInfo[]; 635ctorArray = new List<ConstructorInfo>(ctors).ToArray(); 638return (ConstructorInfo)result; 748ConstructorInfo defaultCtor = underlyingType.GetConstructor(ConstructorBindingFlags, null, Type.EmptyTypes, null); 852foreach (ConstructorInfo ctor in GetConstructors()) 1446private IEnumerable<ConstructorInfo> GetPublicAndInternalConstructors() 1448foreach (ConstructorInfo ctor in UnderlyingType.GetConstructors(ConstructorBindingFlags)) 1581foreach (ConstructorInfo info in GetConstructors())
System\Xaml\XamlXmlWriter.cs (1)
1965ConstructorInfo constructor = objectXamlType.GetConstructor(paramClrTypes);
System.Xaml.Tests (2)
System\Windows\Markup\StaticExtensionTests.cs (1)
218Assert.Equal(new Type[] { typeof(string) }, Assert.IsAssignableFrom<ConstructorInfo>(descriptor.MemberInfo).GetParameters().Select(p => p.ParameterType));
System\Windows\Markup\TypeExtensionTests.cs (1)
180Assert.Equal(new Type[] { typeof(Type) }, Assert.IsAssignableFrom<ConstructorInfo>(descriptor.MemberInfo).GetParameters().Select(p => p.ParameterType));
xunit.console (1)
ConsoleRunner.cs (1)
162var ctor = type.GetConstructor(new Type[0]);