Beispiel #1
0
        private static void AddNewRecord(Model.Retro retro)
        {
            var description = _options.Description;
            var date        = DateTime.Now;

            if (_options.Positive)
            {
                retro.PositiveExperiences.Add(new PositiveRecord(description, date));
                return;
            }

            if (_options.Negative)
            {
                retro.NegativeExperiences.Add(new NegativeRecord(description, date));
                return;
            }

            if (_options.Kudos)
            {
                retro.Kudos.Add(new Kudos(_options.KudosTarget, description, date));
                return;
            }

            throw new ArgumentOutOfRangeException("Unknown record type");
        }
Beispiel #2
0
        private static void SaveRetroObject(Model.Retro retro)
        {
            var serializedObject = JsonConvert.SerializeObject(retro, Formatting.Indented);

            File.WriteAllText(_retroFileFullName, serializedObject);
        }