Arrange files, add dependencies

This commit is contained in:
Tiago Conceição
2020-09-25 01:46:37 +01:00
parent 9051d61f9a
commit 9b2ed7a343
55 changed files with 2056 additions and 733 deletions
+48 -1
View File
@@ -9,6 +9,7 @@
using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Threading;
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
@@ -55,13 +56,59 @@ namespace UVtools.WPF
{
try
{
var info = new ProcessStartInfo("UVtools.exe", $"\"{filePath}\"");
var info = new ProcessStartInfo("UVtools.exe", $"\"{filePath}\"")
{
UseShellExecute = true
};
Process.Start(info)?.Dispose();
}
catch (Exception e)
{
Debug.WriteLine(e);
}
}
public static void OpenBrowser(string url)
{
try
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Process.Start("xdg-open", url);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Process.Start("open", url);
}
else
{
// throw
}
}
catch (Exception e)
{
Debug.WriteLine(e);
}
}
public static void StartProcess(string name)
{
try
{
using (Process.Start(new ProcessStartInfo(name)
{
UseShellExecute = true
})) { }
}
catch (Exception e)
{
Debug.WriteLine(e);
}
}