Free cookie consent management tool by TermsFeed Policy Generator

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

streamline access and don't eat exceptions when access unavailable types and members (#1530)

File:
1 edited

Legend:

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

    r6214 r6221  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    2523using System.Reflection;
    2624using System.Text;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2825
    2926namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable.Descriptors {
     
    3532  public sealed class PropertyDescriptor : ITypeComponent {
    3633
     34    #region Fields & Properties
    3735    /// <summary>
    3836    /// The type descriptor of the type who declared this property. This
     
    8280    public string Name { get { return StoredName ?? RealName; } }
    8381
    84     #region Activation
    85     private PropertyInfo handle;
     82    internal PropertyInfo handle;
    8683    /// <summary>
    8784    /// The PropertyInfo object as obtained by reflection representing
     
    9087    public PropertyInfo Handle {
    9188      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);
    9691        return handle;
    9792      }
    98       internal set {
    99         handle = value;
    100       }
    10193    }
    10294    #endregion
     
    119111
    120112    [StorableConstructor]
    121     private PropertyDescriptor(bool deserializing)  { }
     113    private PropertyDescriptor(bool deserializing) { }
    122114
    123115    /// <summary>
     
    136128      CanRead = propertyInfo.CanRead;
    137129      CanWrite = propertyInfo.CanWrite;
    138       Handle = propertyInfo;
     130      handle = propertyInfo;
    139131    }
    140132
Note: See TracChangeset for help on using the changeset viewer.