Changeset 3016 for trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/DataMemberAccessor.cs
- Timestamp:
- 03/14/10 00:42:28 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/DataMemberAccessor.cs
r3004 r3016 12 12 public class DataMemberAccessor { 13 13 14 /// <summary> 15 /// The function to get the value of the data member. 16 /// </summary> 14 17 public readonly Func<object> Get; 18 19 /// <summary> 20 /// The function to set the value of the data member. 21 /// </summary> 15 22 public readonly Action<object> Set; 23 24 /// <summary> 25 /// The name of the data member. 26 /// </summary> 16 27 public readonly string Name; 28 29 /// <summary> 30 /// The default value of the data member, can remain <c>null</c> 31 /// if no default value. If left null, this will also leave the 32 /// default value for value types (e.g. 0 for <c>int</c>). 33 /// </summary> 17 34 public readonly object DefaultValue; 18 35 19 36 20 37 /// <summary> 21 /// Create a DataMemberAccessor from a FieldInfo or PropertyInfo for the give object. 38 /// Create a <see cref="DataMemberAccessor"/> from a FieldInfo or 39 /// PropertyInfo for the give object. 22 40 /// </summary> 41 /// <param name="memberInfo">The member info.</param> 42 /// <param name="name">The name.</param> 43 /// <param name="defaultvalue">The defaultvalue.</param> 44 /// <param name="obj">The object.</param> 23 45 public DataMemberAccessor(MemberInfo memberInfo, string name, object defaultvalue, object obj) { 24 46 Name = name; … … 45 67 /// Wrap existing getter and setter functions. 46 68 /// </summary> 69 /// <param name="name">The name.</param> 70 /// <param name="defaultValue">The default value.</param> 71 /// <param name="getter">The getter.</param> 72 /// <param name="setter">The setter.</param> 47 73 public DataMemberAccessor(string name, object defaultValue, 48 74 Func<object> getter, Action<object> setter) { … … 52 78 Set = setter; 53 79 } 54 80 55 81 /// <summary> 56 82 /// Create an empty accessor that just encapsulates an object 57 83 /// without access. 58 84 /// </summary> 85 /// <param name="o">The object</param> 59 86 public DataMemberAccessor(object o) { 60 87 Name = null; … … 68 95 /// without access. 69 96 /// </summary> 97 /// <param name="o">The object</param> 98 /// <param name="name">The object's name.</param> 70 99 public DataMemberAccessor(object o, string name) { 71 100 Name = name; … … 75 104 } 76 105 106 /// <summary> 107 /// Returns a <see cref="System.String"/> that represents this instance. 108 /// </summary> 109 /// <returns> 110 /// A <see cref="System.String"/> that represents this instance. 111 /// </returns> 77 112 public override string ToString() { 78 113 return String.Format("DataMemberAccessor({0}, {1}, {2}, {3})",
Note: See TracChangeset
for help on using the changeset viewer.