Skip to content

Commit 7f9991f

Browse files
authored
enable arguments passing for ini (#535)
1 parent c3f58b4 commit 7f9991f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

ClientCore/ProcessLauncher.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ namespace ClientCore
44
{
55
public static class ProcessLauncher
66
{
7-
public static void StartShellProcess(string commandLine)
7+
public static void StartShellProcess(string commandLine, string arguments = null)
88
{
99
using var _ = Process.Start(new ProcessStartInfo
1010
{
1111
FileName = commandLine,
12+
Arguments = arguments,
1213
UseShellExecute = true
1314
});
1415
}
1516
}
16-
}
17+
}

ClientGUI/XNALinkButton.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public XNALinkButton(WindowManager windowManager) : base(windowManager) { }
1111

1212
public string URL { get; set; }
1313
public string UnixURL { get; set; }
14+
public string Arguments { get; set; }
1415

1516
protected override void ParseControlINIAttribute(IniFile iniFile, string key, string value)
1617
{
@@ -26,6 +27,12 @@ protected override void ParseControlINIAttribute(IniFile iniFile, string key, st
2627
return;
2728
}
2829

30+
if (key == "Arguments")
31+
{
32+
Arguments = value;
33+
return;
34+
}
35+
2936
base.ParseControlINIAttribute(iniFile, key, value);
3037
}
3138

@@ -34,11 +41,11 @@ public override void OnLeftClick()
3441
OSVersion osVersion = ClientConfiguration.Instance.GetOperatingSystemVersion();
3542

3643
if (osVersion == OSVersion.UNIX && !string.IsNullOrEmpty(UnixURL))
37-
ProcessLauncher.StartShellProcess(UnixURL);
44+
ProcessLauncher.StartShellProcess(UnixURL, Arguments);
3845
else if (!string.IsNullOrEmpty(URL))
39-
ProcessLauncher.StartShellProcess(URL);
46+
ProcessLauncher.StartShellProcess(URL, Arguments);
4047

4148
base.OnLeftClick();
4249
}
4350
}
44-
}
51+
}

0 commit comments

Comments
 (0)