From c8b0edf9a4b4ff8fc7268d9dd597aabeb811bc23 Mon Sep 17 00:00:00 2001 From: AraHaan Date: Mon, 6 May 2024 21:09:48 -0400 Subject: [PATCH] Add Crash Screenshot path to API. (#267) Signed-off-by: AraHaan --- ref/SettingsFile/SettingsFile/SettingsFile.cs | 7 +++++++ src/SettingsFile/SettingsFile/SettingsFile.cs | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/ref/SettingsFile/SettingsFile/SettingsFile.cs b/ref/SettingsFile/SettingsFile/SettingsFile.cs index bd2ecc9..bf36878 100644 --- a/ref/SettingsFile/SettingsFile/SettingsFile.cs +++ b/ref/SettingsFile/SettingsFile/SettingsFile.cs @@ -68,4 +68,11 @@ public static string ErrorLogPath // On Non-Windows OS's all crash dumps must be named "core.{PID}"!!! public static string MiniDumpPath => throw null!; + + /// + /// Gets the path to the Application crash screenshot file. + /// + // On Non-Windows OS's all crash screenshots must be named "core.{PID}.png"!!! + public static string CrashScreenshotPath + => throw null!; } diff --git a/src/SettingsFile/SettingsFile/SettingsFile.cs b/src/SettingsFile/SettingsFile/SettingsFile.cs index 2876a26..225c27e 100644 --- a/src/SettingsFile/SettingsFile/SettingsFile.cs +++ b/src/SettingsFile/SettingsFile/SettingsFile.cs @@ -62,6 +62,12 @@ static SettingsFile() // On Non-Windows OS's all crash dumps must be named "core.{PID}"!!! public static string MiniDumpPath { get; } = OperatingSystem.IsWindows() ? $"{LocalApplicationDataFolder}{thisProcessName}-{ThisProcessId}.mdmp" : $"{LocalApplicationDataFolder}core.{ThisProcessId}"; + /// + /// Gets the path to the Application crash screenshot file. + /// + // On Non-Windows OS's all crash screenshots must be named "core.{PID}.png"!!! + public static string CrashScreenshotPath { get; } = OperatingSystem.IsWindows() ? MiniDumpPath.Replace(".mdmp", ".png", StringComparison.OrdinalIgnoreCase) : $"{MiniDumpPath}.png"; + internal static int ThisProcessId { get; private set; } private static string LocalApplicationDataFolder