Exemple #1
0
        // takes existing XJF files, adds there Pressview (measure color strip) from existing layout and saves modified XJF file to a separate place
        // pretty useless method, must be replaced with something based on CustomizationsGenerator
        private static void AddPressviewToXjfsFromLayouts()
        {
            var layouts = LayoutRepository.GetAll();

            foreach (var layout in layouts)
            {
                var xjf = XjfRepository.GetUntouched(layout.PapCode);
                xjf = XjfModifier.AddMeasureColorStrip(xjf, layout);
                XjfRepository.Save(xjf, layout.PapCode);
            }
        }
Exemple #2
0
        // creates a file with input for a SQL script that replaces customizations
        private static void SaveCustomizationsFromXjfs()
        {
            var codes = new[] { 403, 404, 405, 408, 409, 410, 411, 412, 413, 414, 415, 417, 418, 420, 421, 422, 423, 424, 425, 426, 427, 428 };
            var customizationsFilename = @"c:\Projects\Albumprinter\Files\Xpresso\Customizations\PressView.txt";
            var layouts = LayoutRepository.GetAll();

            if (File.Exists(customizationsFilename))
            {
                File.Delete(customizationsFilename);
            }

            var lines = codes.Select(code =>
            {
                //var xjf = XjfRepository.Get(code);
                //var customization = CustomizationsGenerator.GetCustomizations(xjf);
                var customization = CustomizationsGenerator.GetCustomizations(layouts.Single(l => l.PapCode == code));
                return($"('pap_{code}','{customization}')");
            })
                        .ToArray();

            var customizationsToSave = string.Join($",{Environment.NewLine}", lines);

            File.WriteAllText(customizationsFilename, customizationsToSave);
        }