Changeset 8086 for branches/ScatterSearch (trunk integration)/HeuristicLab.Common/3.3/ObjectExtensions.cs
- Timestamp:
- 06/22/12 11:11:38 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 20 20 bin 21 21 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Common/3.3/ObjectExtensions.cs
r7467 r8086 31 31 namespace HeuristicLab.Common { 32 32 public static class ObjectExtensions { 33 public static IEnumerable<T> ToEnumerable<T>(this T item) { 34 return new[] { item }; 35 } 36 33 37 public static IEnumerable<object> GetObjectGraphObjects(this object obj, HashSet<string> excludedMembers = null, bool excludeStaticMembers = false) { 34 38 if (obj == null) return Enumerable.Empty<object>(); … … 57 61 /// * System.Reflection.Pointer 58 62 /// * Primitives (Boolean, Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, IntPtr, UIntPtr, Char, Double, Single) 59 /// * string, decimal 63 /// * string, decimal, DateTime 60 64 /// * Arrays of types not collected 61 65 /// … … 67 71 type == typeof(string) || 68 72 type == typeof(decimal) || 73 type == typeof(DateTime) || 69 74 typeof(Delegate).IsAssignableFrom(type) || 70 75 typeof(Pointer).IsAssignableFrom(type) || 76 type == typeof(string[]) || 77 type == typeof(DateTime[]) || 71 78 (type.HasElementType && ExcludeType(type.GetElementType())); 72 79 }
Note: See TracChangeset
for help on using the changeset viewer.