wip making UI actions for notes

This commit is contained in:
Ryan Peters
2025-07-17 16:42:25 -04:00
parent 11f468a5c1
commit 14e56285f5
7 changed files with 55 additions and 30 deletions

View File

@@ -30,8 +30,13 @@
.ToList();
}
public void SaveNote(string noteName, string content)
public void SaveNote(string noteName, string? content = null)
{
if (string.IsNullOrWhiteSpace(noteName))
{
content = "Hi! Feel free to start typing. Everything will be saved soon after you are done typing.";
}
File.WriteAllText(GetFilePath(noteName), content);
}
@@ -51,7 +56,7 @@
{
Directory.CreateDirectory(folderPath);
SaveNote(noteName, "Hi! Feel free to start typing. Everything will be saved soon after you are done typing.");
SaveNote(noteName);
}
}

View File

@@ -4,7 +4,7 @@
{
ICollection<string> GetNoteNames();
string GetNote(string noteName);
void SaveNote(string noteName, string content);
void SaveNote(string noteName, string? content = null);
void DeleteNote(string noteName);
}
}