Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ViewHost.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ViewHost.cs	(revision 2791)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ViewHost.cs	(revision 2792)
@@ -35,4 +35,8 @@
     private Dictionary<Type, ToolStripMenuItem> typeMenuItemTable;
 
+    public IEnumerable<Type> AvailableViewTypes {
+      get { return typeMenuItemTable.Keys; }
+    }
+
     private object content;
     public object Content {
@@ -50,4 +54,27 @@
       InitializeComponent();
       Initialize();
+    }
+
+    public void ShowView(Type viewType) {
+      if (!typeMenuItemTable.ContainsKey(viewType))
+        throw new ArgumentException(string.Format("View \"{0}\" cannot display content \"{1}\".",
+                                                  viewType.GetPrettyName(),
+                                                  content.GetType().GetPrettyName()));
+
+      foreach (ToolStripMenuItem item in typeMenuItemTable.Values) {
+        item.Checked = false;
+        item.Enabled = true;
+      }
+      typeMenuItemTable[viewType].Checked = true;
+      typeMenuItemTable[viewType].Enabled = false;
+
+      if (viewPanel.Controls.Count > 0) viewPanel.Controls[0].Dispose();
+      viewPanel.Controls.Clear();
+      Control view = (Control)MainFormManager.CreateView(viewType, Content);
+      viewPanel.Controls.Add(view);
+      viewPanel.Tag = view;
+      view.Dock = DockStyle.Fill;
+      viewPanel.Enabled = true;
+      viewPanel.Visible = true;
     }
 
@@ -68,11 +95,11 @@
                         orderby t.Name ascending
                         select t;
-        foreach (Type viewType in viewTypes) {
-          ToolStripMenuItem item = new ToolStripMenuItem(viewType.GetPrettyName());
-          item.Name = viewType.FullName;
-          item.ToolTipText = viewType.GetPrettyName(true);
-          item.Tag = viewType;
+        foreach (Type v in viewTypes) {
+          ToolStripMenuItem item = new ToolStripMenuItem(v.GetPrettyName());
+          item.Name = v.FullName;
+          item.ToolTipText = v.GetPrettyName(true);
+          item.Tag = v;
           contextMenuStrip.Items.Add(item);
-          typeMenuItemTable.Add(viewType, item);
+          typeMenuItemTable.Add(v, item);
         }
         if (contextMenuStrip.Items.Count == 0) {
@@ -85,16 +112,9 @@
         }
 
-        Control view = (Control)MainFormManager.CreateDefaultView(Content);
-        if ((view == null) && (contextMenuStrip.Items.Count > 0))  // create first available view if default view is not available
-          view = (Control)MainFormManager.CreateView((Type)contextMenuStrip.Items[0].Tag, Content);
-        if (view != null) {
-          viewPanel.Controls.Add(view);
-          viewPanel.Tag = view;
-          view.Dock = DockStyle.Fill;
-          viewPanel.Enabled = true;
-          viewPanel.Visible = true;
-          typeMenuItemTable[view.GetType()].Checked = true;
-          typeMenuItemTable[view.GetType()].Enabled = false;
-        }
+        Type viewType = MainFormManager.GetDefaultViewType(Content.GetType());
+        if ((viewType == null) && (contextMenuStrip.Items.Count > 0))  // create first available view if default view is not available
+          viewType = (Type)contextMenuStrip.Items[0].Tag;
+        if (viewType != null)
+          ShowView(viewType);
       }
     }
@@ -105,17 +125,5 @@
     protected void contextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e) {
       Type viewType = (Type)e.ClickedItem.Tag;
-      foreach (ToolStripMenuItem item in typeMenuItemTable.Values) {
-        item.Checked = false;
-        item.Enabled = true;
-      }
-      typeMenuItemTable[viewType].Checked = true;
-      typeMenuItemTable[viewType].Enabled = false;
-
-      if (viewPanel.Controls.Count > 0) viewPanel.Controls[0].Dispose();
-      viewPanel.Controls.Clear();
-      Control view = (Control)MainFormManager.CreateView(viewType, Content);
-      viewPanel.Controls.Add(view);
-      viewPanel.Tag = view;
-      view.Dock = DockStyle.Fill;
+      ShowView(viewType);
     }
   }
