Example #1
0
        private void Editor_UpdateDocument(object sender, UpdateDocumentRequest request)
        {
            var document = _documents[request.DocumentId];

            var updateDto = CreateUpdateDto(document, request.NewContent);

            //Am I the owner?
            if (document.Owner == _memberName)
            {
                CreatePatchForUpdate(document, updateDto);
            }
            else if (document.PendingUpdate == null)
            {
                document.PendingUpdate = updateDto;
                SendUpdateToDocumentOwner(document, updateDto);
            }
        }
        private void Editor_UpdateDocument(object sender, UpdateDocumentRequest request)
        {
            var document = _documents[request.DocumentId];

            var updateDto = CreateUpdateDto(document, request.NewContent);

            //Am I the owner?
            if (document.Owner == _memberName)
            {
                CreatePatchForUpdate(document, updateDto);
            }
            else if(document.PendingUpdate == null)
            {
                document.PendingUpdate = updateDto;
                SendUpdateToDocumentOwner(document, updateDto);
            }
        }