Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 public async Task DeleteDocumentAsync(DrxDocument document)
 {
     _documents.Remove(document);
     await _backer.DeleteDocumentAsync(document.Id);
 }
Ejemplo n.º 3
0
 public async Task SaveDocumentAsync(DrxDocument document) => await _backer.SaveDocumentAsync(document);
Ejemplo n.º 4
0
        /// <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;
        }
Ejemplo n.º 5
0
 public Task SaveDocumentAsync(DrxDocument document)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
 public Task LoadDocumentBodyAsync(DrxDocument document)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 7
0
 public DocumentFlagsDialog(DrxDocument document)
 {
     InitializeComponent();
     Document = document;
 }