Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/04/17 17:19:35 (7 years ago)
Author:
gkronber
Message:

#2520: changed all usages of StorableClass to use StorableType with an auto-generated GUID (did not add StorableType to other type definitions yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StorableAttribute.cs

    r14925 r14927  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2121
    2222using System;
     23using System.Reflection;
    2324using System.Text;
    2425
    25 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
     26namespace HeuristicLab.Persistence {
    2627
    2728
    2829  /// <summary>
    2930  /// Mark the member of a class to be considered by the <c>StorableSerializer</c>.
    30   /// The class must be marked as <c>[StorableClass]</c> and the
    31   /// <c>StorableClassType</c> should be set to <c>MarkedOnly</c> for
     31  /// The class must be marked as <c>[StorableClass("05FE6F11-87C6-435E-800A-166AFACCF5AC")]</c> and the
     32  /// <c>StorableMemberSelection</c> should be set to <c>MarkedOnly</c> for
    3233  /// this attribute to kick in.
    3334  /// </summary>
     
    3738    Inherited = false)]
    3839  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    }
    3946
    4047    /// <summary>
Note: See TracChangeset for help on using the changeset viewer.