Exemple #1
0
        bool LoadChanges()
        {
            const int maxItems = 50;

            Changes = JsonChangesOutput.Load(RenderFileHelper.BuildOutputFileName(Configuration, RenderChangeTracker.FileName));
            if (Changes != null && Changes.Items.Count > maxItems)
            {
                Changes.Items = Changes.Items.Skip(Changes.Items.Count - maxItems).ToList();
            }

            return(Changes != null);
        }
Exemple #2
0
        void AppendChangeToFile()
        {
            var fileName = RenderFileHelper.BuildOutputFileName(Configuration, FileName);
            var changes  = JsonChangesOutput.Load(fileName) ?? new JsonChangesOutput();

            changes.Items.Add(new JsonChangesItem
            {
                Changed = DateTime.Now,
                ConfigurationChanged = ConfigurationChanged(),
                NumberOfFragements   = Duplicates.Count,
                NumberOfLocations    = Duplicates.Sum(q => q.Locations.Count)
            });

            File.WriteAllText(fileName, changes.ToJsonString());
        }