From 9324f3ee1f49c9a4a6938e228ba27edd35ca4be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vadims=20Pod=C4=81ns?= Date: Mon, 9 Dec 2024 15:20:04 +0200 Subject: [PATCH] implemented #57 --- Asn1Editor/App.xaml.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Asn1Editor/App.xaml.cs b/Asn1Editor/App.xaml.cs index 90a686b..132c719 100644 --- a/Asn1Editor/App.xaml.cs +++ b/Asn1Editor/App.xaml.cs @@ -27,6 +27,7 @@ namespace SysadminsLV.Asn1Editor; public partial class App { static readonly String _appDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Sysadmins LV\Asn1Editor"); static readonly Logger _logger = new(); + readonly NodeViewOptions _options; public App() { @@ -62,7 +63,7 @@ protected override void OnExit(ExitEventArgs e) { _logger.Dispose(); base.OnExit(e); } - static async void parseArguments(IReadOnlyList args) { + async void parseArguments(IReadOnlyList args) { for (Int32 i = 0; i < args.Count;) { switch (args[i].ToLower()) { case "-path": // open from a file @@ -80,7 +81,12 @@ static async void parseArguments(IReadOnlyList args) { await Container.Resolve().OpenRawAsync(args[i]); return; default: - Console.WriteLine($"Unknown parameter '{args[i]}'"); + if (File.Exists(args[i])) { + await Container.Resolve().OpenExistingAsync(args[i]); + } else { + Trace.WriteLine($"Unknown parameter '{args[i]}'"); + Shutdown(2); + } return; } }