From bc836a3c000181f971c4f2170b83101c540f0bca Mon Sep 17 00:00:00 2001
From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com>
Date: Sat, 2 Aug 2025 14:48:57 +1000
Subject: [PATCH] create ide settings
---
.../Components/IdeSettingsDialog.razor | 12 ++++++++++++
src/SharpIDE.Photino/Layout/MainLayout.razor | 9 +++++++++
src/SharpIDE.Photino/Models/AppState.cs | 6 ++++++
src/SharpIDE.Photino/Program.cs | 1 +
4 files changed, 28 insertions(+)
create mode 100644 src/SharpIDE.Photino/Components/IdeSettingsDialog.razor
diff --git a/src/SharpIDE.Photino/Components/IdeSettingsDialog.razor b/src/SharpIDE.Photino/Components/IdeSettingsDialog.razor
new file mode 100644
index 0000000..f2ac366
--- /dev/null
+++ b/src/SharpIDE.Photino/Components/IdeSettingsDialog.razor
@@ -0,0 +1,12 @@
+@using SharpIDE.Photino.Models
+
+@inject AppState AppState
+
+
+
+
+
+@code {
+ [CascadingParameter]
+ public IMudDialogInstance MudDialog { get; set; } = null!;
+}
diff --git a/src/SharpIDE.Photino/Layout/MainLayout.razor b/src/SharpIDE.Photino/Layout/MainLayout.razor
index e38b155..601c516 100644
--- a/src/SharpIDE.Photino/Layout/MainLayout.razor
+++ b/src/SharpIDE.Photino/Layout/MainLayout.razor
@@ -23,6 +23,9 @@
+
+
+
@@ -89,4 +92,10 @@
{
await BuildService.MsBuildSolutionAsync(_solutionFilePath!, buildType);
}
+
+ private async Task OpenSettingsDialog()
+ {
+ var dialogRef = await DialogService.ShowAsync("SharpIDE Settings", new DialogOptions { MaxWidth = MaxWidth.Medium, CloseButton = true });
+ }
+
}
diff --git a/src/SharpIDE.Photino/Models/AppState.cs b/src/SharpIDE.Photino/Models/AppState.cs
index dc44979..2760b53 100644
--- a/src/SharpIDE.Photino/Models/AppState.cs
+++ b/src/SharpIDE.Photino/Models/AppState.cs
@@ -3,4 +3,10 @@ namespace SharpIDE.Photino.Models;
public class AppState
{
public required string SolutionFilePath { get; set; }
+ public required IdeSettings IdeSettings { get; set; } = new IdeSettings();
+}
+
+public class IdeSettings
+{
+ public bool AutoOpenLastSolution { get; set; }
}
diff --git a/src/SharpIDE.Photino/Program.cs b/src/SharpIDE.Photino/Program.cs
index b58b79a..15a4eeb 100644
--- a/src/SharpIDE.Photino/Program.cs
+++ b/src/SharpIDE.Photino/Program.cs
@@ -92,6 +92,7 @@ public class Program
if (deserializedAppState is not null)
{
appState.SolutionFilePath = deserializedAppState.SolutionFilePath;
+ appState.IdeSettings = deserializedAppState.IdeSettings;
}
}
}