XMLParser hinzugefügt
This commit is contained in:
40
Database/Datenbank.cs
Normal file
40
Database/Datenbank.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xaml;
|
||||
|
||||
namespace Database
|
||||
{
|
||||
public class Datenbank
|
||||
{
|
||||
public static readonly Datenbank instance = new Datenbank();
|
||||
public static Datenbank Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
public KlassenBIB.Projekt loadedProjekt = null;
|
||||
|
||||
private string projektpfad = string.Empty;
|
||||
public bool LoadProjekt(string filepath)
|
||||
{
|
||||
projektpfad = filepath;
|
||||
if (File.Exists(filepath))
|
||||
loadedProjekt = XamlServices.Load(filepath) as KlassenBIB.Projekt;
|
||||
else
|
||||
loadedProjekt = new KlassenBIB.Projekt();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SaveProjekt()
|
||||
{
|
||||
XamlServices.Save(projektpfad, loadedProjekt);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user