Skip to content

Commit

Permalink
Add Crash Screenshot path to API. (#267)
Browse files Browse the repository at this point in the history
Signed-off-by: AraHaan <seandhunt_7@yahoo.com>
  • Loading branch information
AraHaan committed May 7, 2024
1 parent bdd98a4 commit c8b0edf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ref/SettingsFile/SettingsFile/SettingsFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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!;

/// <summary>
/// Gets the path to the Application crash screenshot file.
/// </summary>
// On Non-Windows OS's all crash screenshots must be named "core.{PID}.png"!!!
public static string CrashScreenshotPath
=> throw null!;
}
6 changes: 6 additions & 0 deletions src/SettingsFile/SettingsFile/SettingsFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}";

/// <summary>
/// Gets the path to the Application crash screenshot file.
/// </summary>
// 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
Expand Down

0 comments on commit c8b0edf

Please sign in to comment.