Innovenergy_trunk/csharp/lib/SysTools/SysDirs.cs

26 lines
1.1 KiB
C#
Raw Normal View History

2023-02-16 12:57:06 +00:00
using static System.Environment;
using static System.Environment.SpecialFolder;
namespace InnovEnergy.SysTools;
public static class SysDirs
{
// TODO conditional compilation
/*
public static SysPath ProgramDirectory => ExecutingAssemblyDirectory.Parent.Head == "bin" && (ExecutingAssemblyDirectory.Head == "Debug" || ExecutingAssemblyDirectory.Head == "Release")
? ExecutingAssemblyDirectory.Parent.Parent
: ExecutingAssemblyDirectory;
public static SysPath ExecutingAssemblyDirectory => ExecutingAssembly.Parent;
public static SysPath ExecutingAssembly => Assembly.GetExecutingAssembly().Location.Apply(SysPath.FromUri);
*/
public static SysPath CurrentDirectory => Environment.CurrentDirectory;
public static SysPath TempDirectory => System.IO.Path.GetTempPath();
public static SysPath UserHomeDirectory { get; } = GetFolderPath(UserProfile);
public static SysPath UserDesktopDirectory { get; } = GetFolderPath(DesktopDirectory);
}