Sicherung

This commit is contained in:
Maier Stephan SI
2023-01-20 16:09:00 +01:00
parent e5257d8413
commit b684704bf8
139 changed files with 95678 additions and 499 deletions

View File

@@ -1,15 +1,13 @@
using Hardcodet.Wpf.TaskbarNotification;
using Config.Net;
using Config.Net.Stores;
using Hardcodet.Wpf.TaskbarNotification;
using NHotkey;
using NHotkey.Wpf;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Windows;
using System.Windows.Input;
using FSI.Lib.CompareNetObjects;
using Config.Net.Stores;
using System.IO;
using Config.Net;
using System.Collections.Generic;
using System.Linq;
using System;
namespace FSI.BT.Tools
{
@@ -23,11 +21,14 @@ namespace FSI.BT.Tools
public void Application_Startup(object sender, StartupEventArgs e)
{
{
Global.Log.Info("Anwendung wurde gestartet!");
ExtractEmbeddedZip("FSI.BT.Tools.ExtTools.kalk.zip", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\ExtTools\\");
// App-Settings
JsonConfigStore _store = new JsonConfigStore(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "config.json"), true);
JsonConfigStore _store = new(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "config.json"), true);
Global.AppSettings = new ConfigurationBuilder<Settings.AppSettings.IAppSettings>()
.UseConfigStore(_store)
.Build();
@@ -40,9 +41,9 @@ namespace FSI.BT.Tools
HotkeyManager.Current.AddOrReplace("RadialMenu", RadialMenu, ShowRadialMenu);
HotkeyManager.Current.AddOrReplace("TimeStampToClipboard", TimeStamp, TimeStampToClipboard);
Global.FrmRadialMenu = new FrmRadialMenu();
Global.WinCC = new Lib.Guis.SieTiaWinCCMsgMgt.ViewModel()
{
Data = Global.AppSettings.WinCC
@@ -54,7 +55,6 @@ namespace FSI.BT.Tools
Data = Global.AppSettings.IbaDirSync
};
Global.Iba.Init();
}
private void ShowRadialMenu(object sender, HotkeyEventArgs e)
@@ -75,13 +75,13 @@ namespace FSI.BT.Tools
e.Handled = true;
}
private void DeCrypt(ref IEnumerable<Settings.StringValue.IStringValueCrypt> values)
private static void ExtractEmbeddedZip(string zipName, string destPath)
{
var valuesToDeCrypt = values.ToList();
foreach (var value in valuesToDeCrypt.ToList())
value.ValueDeCrypt = Lib.DeEncryptString.DeEncrypt.DecryptString(value.Value, AppDomain.CurrentDomain.FriendlyName);
System.IO.Directory.CreateDirectory(destPath); // Erstellt alle fehlenden Verzeichnisse
using Stream _pluginZipResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(zipName);
using ZipArchive zip = new(_pluginZipResourceStream);
zip.ExtractToDirectory(destPath, true);
Global.Log.Info("Externes Tool \"{0}\" wurde in das Verzeichnis \"{1}\" entpackt", zipName, destPath);
}
private void Application_Exit(object sender, ExitEventArgs e)
@@ -94,5 +94,6 @@ namespace FSI.BT.Tools
}
}
}
}