From 3148e3ad13a6b792f0293226e1b8c5ea5fded1b9 Mon Sep 17 00:00:00 2001
From: "harald.martini@student.tugraz.at" <harald.martini@student.tugraz.at>
Date: Thu, 1 Jul 2021 16:36:15 +0200
Subject: [PATCH] Added hack to open files as SimulationOnlyDeclarationJobs

---
 .../ViewModel/Implementation/JobListViewModel.cs    | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs
index b2c163aaaf..678aaf6759 100644
--- a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs
+++ b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs
@@ -749,11 +749,16 @@ namespace VECTO3GUI2020.ViewModel.Implementation
 			} else if (documentType == XmlDocumentType.DeclarationJobData) {
 				//Remove
 				var inputDataProvider = _inputDataReader.CreateDeclaration(fileName);
-				var result = _multiStageViewModelFactory.CreateDocumentViewModel(inputDataProvider);
+				IDocumentViewModel result;
+				try {
+				
+					result = _multiStageViewModelFactory.CreateDocumentViewModel(inputDataProvider);
+				} catch (Exception ex){
+					Debug.WriteLine(ex.GetInnerExceptionMessages());
+					result = new SimulationOnlyDeclarationJob(inputDataProvider.DataSource, inputDataProvider.JobInputData.JobName, XmlDocumentType.DeclarationJobData) as IDocumentViewModel;
+				}
+
 
-				//TODO Harry
-				//var result = new SimulationOnlyDeclarationJob(inputDataProvider.DataSource,
-				//	inputDataProvider.JobInputData.JobName, XmlDocumentType.DeclarationJobData) as IDocumentViewModel;
 				return Task.FromResult(result);
 
 
-- 
GitLab