From d707038b4be79cbdd40c86448f2dbdb768c83c98 Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 23 Jul 2022 23:09:35 +0200 Subject: [PATCH] Version 0.1.8239: Improvements - Improvement: remove '-' character when copy/paste data as "Hex"-String - Improvement: Closing "Update Dialog" without using "Cancel Button" does no longer minimize mainWindow - Improvement: changed "application id" to application code and function cluster code according to NXP AN10787 (MAD) - Improvement: RunTask as ContextMenuItem --- .../RedCell.Diagnostics.Update/Updater.cs | 30 ++--- .../Remote/FromFile/SettingsReaderWriter.cs | 8 +- RFiDGear/Resources/Manifest.de.resx | 3 + RFiDGear/Resources/Manifest.en.resx | 3 + .../TabPageMifareClassicDataExplorerView.xaml | 1 + .../TabPageMifareClassicKeySetupView.xaml | 79 ++++++++---- .../RFiDChipGrandChildLayerViewModel.cs | 2 +- RFiDGear/ViewModel/MainWindowViewModel.cs | 14 +- .../MifareClassicSetupViewModel.cs | 122 ++++++++++++++---- 9 files changed, 188 insertions(+), 74 deletions(-) diff --git a/RFiDGear/3rdParty/RedCell/RedCell.Diagnostics.Update/Updater.cs b/RFiDGear/3rdParty/RedCell/RedCell.Diagnostics.Update/Updater.cs index fc55fb5..e0fed6e 100644 --- a/RFiDGear/3rdParty/RedCell/RedCell.Diagnostics.Update/Updater.cs +++ b/RFiDGear/3rdParty/RedCell/RedCell.Diagnostics.Update/Updater.cs @@ -95,9 +95,8 @@ public Updater(FileInfo configFile) catch (Exception e) { - LogWriter.CreateLogEntry(string.Format("{0}\n{1}", e.Message, e.InnerException != null ? e.InnerException.Message : "")); + LogWriter.CreateLogEntry(string.Format("{0}: {1}; {2}", DateTime.Now, e.Message, e.InnerException != null ? e.InnerException.Message : "")); } - //LogWriter.CreateLogEntry(string.Format("{0}\n{1}",e.Message, e.InnerException != null ? e.InnerException.Message : "")); } #endregion @@ -183,7 +182,7 @@ private void Check(object state) catch (Exception e) { - LogWriter.CreateLogEntry(string.Format("{0}\n{1}", e.Message, e.InnerException != null ? e.InnerException.Message : "")); + LogWriter.CreateLogEntry(string.Format("{0}: {1}; {2}", DateTime.Now, e.Message, e.InnerException != null ? e.InnerException.Message : "")); _remoteConfig = null; return; } @@ -191,7 +190,6 @@ private void Check(object state) string data = Encoding.UTF8.GetString(http.ResponseData); _remoteConfig = new Manifest(data); - //string.Format("{0}{1}",this._localConfig.RemoteConfigUri,settings.DefaultLanguage == "german" ? "/de-de" : "/en-us") if (_remoteConfig == null) { return; @@ -199,27 +197,25 @@ private void Check(object state) if (_localConfig.SecurityToken != _remoteConfig.SecurityToken) { - Log.Write("Security token mismatch."); + LogWriter.CreateLogEntry(string.Format("{0}: {1}", DateTime.Now, "Security token mismatch.")); return; } - Log.Write("Remote config is valid."); - Log.Write("Local version is {0}.", _localConfig.Version); - Log.Write("Remote version is {0}.", _remoteConfig.Version); + LogWriter.CreateLogEntry(string.Format("{0}: {1}", DateTime.Now, "Remote config is valid.")); Log.Write("Remote config is valid."); + LogWriter.CreateLogEntry(string.Format("{0}: {1}, {2}", DateTime.Now, "Local version is ", _localConfig.Version)); + LogWriter.CreateLogEntry(string.Format("{0}: {1}, {2}", DateTime.Now, "Remote version is ", _remoteConfig.Version)); if (_remoteConfig.Version == _localConfig.Version) { - Log.Write("Versions are the same."); - Log.Write("Check ending."); + LogWriter.CreateLogEntry(string.Format("{0}: {1}", DateTime.Now, "Versions are the same. Check ending.")); return; } if (_remoteConfig.Version < _localConfig.Version) { - Log.Write("Remote version is older. That's weird."); - Log.Write("Check ending."); + LogWriter.CreateLogEntry(string.Format("{0}: {1}", DateTime.Now, "Remote version is older. That's weird. Check ending.")); return; } - Log.Write("Remote version is newer. Updating."); + LogWriter.CreateLogEntry(string.Format("{0}: {1}", DateTime.Now, "Remote version is newer. Updating.")); _timer.Change(0, 1000); if (!AllowUpdate && !IsUserNotified) @@ -257,7 +253,7 @@ public void Update() try { Directory.Delete(Path.Combine(appDataPath, WorkPath), true); } catch (IOException e) { - LogWriter.CreateLogEntry(string.Format("{0}\n{1}", e.Message, e.InnerException != null ? e.InnerException.Message : "")); + LogWriter.CreateLogEntry(string.Format("{0}: {1}; {2}", DateTime.Now, e.Message, e.InnerException != null ? e.InnerException.Message : "")); return; } } @@ -270,7 +266,7 @@ public void Update() } catch (Exception e) { - LogWriter.CreateLogEntry(string.Format("{0}\n{1}", e.Message, e.InnerException != null ? e.InnerException.Message : "")); + LogWriter.CreateLogEntry(string.Format("{0}: {1}; {2}", DateTime.Now, e.Message, e.InnerException != null ? e.InnerException.Message : "")); return; } } @@ -308,7 +304,7 @@ public void Update() } catch (Exception e) { - LogWriter.CreateLogEntry(string.Format("{0}\n{1}", e.Message, e.InnerException != null ? e.InnerException.Message : "")); + LogWriter.CreateLogEntry(string.Format("{0}: {1}; {2}", DateTime.Now, e.Message, e.InnerException != null ? e.InnerException.Message : "")); return; } } @@ -336,7 +332,7 @@ public void Update() catch (Exception e) { - LogWriter.CreateLogEntry(string.Format("{0}\n{1}", e.Message, e.InnerException != null ? e.InnerException.Message : "")); + LogWriter.CreateLogEntry(string.Format("{0}: {1}; {2}", DateTime.Now, e.Message, e.InnerException != null ? e.InnerException.Message : "")); return; } } diff --git a/RFiDGear/DataAccessLayer/Remote/FromFile/SettingsReaderWriter.cs b/RFiDGear/DataAccessLayer/Remote/FromFile/SettingsReaderWriter.cs index a3a4535..60d1cc1 100644 --- a/RFiDGear/DataAccessLayer/Remote/FromFile/SettingsReaderWriter.cs +++ b/RFiDGear/DataAccessLayer/Remote/FromFile/SettingsReaderWriter.cs @@ -111,7 +111,7 @@ public SettingsReaderWriter() } catch (Exception e) { - LogWriter.CreateLogEntry(string.Format("{0}\n{1}", e.Message, e.InnerException != null ? e.InnerException.Message : "")); + LogWriter.CreateLogEntry(string.Format("{0}: {1}; {2}", DateTime.Now, e.Message, e.InnerException != null ? e.InnerException.Message : "")); } if (!File.Exists(Path.Combine(appDataPath, _settingsFileFileName))) @@ -195,7 +195,7 @@ public bool ReadSettings(string _fileName = "") } catch (Exception e) { - LogWriter.CreateLogEntry(string.Format("{0}\n{1}", e.Message, e.InnerException != null ? e.InnerException.Message : "")); + LogWriter.CreateLogEntry(string.Format("{0}: {1}; {2}", DateTime.Now, e.Message, e.InnerException != null ? e.InnerException.Message : "")); return true; } @@ -225,7 +225,7 @@ public bool SaveSettings(string _path = "") } catch (XmlException e) { - LogWriter.CreateLogEntry(string.Format("{0}\n{1}", e.Message, e.InnerException != null ? e.InnerException.Message : "")); + LogWriter.CreateLogEntry(string.Format("{0}: {1}; {2}", DateTime.Now, e.Message, e.InnerException != null ? e.InnerException.Message : "")); return false; } } @@ -250,7 +250,7 @@ protected virtual void Dispose(bool disposing) catch (Exception e) { - LogWriter.CreateLogEntry(string.Format("{0}\n{1}", e.Message, e.InnerException != null ? e.InnerException.Message : "")); + LogWriter.CreateLogEntry(string.Format("{0}: {1}; {2}", DateTime.Now, e.Message, e.InnerException != null ? e.InnerException.Message : "")); } } diff --git a/RFiDGear/Resources/Manifest.de.resx b/RFiDGear/Resources/Manifest.de.resx index 4b8cb3e..9550dcf 100644 --- a/RFiDGear/Resources/Manifest.de.resx +++ b/RFiDGear/Resources/Manifest.de.resx @@ -1081,4 +1081,7 @@ Needed by: Update starten + + gewählte Aufgabe ausführen + \ No newline at end of file diff --git a/RFiDGear/Resources/Manifest.en.resx b/RFiDGear/Resources/Manifest.en.resx index 4d03d0a..153e754 100644 --- a/RFiDGear/Resources/Manifest.en.resx +++ b/RFiDGear/Resources/Manifest.en.resx @@ -1065,4 +1065,7 @@ Needed by: Update + + Run Selected Task + \ No newline at end of file diff --git a/RFiDGear/View/TaskViews/RFIDTasks/MifareClassicTask/MifareClassicTaskTabPages/TabPageMifareClassicDataExplorerView.xaml b/RFiDGear/View/TaskViews/RFIDTasks/MifareClassicTask/MifareClassicTaskTabPages/TabPageMifareClassicDataExplorerView.xaml index 6ef2341..448e47e 100644 --- a/RFiDGear/View/TaskViews/RFIDTasks/MifareClassicTask/MifareClassicTaskTabPages/TabPageMifareClassicDataExplorerView.xaml +++ b/RFiDGear/View/TaskViews/RFIDTasks/MifareClassicTask/MifareClassicTaskTabPages/TabPageMifareClassicDataExplorerView.xaml @@ -237,6 +237,7 @@ + + +