Changeset 6181 for trunk/sources/HeuristicLab.Common/3.3
- Timestamp:
- 05/11/11 13:44:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Common/3.3/ObjectExtensions.cs
r6119 r6181 34 34 35 35 private static void CollectObjectGraphObjects(this object obj, HashSet<object> objects) { 36 if (obj == null || obj is Delegate || obj is EventHandler || obj.GetType().IsSubclassOfRawGeneric(typeof(EventHandler<>)) || objects.Contains(obj)) return; 36 if (obj == null || objects.Contains(obj)) return; 37 if (obj is ValueType || obj is string) return; 38 if (obj is Delegate || obj is EventHandler) return; 39 if (obj.GetType().IsSubclassOfRawGeneric(typeof(EventHandler<>))) return; 40 if (obj.GetType().GetElementType() != null) { 41 Type elementType = obj.GetType().GetElementType(); 42 if (elementType.IsPrimitive || elementType == typeof(string) || elementType == typeof(decimal)) return; 43 } 44 37 45 objects.Add(obj); 38 39 if (obj is ValueType || obj is string) return;40 46 41 47 IEnumerable enumerable = obj as IEnumerable;
Note: See TracChangeset
for help on using the changeset viewer.