Changeset 6221 for branches/PersistenceSpeedUp
- Timestamp:
- 05/17/11 14:19:51 (14 years ago)
- Location:
- branches/PersistenceSpeedUp/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/Descriptors
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceSpeedUp/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/Descriptors/FieldDescriptor.cs
r6214 r6221 20 20 #endregion 21 21 using System; 22 using System.Collections.Generic;23 using System.Linq;24 22 using System.Reflection; 25 23 using System.Text; 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;27 24 28 25 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable.Descriptors { … … 35 32 36 33 #region Fields & Properties 37 34 38 35 /// <summary> 39 36 /// The type that declared this field. … … 75 72 public FieldInfo Handle { 76 73 get { 77 try { 78 if (handle == null) 79 handle = DeclaringType.Handle.GetField(RealName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); 80 } catch { } 74 if (handle == null) 75 handle = DeclaringType.Handle.GetField(RealName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); 81 76 return handle; 82 77 } 83 78 } 84 79 #endregion 85 80 86 81 [StorableConstructor] 87 82 private FieldDescriptor(bool deserializing) { } -
branches/PersistenceSpeedUp/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/Descriptors/HookDescriptor.cs
r6214 r6221 20 20 #endregion 21 21 using System; 22 using System.Collections.Generic;23 using System.Linq;24 22 using System.Reflection; 25 23 using System.Text; 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;27 24 using HeuristicLab.Persistence.Auxiliary; 28 25 … … 54 51 public HookType HookType { get; set; } 55 52 56 privateMethodInfo handle;53 internal MethodInfo handle; 57 54 /// <summary> 58 55 /// The MethodInfo of the hook as obtained by reflection. … … 60 57 public MethodInfo Handle { 61 58 get { 62 try { 63 if (handle == null) 64 handle = DeclaringType.Handle.GetMethod(MethodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); 65 } catch { } 59 if (handle == null) 60 handle = DeclaringType.Handle.GetMethod(MethodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); 66 61 return handle; 67 }68 internal set {69 handle = value;70 62 } 71 63 } -
branches/PersistenceSpeedUp/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/Descriptors/PropertyDescriptor.cs
r6214 r6221 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Linq;25 23 using System.Reflection; 26 24 using System.Text; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;28 25 29 26 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable.Descriptors { … … 35 32 public sealed class PropertyDescriptor : ITypeComponent { 36 33 34 #region Fields & Properties 37 35 /// <summary> 38 36 /// The type descriptor of the type who declared this property. This … … 82 80 public string Name { get { return StoredName ?? RealName; } } 83 81 84 #region Activation 85 private PropertyInfo handle; 82 internal PropertyInfo handle; 86 83 /// <summary> 87 84 /// The PropertyInfo object as obtained by reflection representing … … 90 87 public PropertyInfo Handle { 91 88 get { 92 try { 93 if (handle == null) 94 handle = DeclaringType.Handle.GetProperty(RealName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); 95 } catch { } 89 if (handle == null) 90 handle = DeclaringType.Handle.GetProperty(RealName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); 96 91 return handle; 97 92 } 98 internal set {99 handle = value;100 }101 93 } 102 94 #endregion … … 119 111 120 112 [StorableConstructor] 121 private PropertyDescriptor(bool deserializing) 113 private PropertyDescriptor(bool deserializing) { } 122 114 123 115 /// <summary> … … 136 128 CanRead = propertyInfo.CanRead; 137 129 CanWrite = propertyInfo.CanWrite; 138 Handle = propertyInfo;130 handle = propertyInfo; 139 131 } 140 132 -
branches/PersistenceSpeedUp/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/Descriptors/TypeDescriptor.cs
r6214 r6221 91 91 public bool IsInvalid { get; set; } 92 92 93 privateType handle;93 internal Type handle; 94 94 /// <summary> 95 95 /// Get the System.Type handle representing this type. … … 97 97 public Type Handle { 98 98 get { 99 if (handle != null) 100 return handle; 101 try { 99 if (handle == null) 102 100 handle = Type.GetType(AssemblyQualifiedName); 103 return handle; 104 } catch { 105 return null; 106 } 101 return handle; 107 102 } 108 103 }
Note: See TracChangeset
for help on using the changeset viewer.