XMLParser hinzugefügt
This commit is contained in:
@@ -41,7 +41,14 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Datenbank.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\KlassenBIB\KlassenBIB.csproj">
|
||||
<Project>{c82bd650-466b-403f-bed9-2b1660771f54}</Project>
|
||||
<Name>KlassenBIB</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
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