NSoft.NFramework.Tools.TypeTool.HasDefaultConstructor C# (CSharp) Method

HasDefaultConstructor() public static method

지정된 수형이 인자가 없는 기본 생성자를 제공하는지 여부를 반환합니다.
public static HasDefaultConstructor ( this type ) : bool
type this
return bool
        public static bool HasDefaultConstructor(this Type type) {
            type.ShouldNotBeNull("type");

            if(type.IsValueType)
                return true;

            return (type.GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, new Type[0], null) != null);
        }