Gets the options for command line configuration for the given type. The type. The list of configurable options.
(Type type)
| 101 | /// <param name="type">The type.</param> |
| 102 | /// <returns>The list of configurable options.</returns> |
| 103 | public static Dictionary<CommandLineAttribute, MemberInfo> GetMembers(Type type) |
| 104 | { |
| 105 | if (type == null) |
| 106 | throw new ArgumentNullException(); |
| 107 | |
| 108 | var result = new Dictionary<CommandLineAttribute, MemberInfo>(); |
| 109 | |
| 110 | var members = type.GetMembers(BindingFlags.Static | BindingFlags.Public); |
| 111 | |
| 112 | for (int i = 0; i < members.Length; i++) |
| 113 | { |
| 114 | var member = members[i]; |
| 115 | |
| 116 | var attribute = member.GetCustomAttribute<CommandLineAttribute>(); |
| 117 | if (attribute != null) |
| 118 | { |
| 119 | result.Add(attribute, member); |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | return result; |
| 124 | } |
| 125 | |
| 126 | /// <summary> |
| 127 | /// Gets the options for command line configuration for the given object instance. |