Changeset 6025
- Timestamp:
- 04/19/11 10:05:54 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Parameters/3.3/ValueParameter.cs
r5843 r6025 54 54 public ValueParameter(string name, string description, T value) : base(name, description, value) { } 55 55 public ValueParameter(string name, string description, T value, bool getsCollected) : base(name, description, value, getsCollected) { } 56 57 protected T CreateDefaultValue() { 58 Type type = typeof(T); 59 if (type.IsAbstract) return null; 60 ConstructorInfo defaultConstructor = type.GetConstructor(Type.EmptyTypes); 61 if (defaultConstructor == null) return null; 56 62 57 protected T CreateDefaultValue() { 58 ConstructorInfo defaultConstructor = typeof(T).GetConstructor(Type.EmptyTypes); 59 if (defaultConstructor != null) 60 return (T)defaultConstructor.Invoke(new object[0]); 61 return null; 63 return (T)defaultConstructor.Invoke(new object[0]); 62 64 } 63 65
Note: See TracChangeset
for help on using the changeset viewer.