File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ public static Task<Func<Task>> GetFunctionByName(string functionName)
140
140
"GalleryClick" => GalleryClick ,
141
141
"Slideshow" => Slideshow ,
142
142
"ColorPicker" => ColorPicker ,
143
+ "Restart" => Restart ,
143
144
144
145
_ => null
145
146
} ) ;
@@ -1046,7 +1047,32 @@ public static async Task ResetSettings()
1046
1047
1047
1048
public static async Task Restart ( )
1048
1049
{
1049
- ProcessHelper . RestartApp ( Environment . GetCommandLineArgs ( ) ? . ToString ( ) ) ;
1050
+ var openFile = string . Empty ;
1051
+ var getFromArgs = false ;
1052
+ if ( Vm ? . FileInfo is not null )
1053
+ {
1054
+ if ( Vm . FileInfo . Exists )
1055
+ {
1056
+ openFile = Vm . FileInfo . FullName ;
1057
+ }
1058
+ else
1059
+ {
1060
+ getFromArgs = true ;
1061
+ }
1062
+ }
1063
+ else
1064
+ {
1065
+ getFromArgs = true ;
1066
+ }
1067
+ if ( getFromArgs )
1068
+ {
1069
+ var args = Environment . GetCommandLineArgs ( ) ;
1070
+ if ( args is not null && args . Length > 0 )
1071
+ {
1072
+ openFile = args [ 1 ] ;
1073
+ }
1074
+ }
1075
+ ProcessHelper . RestartApp ( openFile ) ;
1050
1076
1051
1077
if ( Application . Current ? . ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop )
1052
1078
{
You can’t perform that action at this time.
0 commit comments