Changeset 7139
- Timestamp:
- 12/06/11 18:04:29 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Common/3.3/ObjectExtensions.cs
r6891 r7139 26 26 using System.Linq; 27 27 using System.Reflection; 28 using System.Security; 28 29 using System.Threading; 29 30 … … 95 96 foreach (FieldInfo f in type.GetAllFields()) { 96 97 if (excludeStaticMembers && f.IsStatic) continue; 97 yield return f.GetValue(obj); 98 object fieldValue; 99 try { 100 fieldValue = f.GetValue(obj); 101 } catch (SecurityException) { 102 continue; 103 } 104 yield return fieldValue; 98 105 } 99 106 }
Note: See TracChangeset
for help on using the changeset viewer.