- Timestamp:
- 10/28/13 17:50:31 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r9905 r10089 223 223 } 224 224 225 public T GetOutermostViewOfType<T>(Control childControl) where T : class, IView { 226 T outermostView = null; 227 for (var control = childControl; control != null; control = control.Parent) { 228 var vh = control as T; 229 if (vh != null) outermostView = vh; 230 } 231 return outermostView; 232 } 233 225 234 public IContentView ShowContent(IContent content) { 226 235 if (content == null) throw new ArgumentNullException("Content cannot be null."); … … 230 239 } 231 240 232 public IContentView ShowContent<T>(T content, bool reuseExistingView, IEqualityComparer<T> comparer = null) where T : class, IContent {241 public IContentView ShowContent<T>(T content, bool reuseExistingView, IEqualityComparer<T> comparer = null) where T : class, IContent { 233 242 if (content == null) throw new ArgumentNullException("Content cannot be null."); 234 243 if (!reuseExistingView) return ShowContent(content); … … 262 271 return view; 263 272 } 273 } 274 275 public void ShowContentInSpecificViewHost(IContent content, ViewHost viewHost) { 276 if (viewHost == null) return; 277 viewHost.Content = null; 278 var viewType = MainFormManager.GetDefaultViewType(content.GetType()); 279 viewHost.ViewType = viewType; 280 viewHost.Content = content; 264 281 } 265 282 … … 550 567 try { 551 568 ((IActionUserInterfaceItem)item.Tag).Execute(); 552 } 553 catch (Exception ex) { 569 } catch (Exception ex) { 554 570 ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, ex); 555 571 }
Note: See TracChangeset
for help on using the changeset viewer.