Index: branches/3.0/sources/HeuristicLab.OptimizationFrontend/MainForm.cs
===================================================================
--- branches/3.0/sources/HeuristicLab.OptimizationFrontend/MainForm.cs	(revision 662)
+++ branches/3.0/sources/HeuristicLab.OptimizationFrontend/MainForm.cs	(revision 690)
@@ -63,9 +63,9 @@
       Type[] creatables = discoveryService.GetTypes(typeof(IEditable));
       string[] names = new string[creatables.Length];
-      for (int i = 0; i < creatables.Length; i++)
+      for(int i = 0; i < creatables.Length; i++)
         names[i] = creatables[i].Name;
       Array.Sort(names, creatables);
-      foreach (Type type in creatables) {
-        if (!type.IsAbstract) {
+      foreach(Type type in creatables) {
+        if(!type.IsAbstract) {
           ToolStripMenuItem item = new ToolStripMenuItem();
           item.Tag = type;
@@ -85,9 +85,9 @@
     #region IControlManager Members
     public void ShowControl(IControl control) {
-      if (control is IEditor) {
+      if(control is IEditor) {
         EditorForm form = new EditorForm((IEditor)control);
         form.MdiParent = this;
         form.Show();
-      } else if (control is IView) {
+      } else if(control is IView) {
         ViewForm form = new ViewForm((IView)control);
         form.MdiParent = this;
@@ -111,5 +111,5 @@
       tileVerticallyToolStripMenuItem.Enabled = false;
 
-      if (ActiveMdiChild != null) {
+      if(ActiveMdiChild != null) {
         closeToolStripMenuItem.Enabled = true;
         closeAllToolStripMenuItem.Enabled = true;
@@ -120,6 +120,6 @@
         tileVerticallyToolStripMenuItem.Enabled = true;
         EditorForm form = ActiveMdiChild as EditorForm;
-        if (form != null){
-          if (((Control)form.Editor).Enabled) {
+        if(form != null) {
+          if(((Control)form.Editor).Enabled) {
             saveToolStripMenuItem.Enabled = true;
             saveToolStripButton.Enabled = true;
@@ -135,6 +135,6 @@
     #region Open and Save Methods
     private void Open() {
-      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
-        lock (locker) runningTasks++;
+      if(openFileDialog.ShowDialog(this) == DialogResult.OK) {
+        lock(locker) runningTasks++;
         Cursor = Cursors.AppStarting;
         Task task = new Task(openFileDialog.FileName, null, null);
@@ -149,19 +149,23 @@
         MessageBox.Show("Sorry couldn't open file \"" + task.filename + "\".\nThe file or plugin \"" + ex.FileName + "\" is not available.\nPlease make sure you have all necessary plugins installed.",
           "Reader Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
-      }
+      } catch(TypeLoadException typeLoadEx) {
+        MessageBox.Show("Sorry couldn't open file \"" + task.filename + "\".\nThe type \"" + typeLoadEx.TypeName + "\" is not available.\nPlease make sure that you have the correct version the plugin installed.",
+          "Reader Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+      }
+
       LoadFinished(task);
     }
     private delegate void TaskFinishedDelegate(Task task);
     private void LoadFinished(Task task) {
-      if (InvokeRequired)
+      if(InvokeRequired)
         Invoke(new TaskFinishedDelegate(LoadFinished), task);
       else {
         IEditor editor = null;
-        if (task.storable != null) {
+        if(task.storable != null) {
           IEditable editable = task.storable as IEditable;
-          if (editable != null)
+          if(editable != null)
             editor = editable.CreateEditor();
         }
-        if (editor == null)
+        if(editor == null)
           MessageBox.Show("Could not open item. The selected item doesn't provide an editor.", "Editor Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         else {
@@ -169,7 +173,7 @@
           PluginManager.ControlManager.ShowControl(editor);
         }
-        lock (locker) {
+        lock(locker) {
           runningTasks--;
-          if (runningTasks == 0)
+          if(runningTasks == 0)
             Cursor = Cursors.Default;
         }
@@ -177,8 +181,8 @@
     }
     private void Save(EditorForm form) {
-      if (form.Editor.Filename == null)
+      if(form.Editor.Filename == null)
         SaveAs(form);
       else {
-        lock (locker) runningTasks++;
+        lock(locker) runningTasks++;
         Cursor = Cursors.AppStarting;
         ((Control)form.Editor).Enabled = false;
@@ -189,5 +193,5 @@
     }
     private void SaveAs(EditorForm form) {
-      if (saveFileDialog.ShowDialog(this) == DialogResult.OK) {
+      if(saveFileDialog.ShowDialog(this) == DialogResult.OK) {
         form.Editor.Filename = saveFileDialog.FileName;
         Save(form);
@@ -200,12 +204,12 @@
     }
     private void SaveFinished(Task task) {
-      if (InvokeRequired)
+      if(InvokeRequired)
         Invoke(new TaskFinishedDelegate(SaveFinished), task);
       else {
         ((Control)task.editor).Enabled = true;
         EnableDisableItems();
-        lock (locker) {
+        lock(locker) {
           runningTasks--;
-          if (runningTasks == 0)
+          if(runningTasks == 0)
             Cursor = Cursors.Default;
         }
@@ -223,9 +227,9 @@
       Type type = (Type)item.Tag;
       IEditable editable = (IEditable)Activator.CreateInstance(type);
-      if (editable == null) {
+      if(editable == null) {
         MessageBox.Show("The selected item is not editable.", "Editable Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
       } else {
         IEditor editor = editable.CreateEditor();
-        if (editor == null) {
+        if(editor == null) {
           MessageBox.Show("The selected item doesn't provide an editor.", "Editor Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         } else {
@@ -247,7 +251,7 @@
     }
     private void saveAllToolStripMenuItem_Click(object sender, EventArgs e) {
-      for (int i = 0; i < MdiChildren.Length; i++) {
+      for(int i = 0; i < MdiChildren.Length; i++) {
         EditorForm form = MdiChildren[i] as EditorForm;
-        if (((Control)form.Editor).Enabled) Save(form);
+        if(((Control)form.Editor).Enabled) Save(form);
       }
     }
@@ -257,5 +261,5 @@
     }
     private void closeAllToolStripMenuItem_Click(object sender, EventArgs e) {
-      while (MdiChildren.Length > 0)
+      while(MdiChildren.Length > 0)
         MdiChildren[0].Close();
       EnableDisableItems();
@@ -297,7 +301,7 @@
     }
     private void saveAllToolStripButton_Click(object sender, EventArgs e) {
-      for (int i = 0; i < MdiChildren.Length; i++) {
+      for(int i = 0; i < MdiChildren.Length; i++) {
         EditorForm form = MdiChildren[i] as EditorForm;
-        if (((Control)form.Editor).Enabled) Save(form);
+        if(form != null && ((Control)form.Editor).Enabled) Save(form);
       }
     }
