Пример #1
0
        public static void SaveDocument(Project proj, Document doc, User user, bool fromServer = false)
        {
            // If the document exists in the storage, merge old version with newer verion.
            // Otherwise just save it to the storage.
            Document docInStorage = Storage.ReadFromFile(proj.Id, doc.Id);

            if (docInStorage == null)
            {
                Storage.WriteToFile(proj, doc, fromServer);
            }
            else
            {
                docInStorage.MergeWith(doc, user);
                Storage.WriteToFile(proj, docInStorage, fromServer);
            }
        }