Changeset 4644 for trunk/sources/HeuristicLab.Analysis
- Timestamp:
- 10/25/10 15:06:21 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Analysis/3.3
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis/3.3/DataRow.cs
r3431 r4644 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.ComponentModel; 22 25 using HeuristicLab.Collections; 23 26 using HeuristicLab.Common; … … 32 35 [StorableClass] 33 36 public sealed class DataRow : NamedItem { 34 [Storable] 37 private DataRowVisualProperties visualProperties; 38 public DataRowVisualProperties VisualProperties { 39 get { return visualProperties; } 40 set { 41 if (visualProperties != value) { 42 if (value == null) throw new ArgumentNullException("VisualProperties"); 43 if (visualProperties != null) visualProperties.PropertyChanged -= new PropertyChangedEventHandler(VisualProperties_PropertyChanged); 44 visualProperties = value; 45 visualProperties.PropertyChanged += new PropertyChangedEventHandler(VisualProperties_PropertyChanged); 46 OnVisualPropertiesChanged(); 47 } 48 } 49 } 35 50 private ObservableList<double> values; 36 51 public IObservableList<double> Values { … … 38 53 } 39 54 55 #region Persistence Properties 56 [Storable(Name = "VisualProperties")] 57 private DataRowVisualProperties StorableVisualProperties { 58 get { return VisualProperties; } 59 set { VisualProperties = value; } 60 } 61 [Storable(Name = "values")] 62 private IEnumerable<double> StorableValues { 63 get { return values; } 64 set { values = new ObservableList<double>(value); } 65 } 66 #endregion 67 40 68 public DataRow() 41 69 : base() { 70 VisualProperties = new DataRowVisualProperties(); 42 71 values = new ObservableList<double>(); 43 72 } 44 73 public DataRow(string name) 45 74 : base(name) { 75 VisualProperties = new DataRowVisualProperties(); 46 76 values = new ObservableList<double>(); 47 77 } 48 78 public DataRow(string name, string description) 49 79 : base(name, description) { 80 VisualProperties = new DataRowVisualProperties(); 50 81 values = new ObservableList<double>(); 51 82 } 83 public DataRow(string name, string description, DataRowVisualProperties visualProperties) 84 : base(name, description) { 85 VisualProperties = visualProperties; 86 values = new ObservableList<double>(); 87 } 88 [StorableConstructor] 89 private DataRow(bool deserializing) { } 90 91 // BackwardsCompatibility3.3 92 #region Backwards compatible code, remove with 3.4 93 [StorableHook(HookType.AfterDeserialization)] 94 private void AfterDeserialization() { 95 if (VisualProperties == null) VisualProperties = new DataRowVisualProperties(); 96 } 97 #endregion 52 98 53 99 public override IDeepCloneable Clone(Cloner cloner) { 54 100 DataRow clone = new DataRow(Name, Description); 55 101 cloner.RegisterClonedObject(this, clone); 102 clone.VisualProperties = (DataRowVisualProperties)cloner.Clone(visualProperties); 56 103 clone.values.AddRange(values); 57 104 return clone; 58 105 } 106 107 public event EventHandler VisualPropertiesChanged; 108 private void OnVisualPropertiesChanged() { 109 EventHandler handler = VisualPropertiesChanged; 110 if (handler != null) handler(this, EventArgs.Empty); 111 } 112 113 private void VisualProperties_PropertyChanged(object sender, PropertyChangedEventArgs e) { 114 OnVisualPropertiesChanged(); 115 } 59 116 } 60 117 } -
trunk/sources/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj
r4641 r4644 118 118 <Compile Include="Allele.cs" /> 119 119 <Compile Include="AlleleFrequency.cs" /> 120 <Compile Include="DataRowVisualProperties.cs" /> 120 121 <Compile Include="QualityAnalyzer.cs" /> 121 122 <Compile Include="MinAverageMaxValueAnalyzer.cs" />
Note: See TracChangeset
for help on using the changeset viewer.