Code cleanup durchgeführt

This commit is contained in:
HuskyTeufel
2020-07-14 14:19:55 +02:00
parent 004bc22428
commit daf44bae33
5 changed files with 3 additions and 95 deletions

View File

@@ -39,17 +39,7 @@ namespace Database
if(File.Exists(filepath))
TeufelDB = XamlServices.Load("./projekte/TeufelDB.xaml") as KlassenBIB.DB;
//Debugger.Break();
/*filepath = Path.Combine("./projekte","MainDatenbank.xaml");
if(File.Exists(filepath))
{
MainDatenbank = XamlServices.Load(filepath) as KlassenBIB.MainDataBase;
}
else
{
MainDatenbank = new MainDataBase();
}
*/
}
private string projektpfad = string.Empty;
@@ -57,31 +47,7 @@ namespace Database
{
this.projekt = projekt;
loadedProjekt = Datenbank.Instance.TeufelDB.Projekte.Find(x => x.Nummer != null && x.Nummer.Equals(projekt));
//Debugger.Break();
//UnPackProject("18-850","willyteufelchen");
//PackSystem("./projekte/18-850.zip", "./projekte/18-850","willyteufelchen");
/*
string filepath = Path.Combine(projektpfad, string.Format("{0}.xaml", projekt));
this.projektpfad = filepath;
if (File.Exists(filepath))
{
File.Copy(filepath, string.Format("{0}_{1}_{2}.bak", filepath,DateTime.Now.ToShortDateString(),DateTime.Now.Ticks));
try
{
loadedProjekt = XamlServices.Load(filepath) as KlassenBIB.Projekt;
}
catch(XamlObjectWriterException ex)
{
if (ex.HResult.Equals(-2146233088))
throw new DataBaseVersionMismatchException(ex.Message);
}
}
else
loadedProjekt = new KlassenBIB.Projekt();
*/
if (!File.Exists("./projekte/TeufelDB.xaml"))
{
UpdateDatabase.UpdateNewGuids();
@@ -104,28 +70,6 @@ namespace Database
return true;
}
public void Test()
{
using (MemoryStream memoryStream = new MemoryStream())
{
using (var fileStream = new FileStream("./test.zip", FileMode.Open))
{
fileStream.Seek(0, SeekOrigin.Begin);
fileStream.CopyTo(memoryStream);
}
using (ZipArchive archive = new ZipArchive(memoryStream, ZipArchiveMode.Update, true))
{
ZipArchiveEntry test = archive.CreateEntry("./datas/test.txt");
Debugger.Break();
}
Debugger.Break();
}
}
public void SaveProjekt()
{
XamlServices.Save("./projekte/TeufelDB.xaml", TeufelDB);