Catel.Reflection.TypeInfoExtensions.GetConstructors C# (CSharp) Method

GetConstructors() public static method

Gets the constructors.
The is null.
public static GetConstructors ( this typeInfo, BindingFlags bindingFlags ) : System.Reflection.ConstructorInfo[]
typeInfo this The .
bindingFlags BindingFlags The binding flags.
return System.Reflection.ConstructorInfo[]
        public static ConstructorInfo[] GetConstructors(this TypeInfo typeInfo, BindingFlags bindingFlags)
        {
            Argument.IsNotNull("typeInfo", typeInfo);

#if NETFX_CORE
            var source = typeInfo.DeclaredConstructors.ToArray();
#else
            var source = typeInfo.GetConstructors(bindingFlags);
#endif

            var includeStatics = Enum<BindingFlags>.Flags.IsFlagSet(bindingFlags, BindingFlags.Static);
            if (!includeStatics)
            {
                source = (from x in source
                          where !x.IsStatic
                          select x).ToArray();
            }

            return (from x in source
                    select x).ToArray();
        }