Sicherung
This commit is contained in:
@@ -7,6 +7,9 @@ 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
|
||||
{
|
||||
@@ -15,18 +18,15 @@ namespace FSI.BT.Tools
|
||||
/// </summary>
|
||||
public partial class App : System.Windows.Application
|
||||
{
|
||||
private static readonly KeyGesture RadialMenu = new KeyGesture(Key.OemBackslash, ModifierKeys.Control);
|
||||
private static readonly KeyGesture TimeStamp = new KeyGesture(Key.C, ModifierKeys.Control | ModifierKeys.Alt);
|
||||
|
||||
private static readonly KeyGesture RadialMenu = new(Key.OemBackslash, ModifierKeys.Control);
|
||||
private static readonly KeyGesture TimeStamp = new(Key.C, ModifierKeys.Control | ModifierKeys.Alt);
|
||||
|
||||
|
||||
public void Application_Startup(object sender, StartupEventArgs e)
|
||||
{
|
||||
|
||||
Global.Log.Info("Anwendung wurde gestartet!");
|
||||
|
||||
Global.Settings = new AppSettings(GetType().Namespace.ToString() + ".xml");
|
||||
Global.Settings.Load();
|
||||
|
||||
// App-Settings
|
||||
JsonConfigStore _store = new JsonConfigStore(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "config.json"), true);
|
||||
Global.AppSettings = new ConfigurationBuilder<Settings.AppSettings.IAppSettings>()
|
||||
.UseConfigStore(_store)
|
||||
@@ -42,24 +42,18 @@ namespace FSI.BT.Tools
|
||||
HotkeyManager.Current.AddOrReplace("TimeStampToClipboard", TimeStamp, TimeStampToClipboard);
|
||||
|
||||
Global.FrmRadialMenu = new FrmRadialMenu();
|
||||
|
||||
Global.WinCC = new Lib.Guis.SieTiaWinCCMsgMgt.ViewModel()
|
||||
{
|
||||
Data = Global.AppSettings.WinCC
|
||||
};
|
||||
Global.WinCC.Init();
|
||||
|
||||
Global.WinCC = new Lib.Guis.SieTiaWinCCMsgMgt.ViewModel.ViewModelWinCC(
|
||||
Global.Settings.SieTiaWinCCMsgMgtAutostart,
|
||||
Global.Settings.SieTiaWinCCMsgMgtUpdateIntervall,
|
||||
Global.Settings.SieTiaWinCCMsgMgtWindowsName,
|
||||
Global.Settings.SieTiaWinCCMsgMgtClassName,
|
||||
Global.Settings.SieTiaWinCCMsgMgtBtnName
|
||||
);
|
||||
|
||||
Global.Iba = new Lib.Guis.IbaDirSync.ViewModel.ViewModelIba(
|
||||
Global.Settings.IbaRecordDestinationath,
|
||||
Global.Settings.IbaRecordSourcePath,
|
||||
Global.Settings.IbaAutoSync
|
||||
);
|
||||
|
||||
Global.WindowMgt = new Lib.Guis.SetSizePosExWindow.ViewModel.ViewModelWindow();
|
||||
Global.WindowMgt.AutoStart = Global.Settings.WindowMgtAutostart;
|
||||
Global.WindowMgt.UpdateIntervall = Global.Settings.WindowMgtUpdateInterval;
|
||||
Global.Iba = new Lib.Guis.IbaDirSync.ViewModel()
|
||||
{
|
||||
Data = Global.AppSettings.IbaDirSync
|
||||
};
|
||||
Global.Iba.Init();
|
||||
|
||||
}
|
||||
|
||||
@@ -81,17 +75,17 @@ namespace FSI.BT.Tools
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void DeCrypt(ref IEnumerable<Settings.StringValue.IStringValueCrypt> values)
|
||||
{
|
||||
var valuesToDeCrypt = values.ToList();
|
||||
|
||||
foreach (var value in valuesToDeCrypt.ToList())
|
||||
value.ValueDeCrypt = Lib.DeEncryptString.DeEncrypt.DecryptString(value.Value, AppDomain.CurrentDomain.FriendlyName);
|
||||
|
||||
}
|
||||
|
||||
private void Application_Exit(object sender, ExitEventArgs e)
|
||||
{
|
||||
AppSettings tmpSetting = new AppSettings(Global.Settings.FileName);
|
||||
tmpSetting.Load();
|
||||
|
||||
CompareLogic compareLogic = new CompareLogic();
|
||||
ComparisonResult result = compareLogic.Compare(Global.Settings, tmpSetting);
|
||||
if (!result.AreEqual)
|
||||
{
|
||||
Global.Settings.Save();
|
||||
}
|
||||
|
||||
if (Global.Iba.RoboCopy != null)
|
||||
{
|
||||
@@ -99,6 +93,6 @@ namespace FSI.BT.Tools
|
||||
Global.Iba.RoboCopy.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user