Пример #1
0
        public bool SaveEncounter(EncounterViewModel encounter)
        {
            string json = encounter.ToJson();

            var fileName = GetEncounterFileName(encounter.Id);
            var filePath = Path.Combine(path, encounterDirectory, fileName);

            using (StreamWriter writer = new StreamWriter(filePath, false))
            {
                try
                {
                    writer.Write(json);
                }
                catch (IOException e)
                {
                    Crashes.TrackError(e);
                    return(false);
                }
            }

            return(true);
        }