Changeset 3448
- Timestamp:
- 04/20/10 18:00:29 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs
r3444 r3448 34 34 [Content(typeof(IStringConvertibleMatrix), true)] 35 35 public partial class StringConvertibleMatrixView : AsynchronousContentView { 36 pr ivateint[] virtualRowIndizes;36 protected int[] virtualRowIndizes; 37 37 private List<KeyValuePair<int, SortOrder>> sortedColumnIndizes; 38 38 private RowComparer rowComparer; -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs
r3447 r3448 94 94 Content.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 95 95 Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 96 foreach (IRun run in Content) 96 RegisterRunEvents(Content); 97 } 98 protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) { 99 foreach (IRun run in runs) 97 100 run.Changed += new EventHandler(run_Changed); 98 101 } 99 100 102 protected override void DeregisterContentEvents() { 101 103 base.DeregisterContentEvents(); … … 105 107 Content.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 106 108 Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 107 foreach (IRun run in Content) 109 DeregisterRunEvents(Content); 110 } 111 protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) { 112 foreach (IRun run in runs) 108 113 run.Changed -= new EventHandler(run_Changed); 109 114 } 110 115 111 116 private void Content_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 112 foreach (IRun run in e.OldItems) 113 run.Changed -= new EventHandler(run_Changed); 114 foreach (IRun run in e.Items) 115 run.Changed += new EventHandler(run_Changed); 116 } 117 117 DeregisterRunEvents(e.OldItems); 118 RegisterRunEvents(e.Items); 119 } 118 120 private void Content_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 119 foreach (IRun run in e.OldItems) 120 run.Changed -= new EventHandler(run_Changed); 121 DeregisterRunEvents(e.OldItems); 121 122 } 122 123 private void Content_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 123 foreach (IRun run in e.Items) 124 run.Changed += new EventHandler(run_Changed); 124 RegisterRunEvents(e.Items); 125 125 } 126 126 private void run_Changed(object sender, EventArgs e) { -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTabularView.cs
r3447 r3448 57 57 get { return (RunCollection)base.Content; } 58 58 set { base.Content = value; } 59 } 60 61 protected override void RegisterContentEvents() { 62 base.RegisterContentEvents(); 63 Content.ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded); 64 Content.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 65 Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 66 RegisterRunEvents(Content); 67 } 68 protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) { 69 foreach (IRun run in runs) 70 run.Changed += new EventHandler(run_Changed); 71 } 72 protected override void DeregisterContentEvents() { 73 base.DeregisterContentEvents(); 74 Content.ItemsAdded -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded); 75 Content.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved); 76 Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 77 DeregisterRunEvents(Content); 78 } 79 protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) { 80 foreach (IRun run in runs) 81 run.Changed -= new EventHandler(run_Changed); 82 } 83 private void Content_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 84 DeregisterRunEvents(e.OldItems); 85 RegisterRunEvents(e.Items); 86 } 87 private void Content_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 88 DeregisterRunEvents(e.OldItems); 89 } 90 private void Content_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 91 RegisterRunEvents(e.Items); 92 } 93 private void run_Changed(object sender, EventArgs e) { 94 IRun run = (IRun)sender; 95 int rowIndex = Content.ToList().IndexOf(run); 96 rowIndex = virtualRowIndizes[rowIndex]; 97 this.dataGridView.Rows[rowIndex].Visible = run.Visible; 98 this.dataGridView.Rows[rowIndex].DefaultCellStyle.ForeColor = run.Color; 59 99 } 60 100
Note: See TracChangeset
for help on using the changeset viewer.