Skip to content

Commit

Permalink
Add Possibility to call it with an image path on the command line (ne…
Browse files Browse the repository at this point in the history
…cessary for using in Windows Explorer "Open with" menu)
  • Loading branch information
thomas694 committed Nov 9, 2021
1 parent 9a99aca commit 3cd91d5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions src/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,24 @@ private enum Modi

public MainWindow()
{
string[] args = null;
try
{
args = Environment.GetCommandLineArgs();
}
catch (NotSupportedException)
{
}
if (args?.Length > 1)
{
_directory = Path.GetDirectoryName(args[1]);
}
ReadSettings();
Initialize();
if (args?.Length > 1)
{
SetImage(args[1]);
}
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.1.2.0")]
[assembly: AssemblyFileVersion("1.1.2.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]

0 comments on commit 3cd91d5

Please sign in to comment.