41 lines
975 B
C#
41 lines
975 B
C#
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);
|
|
}
|
|
}
|
|
}
|