Changeset 9869 for stable/HeuristicLab.Common/3.3/TypeExtensions.cs
- Timestamp:
- 08/07/13 15:55:43 (11 years ago)
- Location:
- stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 9855
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Common/3.3/TypeExtensions.cs
r9456 r9869 49 49 50 50 public static IEnumerable<FieldInfo> GetAllFields(this Type type) { 51 foreach (var field in type.GetFields(BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic)) 52 yield return field; 53 54 foreach (var field in type.GetFields(BindingFlags.Static | BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic)) 55 yield return field; 56 57 if (type.BaseType != null) { 58 foreach (var field in type.BaseType.GetAllFields()) 51 while (type != null) { 52 foreach (var field in type.GetFields(BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic)) 59 53 yield return field; 54 type = type.BaseType; 60 55 } 61 56 }
Note: See TracChangeset
for help on using the changeset viewer.