- Timestamp:
- 04/19/10 03:28:16 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.cs
r3393 r3407 36 36 [Content(typeof(IItemArray<>), false)] 37 37 public partial class ItemArrayView<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. … … 128 130 129 131 protected virtual T CreateItem() { 130 try { 131 return (T)Activator.CreateInstance(typeof(T)); 132 } 133 catch (Exception ex) { 134 Auxiliary.ShowErrorMessageBox(ex); 135 return null; 136 } 132 if (typeSelectorDialog == null) { 133 typeSelectorDialog = new TypeSelectorDialog(); 134 typeSelectorDialog.Caption = "Select Item"; 135 typeSelectorDialog.TypeSelector.Caption = "Available Items"; 136 typeSelectorDialog.TypeSelector.Configure(typeof(T), false, false); 137 } 138 139 if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) { 140 try { 141 return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 142 } 143 catch (Exception ex) { 144 Auxiliary.ShowErrorMessageBox(ex); 145 } 146 } 147 return null; 137 148 } 138 149 protected virtual ListViewItem CreateListViewItem(T item) {
Note: See TracChangeset
for help on using the changeset viewer.