working with links
This commit is contained in:
@ -13,7 +13,7 @@
|
||||
CheckFile(defaultFileName);
|
||||
}
|
||||
|
||||
public string Get(string? noteName)
|
||||
public string GetText(string? noteName)
|
||||
{
|
||||
CheckFile(noteName);
|
||||
|
||||
@ -22,10 +22,12 @@
|
||||
|
||||
public ICollection<string> GetNoteNames()
|
||||
{
|
||||
return Directory.GetFiles(filePath);
|
||||
return Directory.GetFiles(filePath)
|
||||
.Select(f => Path.GetFileName(f))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public void Save(string content, string? noteName)
|
||||
public void SaveText(string content, string? noteName)
|
||||
{
|
||||
File.WriteAllText(GetFilePath(noteName), content);
|
||||
}
|
||||
@ -37,7 +39,7 @@
|
||||
// ensure initialized
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
Save("Hi! Feel free to start typing. Everything will be saved soon after you are done typing.", noteName);
|
||||
SaveText("Hi! Feel free to start typing. Everything will be saved soon after you are done typing.", noteName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
public interface INoteService
|
||||
{
|
||||
ICollection<string> GetNoteNames();
|
||||
string Get(string? noteName);
|
||||
void Save(string content, string? noteName);
|
||||
string GetText(string? noteName);
|
||||
void SaveText(string content, string? noteName);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user