/// <summary> /// Starts tracking changes for the specified document. /// </summary> protected async Task AddDocumentAsync(DrxDocument document) { // Set its store and store ID to this document.Store = this; document.Header.Store = Id; // Check if it already exists in the cache var existing = _documents.FirstOrDefault(d => d.Id == document.Id); if (existing == null) { _documents.Add(document); return; } // Replace the existing cache document if there var pos = _documents.IndexOf(existing); _documents.Remove(existing); _documents.Insert(pos, document); }
public async Task DeleteDocumentAsync(DrxDocument document) { _documents.Remove(document); await _backer.DeleteDocumentAsync(document.Id); }
public async Task SaveDocumentAsync(DrxDocument document) => await _backer.SaveDocumentAsync(document);
/// <summary> /// Retrieves a full document, including the body, from the backing store. /// This populates its entry fully in Documents to avoid double loading. /// </summary> public async Task LoadDocumentBodyAsync(DrxDocument document) { var temp = await _backer.GetDocumentAsync(document.Id); document.Body = temp.Body; }
public Task SaveDocumentAsync(DrxDocument document) { throw new NotImplementedException(); }
public Task LoadDocumentBodyAsync(DrxDocument document) { throw new NotImplementedException(); }
public DocumentFlagsDialog(DrxDocument document) { InitializeComponent(); Document = document; }