Changeset 3433 for trunk/sources/HeuristicLab.Optimization.Views/3.3
- Timestamp:
- 04/20/10 04:24:19 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs
r3432 r3433 37 37 get { return (IItemCollection<IRun>)base.Content; } 38 38 set { base.Content = value; } 39 } 40 41 public override bool ReadOnly { 42 get { 43 if ((Content != null) && Content.IsReadOnly) return true; 44 else return base.ReadOnly; 45 } 46 set { base.ReadOnly = value; } 39 47 } 40 48 … … 140 148 #region ListView Events 141 149 protected virtual void itemsListView_SelectedIndexChanged(object sender, EventArgs e) { 142 removeButton.Enabled = itemsListView.SelectedItems.Count > 0 && ! Content.IsReadOnly;150 removeButton.Enabled = itemsListView.SelectedItems.Count > 0 && !ReadOnly; 143 151 if (itemsListView.SelectedItems.Count == 1) { 144 152 IRun item = (IRun)itemsListView.SelectedItems[0].Tag; … … 157 165 protected virtual void itemsListView_KeyDown(object sender, KeyEventArgs e) { 158 166 if (e.KeyCode == Keys.Delete) { 159 if ((itemsListView.SelectedItems.Count > 0) && ! Content.IsReadOnly) {167 if ((itemsListView.SelectedItems.Count > 0) && !ReadOnly) { 160 168 foreach (ListViewItem item in itemsListView.SelectedItems) 161 169 Content.Remove((IRun)item.Tag); … … 181 189 data.SetData("Type", item.GetType()); 182 190 data.SetData("Value", item); 183 if ( Content.IsReadOnly ||ReadOnly) {191 if (ReadOnly) { 184 192 DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link); 185 193 } else { … … 194 202 if (ReadOnly) return; 195 203 Type type = e.Data.GetData("Type") as Type; 196 if ((! Content.IsReadOnly) && (type != null) && (typeof(IRun).IsAssignableFrom(type))) {204 if ((!ReadOnly) && (type != null) && (typeof(IRun).IsAssignableFrom(type))) { 197 205 if ((e.KeyState & 8) == 8) e.Effect = DragDropEffects.Copy; // CTRL key 198 206 else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move; // SHIFT key
Note: See TracChangeset
for help on using the changeset viewer.