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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|