Changeset 4234
- Timestamp:
- 08/16/10 23:56:28 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForm.cs
r4201 r4234 113 113 if (InvokeRequired) 114 114 Invoke((MethodInvoker)OnActiveViewChanged); 115 else if (ActiveViewChanged != null) 116 ActiveViewChanged(this, EventArgs.Empty); 115 else { 116 EventHandler handler = ActiveViewChanged; 117 if (handler != null) 118 handler(this, EventArgs.Empty); 119 } 117 120 } 118 121 … … 226 229 227 230 public IContentView ShowContent(IContent content, Type viewType) { 228 if (content == null) 229 throw new ArgumentNullException("Content cannot be null."); 230 if (viewType == null) 231 throw new ArgumentNullException("ViewType cannot be null."); 232 233 IContentView view; 234 if (this.ShowContentInViewHost) { 235 ViewHost viewHost = new ViewHost(); 236 viewHost.ViewType = viewType; 237 view = viewHost; 238 } else 239 view = MainFormManager.CreateView(viewType); 240 241 view.Content = content; 242 view.Show(); 243 return view; 231 if (InvokeRequired) return (IContentView)Invoke((Func<IContent, Type, IContentView>)ShowContent, content, viewType); 232 else { 233 if (content == null) 234 throw new ArgumentNullException("Content cannot be null."); 235 if (viewType == null) 236 throw new ArgumentNullException("ViewType cannot be null."); 237 238 IContentView view; 239 if (this.ShowContentInViewHost) { 240 ViewHost viewHost = new ViewHost(); 241 viewHost.ViewType = viewType; 242 view = viewHost; 243 } else 244 view = MainFormManager.CreateView(viewType); 245 246 view.Content = content; 247 view.Show(); 248 return view; 249 } 244 250 } 245 251
Note: See TracChangeset
for help on using the changeset viewer.