void SetNotes(IHaveNotes note, string type, string text) { var fileName = GetNoteFileName(note, type); if (string.IsNullOrWhiteSpace(text)) { if (fileName.Exists) Tools.FileUtil.Ops.DeleteWithRetry(fileName.ToString()); } else { var noteDir = GetNoteDirectory(type); noteDir.MakeSurePathExists(); File.WriteAllText(fileName.ToString(), text, Encoding.UTF8); } }
void SetNotes(IHaveNotes note, string type, string text) { var fileName = GetNoteFileName(note, type); if (string.IsNullOrWhiteSpace(text)) { if (fileName.Exists) { Tools.FileUtil.Ops.DeleteWithRetry(fileName.ToString()); } } else { var noteDir = GetNoteDirectory(type); noteDir.MakeSurePathExists(); File.WriteAllText(fileName.ToString(), text, Encoding.UTF8); } }
public NotesViewModel(IHaveNotes item) { Item = item; DisplayName = "Notes"; this.SetCommand(x => x.CloseNoteCommand).Subscribe(CloseNote); }
public void OpenNote(IHaveNotes x) { ShowNotes(x); }
IAbsoluteFilePath GetNoteFileName(IHaveNotes noter, string type) => GetNoteDirectory(type) .GetChildFileWithName(string.Format(type + "_{0}.txt", noter.NoteName.Replace(".", "_").Replace(":", "_")));
bool HasNotes(IHaveNotes note, string type) => GetNoteFileName(note, type).Exists;
string GetNotes(IHaveNotes note, string type) { var fileName = GetNoteFileName(note, type); return fileName.Exists ? File.ReadAllText(fileName.ToString(), Encoding.UTF8) : String.Empty; }
string GetNotes(IHaveNotes note, string type) { var fileName = GetNoteFileName(note, type); return(fileName.Exists ? File.ReadAllText(fileName.ToString(), Encoding.UTF8) : String.Empty); }
public void ShowNotes(IHaveNotes note) { ShowOverlay(new NotesViewModel(note)); }