- Timestamp:
- 04/19/10 03:28:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs
r3393 r3407 36 36 [Content(typeof(IItemList<>), false)] 37 37 public partial class ItemListView<T> : AsynchronousContentView where T : class, IItem { 38 protected TypeSelectorDialog typeSelectorDialog; 39 38 40 /// <summary> 39 41 /// Gets or sets the scope whose variables to represent visually. … … 131 133 132 134 protected virtual T CreateItem() { 133 try { 134 return (T)Activator.CreateInstance(typeof(T)); 135 } 136 catch (Exception ex) { 137 Auxiliary.ShowErrorMessageBox(ex); 138 return null; 139 } 135 if (typeSelectorDialog == null) { 136 typeSelectorDialog = new TypeSelectorDialog(); 137 typeSelectorDialog.Caption = "Select Item"; 138 typeSelectorDialog.TypeSelector.Caption = "Available Items"; 139 typeSelectorDialog.TypeSelector.Configure(typeof(T), false, false); 140 } 141 142 if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) { 143 try { 144 return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 145 } 146 catch (Exception ex) { 147 Auxiliary.ShowErrorMessageBox(ex); 148 } 149 } 150 return null; 140 151 } 141 152 protected virtual ListViewItem CreateListViewItem(T item) {
Note: See TracChangeset
for help on using the changeset viewer.