1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-24 06:40:09 +00:00
msfs-popout-panel-manager/Shared/FileIO.cs
2024-07-27 20:12:07 -04:00

43 lines
1.7 KiB
C#

using System;
using System.IO;
namespace MSFSPopoutPanelManager.Shared
{
public class FileIo
{
public static string GetUserDataFilePath(bool isRoamingPath)
{
var specialFolder = isRoamingPath ? Environment.SpecialFolder.ApplicationData : Environment.SpecialFolder.MyDocuments;
return Path.Combine(Environment.GetFolderPath(specialFolder), GetBuildConfigPath());
}
public static string GetErrorLogFilePath(bool isRoamingPath)
{
var specialFolder = isRoamingPath ? Environment.SpecialFolder.ApplicationData : Environment.SpecialFolder.MyDocuments;
return Path.Combine(Environment.GetFolderPath(specialFolder), GetBuildConfigPath(), @"LogFiles\error.log");
}
public static string GetDebugLogFilePath(bool isRoamingPath)
{
var specialFolder = isRoamingPath ? Environment.SpecialFolder.ApplicationData : Environment.SpecialFolder.MyDocuments;
return Path.Combine(Environment.GetFolderPath(specialFolder), GetBuildConfigPath(), @"LogFiles\debug.log");
}
public static string GetInfoLogFilePath(bool isRoamingPath)
{
var specialFolder = isRoamingPath ? Environment.SpecialFolder.ApplicationData : Environment.SpecialFolder.MyDocuments;
return Path.Combine(Environment.GetFolderPath(specialFolder), GetBuildConfigPath(), @"LogFiles\info.log");
}
private static string GetBuildConfigPath()
{
#if DEBUG
return "MSFS Pop Out Panel Manager Debug";
#elif LOCAL
return "MSFS Pop Out Panel Manager Local";
#else
return "MSFS Pop Out Panel Manager";
#endif
}
}
}