- Timestamp:
- 04/16/09 12:58:14 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Core/StorableAttribute.cs
r1555 r1566 7 7 [AttributeUsage( 8 8 AttributeTargets.Field | AttributeTargets.Property, 9 AllowMultiple =false,10 Inherited =false)]9 AllowMultiple = false, 10 Inherited = false)] 11 11 public class StorableAttribute : Attribute { 12 12 … … 19 19 BindingFlags.NonPublic | 20 20 BindingFlags.DeclaredOnly; 21 21 22 22 public static IEnumerable<KeyValuePair<StorableAttribute, MemberInfo>> GetStorableMembers(Type type) { 23 return GetStorableMembers(type, true); 23 return GetStorableMembers(type, true); 24 24 } 25 25 … … 27 27 GetStorableMembers(Type type, bool inherited) { 28 28 if (type.BaseType != null) 29 foreach ( var pair in GetStorableMembers(type.BaseType))29 foreach (var pair in GetStorableMembers(type.BaseType)) 30 30 yield return pair; 31 31 foreach (MemberInfo memberInfo in type.GetMembers(instanceMembers)) { 32 foreach (object attribute in memberInfo.GetCustomAttributes(false)) { 32 foreach (object attribute in memberInfo.GetCustomAttributes(false)) { 33 33 StorableAttribute storableAttribute = 34 34 attribute as StorableAttribute; 35 35 if (storableAttribute != null) { 36 yield return new KeyValuePair<StorableAttribute, MemberInfo>(storableAttribute, memberInfo); 36 yield return new KeyValuePair<StorableAttribute, MemberInfo>(storableAttribute, memberInfo); 37 37 } 38 38 } 39 } 39 } 40 40 } 41 41 … … 46 46 storableAccessors.Add(pair.Value.Name, 47 47 new DataMemberAccessor(pair.Value, pair.Key, obj)); 48 } 48 } 49 49 return storableAccessors; 50 } 50 } 51 51 } 52 52 }
Note: See TracChangeset
for help on using the changeset viewer.