namespace VideoBrowser.Controls.CefSharpBrowser.Helpers
{
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
///
/// Defines the .
///
public static class ProcessHelper
{
#region Methods
///
/// The OpenFolder.
///
/// The filePath.
public static void OpenContainedFolder(string filePath)
{
var path = Path.GetDirectoryName(filePath);
Start(path);
}
///
/// The OpenUrl.
///
/// The url.
public static void OpenUrl(string url)
{
Start(url);
}
///
/// The Start.
///
/// The filePath.
public static void Start(string filePath)
{
Task.Run(() =>
{
var process = new Process
{
StartInfo = new ProcessStartInfo()
{
CreateNoWindow = true,
ErrorDialog = true,
FileName = filePath,
Verb = "Open"
}
};
process.Start();
});
}
#endregion Methods
}
}