Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit c02614c7 authored by Franz KOBER josef's avatar Franz KOBER josef
Browse files

finished edit job

parent b045533f
No related branches found
No related tags found
No related merge requests found
......@@ -68,13 +68,12 @@ namespace VECTO3GUI.ViewModel.Impl
protected JobType JobType;
private readonly bool _editJob;
private JobEntry _currentJobEntry;
#endregion
#region Properties
public JobEntry SavedJobEntry { get; private set; }
public JobEntry SavedJobEntry { get; private set; }
public string FirstFilePath
{
......@@ -123,7 +122,7 @@ namespace VECTO3GUI.ViewModel.Impl
{
Init(kernel, jobEntry.JobType);
SetJobEntryData(jobEntry);
_currentJobEntry = jobEntry;
SavedJobEntry = jobEntry;
_editJob = true;
}
......@@ -230,12 +229,11 @@ namespace VECTO3GUI.ViewModel.Impl
private void UpdateJobData()
{
_currentJobEntry.FirstFilePath = FirstFilePath;
_currentJobEntry.SecondFilePath = SecondFilePath;
SavedJobEntry.FirstFilePath = FirstFilePath;
SavedJobEntry.SecondFilePath = SecondFilePath;
}
private string OpenFileSelector(JobFileType jobFileType, string textPropertyName)
{
var dialogResult = FileDialogHelper.ShowSelectFilesDialog(false, Settings.XmlFilePathFolder);
......
......@@ -8,15 +8,8 @@ using System.Linq;
using System.Windows;
using System.Windows.Input;
using Ninject;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.InputData.FileIO.XML;
using VECTO3GUI.Util;
using VECTO3GUI.ViewModel.Interfaces;
using System.Xml;
using System.Xml.Linq;
using TUGraz.VectoCommon.Resources;
using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
using VECTO3GUI.Helper;
using VECTO3GUI.Model;
using VECTO3GUI.Views;
......@@ -91,7 +84,8 @@ namespace VECTO3GUI.ViewModel.Impl
private void JobItemChanged(object sender, PropertyChangedEventArgs e)
{
_jobListModel.SaveJobList(_jobs);
if(e.PropertyName == "Selected" && sender is JobEntry )
UpdateJobEntry((JobEntry) sender);
}
private void JobsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
......@@ -159,9 +153,9 @@ namespace VECTO3GUI.ViewModel.Impl
var viewModel = GetBusJobViewModel(jobEntry.JobType, jobEntry);
var window = CreateBusJobOutputWindow(viewModel, jobEntry.JobType);
if(window.ShowDialog() != true)
ResetBusJobEntries();
ResetBusJobEntries(jobEntry);
else
_jobListModel.SaveJobList(_jobs);
UpdateJobEntry(((IBusJobViewModel)viewModel).SavedJobEntry);
}
......@@ -317,11 +311,15 @@ namespace VECTO3GUI.ViewModel.Impl
_jobs.Add(jobEntry);
}
private void ResetBusJobEntries()
private void ResetBusJobEntries(JobEntry jobEntry)
{
SetJobEntries();
SerializeHelper.DeserializeToObject<JobEntry>(jobEntry.JobEntryFilePath);
}
private void UpdateJobEntry(JobEntry jobEntry)
{
SerializeHelper.SerializeToFile(jobEntry.JobEntryFilePath, jobEntry);
}
//private IJobEditViewModel ReadJob(string jobFile)
//{
// if (jobFile == null)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment