- Timestamp:
- 11/23/15 18:47:21 (9 years ago)
- Location:
- branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs
r12012 r13347 21 21 22 22 using System; 23 using System.Reflection; 23 24 using System.Text; 24 25 … … 37 38 Inherited = false)] 38 39 public class StorableAttribute : Attribute { 40 public static bool IsStorable(MemberInfo memberInfo) { 41 return Attribute.IsDefined(memberInfo, typeof(StorableAttribute), false); 42 } 43 public static StorableAttribute GetStorableAttribute(MemberInfo memberInfo) { 44 return (StorableAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(StorableAttribute), false); 45 } 39 46 40 47 /// <summary> -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassAttribute.cs
r12012 r13347 36 36 public StorableClassType Type { get; private set; } 37 37 38 public Guid Guid { get; private set; } 39 public bool Released { get; set; } 40 38 41 /// <summary> 39 42 /// Mark a class to be serialize by the <c>StorableSerizlier</c> 40 43 /// </summary> 41 44 /// <param name="type">The storable class type.</param> 42 public StorableClassAttribute(StorableClassType type ) {45 public StorableClassAttribute(StorableClassType type, string guid) { 43 46 Type = type; 47 Guid = new Guid(guid); 48 Released = false; 44 49 } 45 50 … … 61 66 } 62 67 68 public static StorableClassAttribute GetStorableClassAttribute(Type type) { 69 return (StorableClassAttribute)Attribute.GetCustomAttribute(type, typeof(StorableClassAttribute), false); 70 } 71 63 72 } 64 73 } -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableConstructorAttribute.cs
r12012 r13347 21 21 22 22 using System; 23 using System.Reflection; 23 24 24 25 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { … … 34 35 /// </summary> 35 36 [AttributeUsage(AttributeTargets.Constructor, Inherited = false, AllowMultiple = false)] 36 public sealed class StorableConstructorAttribute : Attribute { } 37 public sealed class StorableConstructorAttribute : Attribute { 38 public static bool IsStorableConstructor(ConstructorInfo constructorInfo) { 39 return Attribute.IsDefined(constructorInfo, typeof(StorableConstructorAttribute)); 40 } 41 } 37 42 } -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableHookAttribute.cs
r12012 r13347 21 21 22 22 using System; 23 using System.Linq; 24 using System.Reflection; 23 25 24 26 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { … … 50 52 [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)] 51 53 public sealed class StorableHookAttribute : Attribute { 54 public static bool IsStorableHook(MethodInfo methodInfo) { 55 return Attribute.IsDefined(methodInfo, typeof(StorableHookAttribute), false); 56 } 57 public static StorableHookAttribute[] GetStorableHookAttributes(MethodInfo methodInfo) { 58 return Attribute.GetCustomAttributes(methodInfo, false).OfType<StorableHookAttribute>().ToArray(); 59 } 52 60 53 61 private readonly HookType hookType;
Note: See TracChangeset
for help on using the changeset viewer.