Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/14/10 00:42:28 (15 years ago)
Author:
epitzer
Message:

Update API docs. (#548)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs

    r2994 r3016  
    99
    1010  /// <summary>
    11   /// Mark the member of a class to be considered by the <code>StorableSerializer</code>.
    12   /// The class must be marked as <code>[StorableClass(StorableClassType.Empty)]</code> and the
    13   /// <code>StorableClassType</code> should be set to <code>MarkedOnly</code> for
     11  /// Mark the member of a class to be considered by the <c>StorableSerializer</c>.
     12  /// The class must be marked as <c>[StorableClass(StorableClassType.Empty)]</c> and the
     13  /// <c>StorableClassType</c> should be set to <c>MarkedOnly</c> for
    1414  /// this attribute to kick in.
    1515  /// </summary>
     
    2222    /// <summary>
    2323    /// An optional name for this member that will be used during serialization.
    24     ///
    2524    /// This allows to rename a field/property in code but still be able to read
    2625    /// the old serialized format.
    2726    /// </summary>
     27    /// <value>The name.</value>
    2828    public string Name { get; set; }
    2929
     
    3434    /// deserialization.
    3535    /// </summary>
     36    /// <value>The default value.</value>
    3637    public object DefaultValue { get; set; }
    3738
     39    /// <summary>
     40    /// Returns a <see cref="System.String"/> that represents this instance.
     41    /// </summary>
     42    /// <returns>
     43    /// A <see cref="System.String"/> that represents this instance.
     44    /// </returns>
    3845    public override string ToString() {
    3946      StringBuilder sb = new StringBuilder();
     
    6067      BindingFlags.DeclaredOnly;
    6168
     69    /// <summary>
     70    /// Encapsulate information about storable members of a class
     71    /// that have the storable attribute set.
     72    /// </summary>
    6273    public sealed class StorableMemberInfo {
     74
     75      /// <summary>
     76      /// Gets the [Storable] attribute itself.
     77      /// </summary>
     78      /// <value>The [Storable] attribute.</value>
    6379      public StorableAttribute Attribute { get; private set; }
     80
     81      /// <summary>
     82      /// Gets the .NET reflection MemberInfo.
     83      /// </summary>
     84      /// <value>The member info.</value>
    6485      public MemberInfo MemberInfo { get; private set; }
     86
     87
     88      /// <summary>
     89      /// Gets disentangled name (i.e. unique access name regardless of
     90      /// type hierarchy.
     91      /// </summary>
     92      /// <value>The disentangled name.</value>
    6593      public string DisentangledName { get; private set; }
     94
     95
     96      /// <summary>
     97      /// Gets the fully qualified member name.
     98      /// </summary>
     99      /// <value>The the fully qualified member name.</value>
    66100      public string FullyQualifiedMemberName {
    67101        get {
     
    73107        }
    74108      }
    75       public StorableMemberInfo(StorableAttribute attribute, MemberInfo memberInfo) {
     109
     110      internal StorableMemberInfo(StorableAttribute attribute, MemberInfo memberInfo) {
    76111        this.Attribute = attribute;
    77112        this.MemberInfo = memberInfo;
    78113      }
     114
     115      /// <summary>
     116      /// Returns a <see cref="System.String"/> that represents this instance.
     117      /// </summary>
     118      /// <returns>
     119      /// A <see cref="System.String"/> that represents this instance.
     120      /// </returns>
    79121      public override string ToString() {
    80122        return new StringBuilder()
     
    82124          .Append(MemberInfo).Append('}').ToString();
    83125      }
    84       public void SetDisentangledName(string name) {
     126
     127      internal void SetDisentangledName(string name) {
    85128        DisentangledName = Attribute.Name ?? name;
    86129      }
     130
     131      /// <summary>
     132      /// Gets the delcaring type of the property.
     133      /// </summary>
     134      /// <returns></returns>
    87135      public Type GetPropertyDeclaringBaseType() {
    88136        return ((PropertyInfo)MemberInfo).GetGetMethod(true).GetBaseDefinition().DeclaringType;
     
    90138    }
    91139
    92     sealed class TypeQuery {
     140    private sealed class TypeQuery {
    93141      public Type Type { get; private set; }
    94142      public bool Inherited { get; private set; }
     
    99147    }
    100148
    101     sealed class MemberCache : Dictionary<TypeQuery, IEnumerable<StorableMemberInfo>> { }
     149    private sealed class MemberCache : Dictionary<TypeQuery, IEnumerable<StorableMemberInfo>> { }
    102150
    103151    private static MemberCache memberCache = new MemberCache();
     
    106154    /// <summary>
    107155    /// Get all fields and properties of a class that have the
    108     /// <code>[Storable]</code> attribute set.
    109     /// </summary>   
     156    /// <c>[Storable]</c> attribute set.
     157    /// </summary>
     158    /// <param name="type">The type.</param>
     159    /// <returns>An enumerable of StorableMemberInfos.</returns>
    110160    public static IEnumerable<StorableMemberInfo> GetStorableMembers(Type type) {
    111161      return GetStorableMembers(type, true);
     
    114164    /// <summary>
    115165    /// Get all fields and properties of a class that have the
    116     /// <code>[Storable]</code> attribute set.
    117     /// </summary>       
    118     /// <param name="inherited">should storable members from base classes be included</param>   
     166    /// <c>[Storable]</c> attribute set.
     167    /// </summary>
     168    /// <param name="type">The type.</param>
     169    /// <param name="inherited">should storable members from base classes be included</param>
     170    /// <returns>An enumerable of StorableMemberInfos</returns>
    119171    public static IEnumerable<StorableMemberInfo> GetStorableMembers(Type type, bool inherited) {
    120172      lock (memberCache) {
     
    144196    /// Get the associated accessors for all storable memebrs.
    145197    /// </summary>
    146     /// <param name="obj"></param>
    147     /// <returns></returns>
     198    /// <param name="obj">The object</param>
     199    /// <returns>An enumerable of storable accessors.</returns>
    148200    public static IEnumerable<DataMemberAccessor> GetStorableAccessors(object obj) {     
    149201      foreach (var memberInfo in GetStorableMembers(obj.GetType()))
Note: See TracChangeset for help on using the changeset viewer.