using System;
namespace Flow.Launcher.Infrastructure
{
public static class FileExplorerHelper
{
///
/// Gets the path of the file explorer that is currently in the foreground
///
public static string GetActiveExplorerPath()
{
var explorerPath = DialogJump.DialogJump.GetActiveExplorerPath();
return !string.IsNullOrEmpty(explorerPath) ?
GetDirectoryPath(new Uri(explorerPath).LocalPath) :
null;
}
///
/// Get directory path from a file path
///
private static string GetDirectoryPath(string path)
{
if (!path.EndsWith('\\'))
{
return path + "\\";
}
return path;
}
}
}