@@ -22,7 +22,8 @@ public static MemberInfo[] GetAllPublicInstanceFieldAndProperty(Type cls, params
22
22
23
23
static MemberInfo [ ] GetMembers ( Type cls , BindingFlags flags , string [ ] namesToIgnore )
24
24
{
25
- if ( cls == null ) throw new ArgumentNullException ( nameof ( cls ) ) ;
25
+ if ( cls == null )
26
+ throw new ArgumentNullException ( nameof ( cls ) ) ;
26
27
27
28
28
29
var members = cls . GetMembers ( flags )
@@ -42,7 +43,8 @@ static MemberInfo[] GetMembers(Type cls, BindingFlags flags, string[] namesToIgn
42
43
///<summary>Try get value type of field or property.</summary>
43
44
public static bool TryGetFieldOrPropertyType ( MemberInfo info , out Type outType )
44
45
{
45
- if ( info == null ) throw new ArgumentNullException ( nameof ( info ) ) ;
46
+ if ( info == null )
47
+ throw new ArgumentNullException ( nameof ( info ) ) ;
46
48
47
49
48
50
outType = null ;
@@ -68,7 +70,8 @@ public static bool TryGetFieldOrPropertyType(MemberInfo info, out Type outType)
68
70
public static Dictionary < string , TValue > GetEnumNamesAndValuesAsDictionary < TValue > ( Type enumType )
69
71
where TValue : struct
70
72
{
71
- if ( enumType ? . IsEnum != true ) throw new ArgumentException ( nameof ( enumType ) ) ;
73
+ if ( enumType ? . IsEnum != true )
74
+ throw new ArgumentException ( nameof ( enumType ) ) ;
72
75
73
76
74
77
var names = enumType . GetEnumNames ( ) ;
@@ -91,7 +94,8 @@ public static Dictionary<string, TValue> GetEnumNamesAndValuesAsDictionary<TValu
91
94
public static ( string [ ] , TValue [ ] ) GetEnumNamesAndValuesAsTuple < TValue > ( Type enumType )
92
95
where TValue : struct
93
96
{
94
- if ( enumType ? . IsEnum != true ) throw new ArgumentException ( nameof ( enumType ) ) ;
97
+ if ( enumType ? . IsEnum != true )
98
+ throw new ArgumentException ( nameof ( enumType ) ) ;
95
99
96
100
return ( enumType . GetEnumNames ( ) , enumType . GetEnumValues ( ) . Cast < TValue > ( ) . ToArray ( ) ) ;
97
101
}
0 commit comments