예제 #1
0
        public void Execute(Configuration configuration, List <Duplicate> duplicates)
        {
            var data = new JsonOutput {
                Configuration = configuration, Duplicates = duplicates
            };

            RenderFileHelper.SaveRenderOutput(configuration, FileName, data.ToJsonString());
        }
예제 #2
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);
        }
예제 #3
0
        public void Execute(Configuration configuration, List <Duplicate> duplicates)
        {
            var stubble = new StubbleBuilder().Build();

            var data = new Dictionary <string, object>
            {
                ["Duplicates"]    = duplicates.Select(q => new DuplicateDisplay(configuration.SourceDirectory, q)).ToList(),
                ["Configuration"] = configuration,
            };

            var output = stubble.Render(Template, data);

            RenderFileHelper.SaveRenderOutput(configuration, FileName, output);
        }
예제 #4
0
        public void Execute(Configuration configuration, List <Duplicate> duplicates)
        {
            Configuration = configuration;

            if (!configuration.TrackChanges || !LoadChanges())
            {
                return;
            }

            var stubble = new StubbleBuilder().Build();

            var data = new Dictionary <string, object>
            {
                ["labels"]    = string.Join(",", Changes.Items.Select(FormatLabel)),
                ["fragments"] = string.Join(",", Changes.Items.Select(q => q.NumberOfFragements)),
                ["locations"] = string.Join(",", Changes.Items.Select(q => q.NumberOfLocations)),
            };

            var output = stubble.Render(Template, data);

            RenderFileHelper.SaveRenderOutput(configuration, FileName, output);
        }