Ejemplo n.º 1
0
        private static void Convert(ReadInputFilesResult inputFiles, CommandLineArgs commandLineArgs)
        {
            if (inputFiles.SkinDefinitionContext.Errors.Any(err => err.Severity == LayoutTool.Interfaces.Entities.ErrorServerity.Error))
            {
                throw new ValidationException($"There are some errors inside '{inputFiles.SkinDefinitionFile}' file.{Environment.NewLine}You should take a look inside that file or open it with the Layout Admin Tool.");
            }


            if (inputFiles.SkinDefinitionContext.Errors.Any(err => err.Severity == LayoutTool.Interfaces.Entities.ErrorServerity.Warning))
            {
                Logger.Warning($"Atention! There are some warnings inside '{inputFiles.SkinDefinitionFile}' file.{Environment.NewLine}You should take a look inside that file or open it with the Layout Admin Tool.");
            }


            var converter        = CreateConverter(inputFiles);
            var conversionResult = converter.Convert(inputFiles.SkinDefinitionContext.SkinDefinition);

            string conversionResultFolder = GetConvertionResultFolder(commandLineArgs);

            Logger.Info($"Writing conversion result to: {conversionResultFolder}");

            foreach (var file in conversionResult.Files)
            {
                FileSystem.WriteAllText(Path.Combine(conversionResultFolder, file.OriginalFile.FileName), file.NewContent);
            }
        }
Ejemplo n.º 2
0
        private static XmlSkinDefinitionConverter CreateConverter(ReadInputFilesResult inputFiles)
        {
            XmlSkinDefinitionConverter converter = new XmlSkinDefinitionConverter();

            converter.NavigationPlan = inputFiles.NavigationPlan;
            return(converter);
        }