This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
UpTool2/UpTool2/Tool/PathTool.cs
CreepyCrafter24 af1f9fbfea Improve code
2020-02-28 12:59:59 +01:00

22 lines
860 B
C#

using System;
using System.IO;
using System.Linq;
namespace UpTool2.Tool
{
internal static class PathTool
{
public static string GetProgPath(params string[] segments) => Path.Combine(new[] { dir }.Concat(segments).ToArray());
public static string dir => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "UpTool2");
public static string tempPath => GetProgPath("tmp");
public static string appsPath => GetProgPath("Apps");
public static string infoXML => GetProgPath("info.xml");
public static string getAppPath(Guid app) => Path.Combine(appsPath, app.ToString());
public static string getDataPath(Guid app) => Path.Combine(getAppPath(app) + @"app");
public static string getInfoPath(Guid app) => Path.Combine(getAppPath(app), "info.xml");
}
}