-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ public enum SupportedOperatingSystem | |
{ | ||
Windows = 1, | ||
Linux = 2, | ||
Osx = 3, | ||
} |
35 changes: 35 additions & 0 deletions
35
src/app/DevilDaggersInfo.App.Core.NativeInterface/Services/Osx/OsxDialogService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace DevilDaggersInfo.App.Core.NativeInterface.Services.Osx; | ||
|
||
public class OsxDialogService : INativeDialogService | ||
{ | ||
public void ReportError(string message, Exception? exception = null) | ||
{ | ||
ReportError("Error", message, exception); | ||
} | ||
|
||
public void ReportError(string title, string message, Exception? exception = null) | ||
{ | ||
if (exception != null) | ||
message += Environment.NewLine + exception.Message; | ||
|
||
Console.WriteLine($"{title}: {message}"); | ||
} | ||
|
||
public void ReportMessage(string title, string message) | ||
{ | ||
Console.WriteLine($"{title}{Environment.NewLine}{message}"); | ||
} | ||
|
||
public bool? PromptYesNo(string title, string message) | ||
{ | ||
Console.WriteLine($"{title}{Environment.NewLine}{message}"); | ||
Console.WriteLine("Y/N"); | ||
ConsoleKeyInfo key = Console.ReadKey(); | ||
return key.Key switch | ||
{ | ||
ConsoleKey.Y => true, | ||
ConsoleKey.N => false, | ||
_ => null, | ||
}; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/app/DevilDaggersInfo.App.Core.NativeInterface/Services/Osx/OsxFileSystemService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using NativeFileDialogSharp; | ||
|
||
namespace DevilDaggersInfo.App.Core.NativeInterface.Services.Osx; | ||
|
||
/// <summary> | ||
/// Platform-specific code for interacting with the Linux file system. | ||
/// </summary> | ||
public class OsxFileSystemService : INativeFileSystemService | ||
{ | ||
public string? CreateOpenFileDialog(string dialogTitle, string? extensionFilter) | ||
{ | ||
return Dialog.FileOpen().Path; | ||
} | ||
|
||
public string? CreateSaveFileDialog(string dialogTitle, string? extensionFilter) | ||
{ | ||
return Dialog.FileSave().Path; | ||
} | ||
|
||
public string? SelectDirectory() | ||
{ | ||
return Dialog.FolderPicker().Path; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/app/DevilDaggersInfo.App.Core.NativeInterface/Services/Osx/OsxMemoryService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Diagnostics; | ||
|
||
namespace DevilDaggersInfo.App.Core.NativeInterface.Services.Osx; | ||
|
||
public class OsxMemoryService : INativeMemoryService | ||
{ | ||
public void WriteMemory(Process process, long address, byte[] bytes, int offset, int size) | ||
{ | ||
// TODO: Implement. | ||
} | ||
|
||
public void ReadMemory(Process process, long address, byte[] bytes, int offset, int size) | ||
{ | ||
// TODO: Implement. | ||
} | ||
|
||
public Process? GetDevilDaggersProcess() | ||
{ | ||
return Array.Find(Process.GetProcesses(), p => p.ProcessName.StartsWith("devildaggers")); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/app/DevilDaggersInfo.App.Ui.Base/Platforms/OsxValues.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using DevilDaggersInfo.Api.App.ProcessMemory; | ||
using DevilDaggersInfo.Types.Web; | ||
|
||
namespace DevilDaggersInfo.App.Ui.Base.Platforms; | ||
|
||
public class OsxValues : IPlatformSpecificValues | ||
{ | ||
public ToolBuildType BuildType => ToolBuildType.OsxWarp; | ||
|
||
public SupportedOperatingSystem OperatingSystem => SupportedOperatingSystem.Osx; | ||
|
||
public string DefaultInstallationPath => string.Empty; | ||
} |