Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/17/11 15:10:19 (13 years ago)
Author:
epitzer
Message:

remove unused and unnecessary StorableClassType enum (#1530)

Location:
branches/PersistenceSpeedUp/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceSpeedUp/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassAnalyzer.cs

    r6222 r6224  
    119119        return;
    120120      var attribute = (StorableAttribute)fieldInfo.GetCustomAttributes(typeof(StorableAttribute), false).SingleOrDefault();
    121       if (attribute != null && classAttribute.Type != StorableClassType.AllProperties ||
    122         classAttribute.Type == StorableClassType.AllFields ||
    123         classAttribute.Type == StorableClassType.AllFieldsAndAllProperties)
     121      if (attribute != null)
    124122        typeDescriptor.Fields.Add(new FieldDescriptor(typeDescriptor, fieldInfo, attribute));
    125123    }
     
    131129      }
    132130      var attribute = (StorableAttribute)propertyInfo.GetCustomAttributes(typeof(StorableAttribute), false).SingleOrDefault();
    133       if (attribute != null && classAttribute.Type != StorableClassType.AllFields ||
    134         classAttribute.Type == StorableClassType.AllProperties ||
    135         classAttribute.Type == StorableClassType.AllFieldsAndAllProperties) {
    136         if (!(attribute != null && attribute.AllowOneWay ||
    137              propertyInfo.CanRead && propertyInfo.CanWrite))
     131      if (attribute != null) {
     132        if (!(attribute.AllowOneWay || propertyInfo.CanRead && propertyInfo.CanWrite))
    138133          throw new PersistenceException("Properties have to be read/write or marked as one way storable");
    139134        typeDescriptor.Properties.Add(new PropertyDescriptor(typeDescriptor, propertyInfo, attribute));
  • branches/PersistenceSpeedUp/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassAttribute.cs

    r5445 r6224  
    3030  public sealed class StorableClassAttribute : Attribute {
    3131
    32 
    33     /// <summary>
    34     /// Specify how members are selected for serialization.
    35     /// </summary>
    36     public StorableClassType Type { get; private set; }
    37 
    38     /// <summary>
    39     /// Mark a class to be serialize by the <c>StorableSerizlier</c>
    40     /// </summary>
    41     /// <param name="type">The storable class type.</param>
    42     public StorableClassAttribute(StorableClassType type) {
    43       Type = type;
    44     }
    45 
    4632    /// <summary>
    4733    /// Initializes a new instance of the <see cref="StorableClassAttribute"/> class.
     
    5137    public StorableClassAttribute() { }
    5238
    53     /// <summary>
    54     ///  Checks if the <see cref="StorableClassAttribute"/> is present on a type.
    55     /// </summary>
    56     /// <param name="type">The type which should be checked for the <see cref="StorableClassAttribute"/></param>
    57     /// <returns></returns>
    58     public static bool IsStorableClass(Type type) {
    59       object[] attribs = type.GetCustomAttributes(typeof(StorableClassAttribute), false);
    60       return attribs.Length > 0;
    61     }
    62 
    6339  }
    6440}
Note: See TracChangeset for help on using the changeset viewer.