- Timestamp:
- 11/27/14 09:35:43 (10 years ago)
- Location:
- branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/ResultCollectionView.cs
r10042 r11591 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Core.Views; 24 25 using HeuristicLab.MainForm; 25 using HeuristicLab.MainForm.WindowsForms;26 26 27 27 namespace HeuristicLab.Optimization.Views { … … 33 33 public override bool ReadOnly { 34 34 get { return true; } 35 set { /* 35 set { /*not needed because results are always readonly */} 36 36 } 37 37 … … 45 45 return null; 46 46 } 47 48 protected override void itemsListView_DoubleClick(object sender, EventArgs e) { 49 if (itemsListView.SelectedItems.Count == 1) { 50 IResult result = itemsListView.SelectedItems[0].Tag as IResult; 51 if (result != null) { 52 IContentView view = MainFormManager.MainForm.ShowContent(result, typeof(ResultView)); 53 if (view != null) { 54 view.ReadOnly = ReadOnly; 55 view.Locked = Locked; 56 } 57 } 58 } 59 } 47 60 } 48 61 } -
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
r10103 r11591 237 237 #region ListView Events 238 238 private void itemsListView_SelectedIndexChanged(object sender, EventArgs e) { 239 removeButton.Enabled = Content != null && !Content.IsReadOnly && !ReadOnly && itemsListView.SelectedItems.Count > 0;239 removeButton.Enabled = itemsListView.SelectedItems.Count > 0 && (Content != null) && !Content.IsReadOnly && !ReadOnly; 240 240 // for performance reason (multiple selection fires this handler for every selected item) 241 241 if (itemsListView.SelectedIndices.Count <= 1) 242 242 AdjustListViewColumnSizes(); 243 if (itemsListView.SelectedItems.Count == 1) { 244 var item = (IRun)itemsListView.SelectedItems[0].Tag; 245 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 246 var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this, true); 247 if (outermostViewHost != null && outermostViewHost.HotlinkingEnabled) { 248 outermostViewHost.ActiveView.ReadOnly = ReadOnly; 249 outermostViewHost.ActiveView.Locked = Locked; 243 if (showDetailsCheckBox.Checked) { 244 if (itemsListView.SelectedItems.Count == 1) { 245 IRun item = (IRun)itemsListView.SelectedItems[0].Tag; 246 detailsGroupBox.Enabled = true; 247 viewHost.Content = item; 250 248 } else { 251 if (showDetailsCheckBox.Checked) { 252 detailsGroupBox.Enabled = true; 253 viewHost.Content = item; 254 } else { 255 viewHost.Content = null; 256 detailsGroupBox.Enabled = false; 257 } 249 viewHost.Content = null; 250 detailsGroupBox.Enabled = false; 258 251 } 259 252 } … … 273 266 private void itemsListView_DoubleClick(object sender, EventArgs e) { 274 267 if (itemsListView.SelectedItems.Count == 1) { 275 var item = (IRun)itemsListView.SelectedItems[0].Tag; 276 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 277 var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this); 278 if (outermostViewHost != null) { 279 outermostViewHost.ActiveView.ReadOnly = ReadOnly; 280 outermostViewHost.ActiveView.Locked = Locked; 268 IRun item = itemsListView.SelectedItems[0].Tag as IRun; 269 if (item != null) { 270 IContentView view = MainFormManager.MainForm.ShowContent(item); 271 if (view != null) { 272 view.ReadOnly = ReadOnly; 273 view.Locked = Locked; 274 } 281 275 } 282 276 } … … 391 385 try { 392 386 RunCollection.Modify(); 393 } finally { 387 } 388 finally { 394 389 ReadOnly = false; 395 390 } -
branches/Breadcrumbs/HeuristicLab.Optimization.Views/3.3/RunView.cs
r10103 r11591 26 26 using HeuristicLab.Core.Views; 27 27 using HeuristicLab.MainForm; 28 using HeuristicLab.MainForm.WindowsForms;29 28 30 29 namespace HeuristicLab.Optimization.Views { … … 128 127 129 128 private void listView_SelectedIndexChanged(object sender, EventArgs e) { 130 if (listView.SelectedItems.Count == 1) { 131 var item = (IItem)listView.SelectedItems[0].Tag; 132 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 133 var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this, true); 134 if (outermostViewHost != null && outermostViewHost.HotlinkingEnabled) { 135 outermostViewHost.ActiveView.ReadOnly = ReadOnly; 136 outermostViewHost.ActiveView.Locked = Locked; 129 if (showDetailsCheckBox.Checked) { 130 if (listView.SelectedItems.Count == 1) { 131 detailsGroupBox.Enabled = true; 132 viewHost.Content = listView.SelectedItems[0].Tag as IContent; 137 133 } else { 138 if (showDetailsCheckBox.Checked) { 139 detailsGroupBox.Enabled = true; 140 viewHost.Content = item; 141 } else { 142 viewHost.Content = null; 143 detailsGroupBox.Enabled = false; 144 } 134 viewHost.Content = null; 135 detailsGroupBox.Enabled = false; 145 136 } 146 137 } … … 148 139 private void listView_DoubleClick(object sender, EventArgs e) { 149 140 if (listView.SelectedItems.Count == 1) { 150 var item = (IItem)listView.SelectedItems[0].Tag; 151 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 152 var outermostViewHost = mainForm.ShowContentInOutermostViewHost(item, this); 153 if (outermostViewHost != null) { 154 outermostViewHost.ActiveView.ReadOnly = ReadOnly; 155 outermostViewHost.ActiveView.Locked = Locked; 141 IItem item = (IItem)listView.SelectedItems[0].Tag; 142 IContentView view = MainFormManager.MainForm.ShowContent(item); 143 if (view != null) { 144 view.ReadOnly = true; 145 view.Locked = Locked; 156 146 } 157 147 }
Note: See TracChangeset
for help on using the changeset viewer.