Skip to content

Commit

Permalink
implemented #57
Browse files Browse the repository at this point in the history
  • Loading branch information
Crypt32 committed Dec 9, 2024
1 parent 9f3f79e commit 9324f3e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Asn1Editor/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -62,7 +63,7 @@ protected override void OnExit(ExitEventArgs e) {
_logger.Dispose();
base.OnExit(e);
}
static async void parseArguments(IReadOnlyList<String> args) {
async void parseArguments(IReadOnlyList<String> args) {
for (Int32 i = 0; i < args.Count;) {
switch (args[i].ToLower()) {
case "-path": // open from a file
Expand All @@ -80,7 +81,12 @@ static async void parseArguments(IReadOnlyList<String> args) {
await Container.Resolve<IMainWindowVM>().OpenRawAsync(args[i]);
return;
default:
Console.WriteLine($"Unknown parameter '{args[i]}'");
if (File.Exists(args[i])) {
await Container.Resolve<IMainWindowVM>().OpenExistingAsync(args[i]);
} else {
Trace.WriteLine($"Unknown parameter '{args[i]}'");
Shutdown(2);
}
return;
}
}
Expand Down

0 comments on commit 9324f3e

Please sign in to comment.