1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-25 15:20:10 +00:00
msfs-popout-panel-manager/Shared/FileIO.cs

44 lines
1.7 KiB
C#
Raw Permalink Normal View History

2022-07-23 19:23:32 +00:00
using System;
using System.IO;
2022-01-27 13:40:04 +00:00
namespace MSFSPopoutPanelManager.Shared
{
public class FileIo
{
2024-07-28 00:12:07 +00:00
public static string GetUserDataFilePath(bool isRoamingPath)
2022-01-27 13:40:04 +00:00
{
2024-07-28 00:12:07 +00:00
var specialFolder = isRoamingPath ? Environment.SpecialFolder.ApplicationData : Environment.SpecialFolder.MyDocuments;
return Path.Combine(Environment.GetFolderPath(specialFolder), GetBuildConfigPath());
2022-07-23 19:23:32 +00:00
}
2024-07-28 00:12:07 +00:00
public static string GetErrorLogFilePath(bool isRoamingPath)
2022-07-23 19:23:32 +00:00
{
2024-07-28 00:12:07 +00:00
var specialFolder = isRoamingPath ? Environment.SpecialFolder.ApplicationData : Environment.SpecialFolder.MyDocuments;
return Path.Combine(Environment.GetFolderPath(specialFolder), GetBuildConfigPath(), @"LogFiles\error.log");
2022-07-23 19:23:32 +00:00
}
2024-07-28 00:12:07 +00:00
public static string GetDebugLogFilePath(bool isRoamingPath)
2022-07-23 19:23:32 +00:00
{
2024-07-28 00:12:07 +00:00
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");
2022-07-23 19:23:32 +00:00
}
2024-07-28 00:12:07 +00:00
private static string GetBuildConfigPath()
2022-07-23 19:23:32 +00:00
{
2023-07-12 22:41:31 +00:00
#if DEBUG
2024-07-28 00:12:07 +00:00
return "MSFS Pop Out Panel Manager Debug";
2023-07-12 22:41:31 +00:00
#elif LOCAL
2024-07-28 00:12:07 +00:00
return "MSFS Pop Out Panel Manager Local";
2022-07-23 19:23:32 +00:00
#else
2024-07-28 00:12:07 +00:00
return "MSFS Pop Out Panel Manager";
2022-07-23 19:23:32 +00:00
#endif
2022-01-27 13:40:04 +00:00
}
}
}