- Timestamp:
- 07/03/12 16:46:35 (12 years ago)
- Location:
- branches/GP-MoveOperators
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators
- Property svn:mergeinfo changed
/trunk/sources merged: 8084,8088-8090,8092-8100,8102-8113,8115,8117-8132,8134-8146,8148-8156,8158-8160,8163-8170,8173-8176,8178-8190,8192-8205
- Property svn:mergeinfo changed
-
branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Views/3.3/TreeView/HiveTaskItemTreeView.cs
r8085 r8206 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 23 using System.Windows.Forms; … … 42 41 } 43 42 44 #region Register Content Events 45 protected override void DeregisterContentEvents() { 46 // TODO: Deregister your event handlers on the Content here 47 base.DeregisterContentEvents(); 48 } 49 protected override void RegisterContentEvents() { 50 base.RegisterContentEvents(); 51 // TODO: Register your event handlers on the Content here 52 } 53 #endregion 54 55 protected override void OnContentChanged() { 56 base.OnContentChanged(); 57 if (Content == null) { 58 // TODO: Put code here when content is null 59 } else { 60 // TODO: Put code here when content has been changed and is not null 61 } 62 } 63 64 protected override void SetEnabledStateOfControls() { 65 base.SetEnabledStateOfControls(); 66 // TODO: Put code here to enable or disable controls based on whether the Content is/not null or the view is ReadOnly 67 } 68 69 #region Event Handlers 70 // TODO: Put event handlers here 71 #endregion 72 73 #region Child Control Events 74 protected override void addButton_Click(object sender, EventArgs e) { 43 protected override void AddItem() { 75 44 IOptimizer optimizer = CreateItem<IOptimizer>(); 76 45 if (optimizer != null) { … … 88 57 } 89 58 90 protected override void removeButton_Click(object sender, EventArgs e) { 91 base.removeButton_Click(sender, e); 92 93 if (treeView.SelectedNode != null) { 94 var selectedItem = (HiveTask)treeView.SelectedNode.Tag; 95 var parentItem = GetParentItem(selectedItem); 96 if (parentItem == null) { 97 Content.Remove((HiveTask)treeView.SelectedNode.Tag); 98 } else { 99 var experiment = parentItem.ItemTask.Item as Experiment; 100 if (experiment != null) { 101 experiment.Optimizers.Remove(((OptimizerTask)selectedItem.ItemTask).Item); 102 } 59 protected override void RemoveItem(HiveTask item) { 60 var parentItem = GetParentItem(item); 61 if (parentItem == null) { 62 Content.Remove(item); 63 } else { 64 var experiment = parentItem.ItemTask.Item as Experiment; 65 if (experiment != null) { 66 experiment.Optimizers.Remove(((OptimizerTask)item.ItemTask).Item); 103 67 } 104 68 } 105 69 } 106 #endregion107 70 108 71 protected override ICollection<IItemTreeNodeAction<HiveTask>> GetTreeNodeItemActions(HiveTask selectedItem) { -
branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Views/3.3/TreeView/ItemTreeView.cs
r8085 r8206 36 36 [View("ItemTree View")] 37 37 [Content(typeof(ItemCollection<>), IsDefaultView = false)] 38 public partial class ItemTreeView<T> : ItemView where T : class, IItemTree<T> {38 public abstract partial class ItemTreeView<T> : ItemView where T : class, IItemTree<T> { 39 39 public new ItemCollection<T> Content { 40 40 get { return (ItemCollection<T>)base.Content; } … … 360 360 361 361 protected virtual void addButton_Click(object sender, EventArgs e) { 362 T item = CreateItem<T>(); 363 if (item != null) 364 Content.Add(item); 362 AddItem(); 365 363 } 366 364 367 365 protected virtual void removeButton_Click(object sender, EventArgs e) { 368 366 if (treeView.SelectedNode != null) { 367 RemoveItem(treeView.SelectedNode.Tag as T); 369 368 detailsViewHost.Content = null; 370 369 } 371 370 } 371 372 protected abstract void AddItem(); 373 374 protected abstract void RemoveItem(T item); 372 375 373 376 protected virtual void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
Note: See TracChangeset
for help on using the changeset viewer.