private static async Task MergeFileIntoNote(StorageFile file, Note note) { note.DateCreated = file.DateCreated.LocalDateTime; BasicProperties properties = await file.GetBasicPropertiesAsync(); note.DateModified = properties.DateModified.LocalDateTime; note.Name = file.Name; note.Text = await FileIO.ReadTextAsync(file); note.MarkAsClean(); }
public static async Task WriteToStorageAsync(Note note) { if (note.IsDirty) { var save = StorageManager.SaveFileAsync(note.Name, note.Text); note.MarkAsClean(); await save; note.DateModified = DateTime.Now; } }