Esempio n. 1
0
        public static void Main(string[] args)
        {
            var settings   = ConfigurationManager.AppSettings;
            var sourcePath = settings.Get("Source");
            var targetPath = settings.Get("Target");

            // XML
            var generateXml = bool.Parse(settings.Get("GenerateXml"));
            var xmlPath     = settings.Get("XmlPath");
            var xmlFileName = settings.Get("XmlFileName");
            var compressXml = bool.Parse(settings.Get("CompressXml"));

            // File
            var generateFile = bool.Parse(settings.Get("GenerateFile"));

            if (generateXml)
            {
                var xmlGenerator = new XmlGenerator(xmlFileName);
                xmlGenerator.Generate(sourcePath, xmlPath);

                if (compressXml)
                {
                    var compressor = new Compressor(Path.Combine(xmlPath, xmlFileName));
                    compressor.Compress();
                }
            }

            if (generateFile)
            {
                var fileGenerator = new FileGenerator();
                fileGenerator.GenerateFromXml(Path.Combine(xmlPath, xmlFileName), targetPath);
            }
        }
Esempio n. 2
0
        static void GenerateSampleViewModel()
        {
            //Modelo de la clase a crear
            const string model = @"namespace Models
            {
                public class Car
                {
                    public string carName { get; set; }
                }
            }";

            //crea archivos .cs (modelos, "nombreDelArchivo")
            FileGenerator.createFile(model, "carController");
        }
        private static void GenerateAPICode(string outputDirectory)
        {
            Console.WriteLine("Generate API code");
            var generator = new FileGenerator(outputDirectory);

            foreach (var type in GetTypesFromDll())
            {
                if (type.BaseType != null)
                {
                    if (type.BaseType.Equals(typeof(System.MulticastDelegate)))
                    {
                        continue;
                    }
                }

                generator.SaveToFile(type);
            }
        }