1 using System
.Reflection
;
6 public static int Main(string[] args
) {
7 string defaultn
= "System.Reflection.ParameterAttributes";
8 string name
= defaultn
;
10 foreach (string arg
in args
) {
16 Type t
= Type
.GetType (name
);
17 Array values
= Enum
.GetValues (t
);
18 string[] names
= Enum
.GetNames (t
);
22 Console
.WriteLine ("Enum "+t
.Name
);
23 for (i
= 0; i
< names
.Length
; ++i
) {
24 Console
.WriteLine ("{0} = {1} (ToString: {2})", names
[i
], ((int)values
.GetValue(i
)).ToString(), values
.GetValue(i
));
27 if (name
== defaultn
) {
28 string[] truenames
= {"None", "In", "Out", "Lcid", "Retval",
29 "Optional", "HasDefault", "HasFieldMarshal",
30 "Reserved3", "Reserved4", "ReservedMask"};
31 int[] truevalues
= {0, 1, 2, 4, 8, 16, 4096, 8192,
34 for (i
= 0; i
< names
.Length
; ++i
) {
35 if (names
[i
] != truenames
[i
])
37 if ((int)values
.GetValue (i
) != truevalues
[i
])
38 return 1 + names
.Length
+ i
;