Letzte Projekt wird beigehalten
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:StammGenerator"
|
xmlns:local="clr-namespace:StammGenerator"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
WindowState="Maximized"
|
||||||
xmlns:view="clr-namespace:StammGenerator.Views"
|
xmlns:view="clr-namespace:StammGenerator.Views"
|
||||||
xmlns:viewmodel="clr-namespace:StammGenerator.ViewModel"
|
xmlns:viewmodel="clr-namespace:StammGenerator.ViewModel"
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace StammGenerator.ViewModel
|
|||||||
private readonly IActualState _actualState;
|
private readonly IActualState _actualState;
|
||||||
private readonly IHaltungDataService _haltungDataService;
|
private readonly IHaltungDataService _haltungDataService;
|
||||||
private readonly ISchachtDataService _schachtDataService;
|
private readonly ISchachtDataService _schachtDataService;
|
||||||
private List<Schacht> avaibleSchaechte;
|
private List<Schacht> avaibleSchaechte = new List<Schacht>();
|
||||||
private int _selectedObenIndex;
|
private int _selectedObenIndex;
|
||||||
private int _selectedUntenIndex;
|
private int _selectedUntenIndex;
|
||||||
private Kanal _model;
|
private Kanal _model;
|
||||||
|
|||||||
@@ -43,8 +43,9 @@ namespace StammGenerator.ViewModel
|
|||||||
|
|
||||||
_actualState = actualState;
|
_actualState = actualState;
|
||||||
|
|
||||||
_actualState.ProjektChanged += ActualState_ProjektChanged;
|
|
||||||
|
|
||||||
|
_actualState.ProjektChanged += ActualState_ProjektChanged;
|
||||||
|
_actualState.LoadLastProjekt();
|
||||||
|
|
||||||
Navigator.StateChanged += Navigator_StateChanged;
|
Navigator.StateChanged += Navigator_StateChanged;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using SewerStammGen.Shared.Domain;
|
using Microsoft.Win32;
|
||||||
|
using SewerStammGen.Shared.Domain;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -9,6 +10,10 @@ namespace StammGenerator.ViewModel
|
|||||||
{
|
{
|
||||||
internal class ActualState : IActualState
|
internal class ActualState : IActualState
|
||||||
{
|
{
|
||||||
|
const string userroot = "HKEY_CURRENT_USER\\Software";
|
||||||
|
const string firmkey = "WWTech";
|
||||||
|
const string subkey = "StammGenerator";
|
||||||
|
|
||||||
// TODO: set auf private set setzen
|
// TODO: set auf private set setzen
|
||||||
public int ProjektID { get; set; }
|
public int ProjektID { get; set; }
|
||||||
|
|
||||||
@@ -25,6 +30,9 @@ namespace StammGenerator.ViewModel
|
|||||||
{
|
{
|
||||||
OnProjektChanged();
|
OnProjektChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string keyName = userroot + "\\" + firmkey + "\\" + subkey;
|
||||||
|
Registry.SetValue(keyName, "LastProjekt", ProjektID);
|
||||||
}
|
}
|
||||||
public void SetSchacht(Schacht schacht, bool notification = true)
|
public void SetSchacht(Schacht schacht, bool notification = true)
|
||||||
{
|
{
|
||||||
@@ -62,5 +70,16 @@ namespace StammGenerator.ViewModel
|
|||||||
HaltungChanged?.Invoke(this, new EventArgs());
|
HaltungChanged?.Invoke(this, new EventArgs());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void LoadLastProjekt()
|
||||||
|
{
|
||||||
|
string keyName = userroot + "\\" + firmkey + "\\" + subkey;
|
||||||
|
if(Registry.GetValue(keyName,"LastProjekt","")!= null)
|
||||||
|
{
|
||||||
|
ProjektID = Convert.ToInt32(Registry.GetValue(keyName, "LastProjekt", ""));
|
||||||
|
OnProjektChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,5 +20,7 @@ namespace StammGenerator.ViewModel
|
|||||||
void SetProjekt(Projekt projekt, bool notification = true);
|
void SetProjekt(Projekt projekt, bool notification = true);
|
||||||
void SetSchacht(Schacht schacht, bool notification = true);
|
void SetSchacht(Schacht schacht, bool notification = true);
|
||||||
void SetHaltung(Kanal haltung, bool notification = true);
|
void SetHaltung(Kanal haltung, bool notification = true);
|
||||||
|
|
||||||
|
void LoadLastProjekt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,6 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800">
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBlock Text="Willkommen dieses Programm generiert Stammdaten für die TV Inspektion" />
|
<TextBlock Text="Version Test - 0.1" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
Reference in New Issue
Block a user