wip making UI actions for notes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user