Пример #1
0
        public static void Run(string basePath, string nameSpace)
        {
            var infos     = FractionUnitDefs.All;
            var path      = Path.Combine(basePath, "+IUnitedValue", "+fraction");
            var generator = new FractionValuesGenerator(path, nameSpace);

            generator.Generate(infos.Items);

            path = Path.Combine(basePath, "+jsonConverters", "+fraction");
            var jsonConverter =
                new UnitJsonConverterGenerator(path, nameSpace)
            {
                ClassicImpl = true
            };

            jsonConverter.Generate(infos.Items);
        }
        public static void Run(string basePath, string nameSpace)
        {
            var infos         = All;
            var unitGenerator = new BasicUnitGenerator(Path.Combine(basePath, "+IUnits"), nameSpace);

            unitGenerator.Generate(infos.DistinctNames);

            var unitedValues = new BasicUnitValuesGenerator(Path.Combine(basePath, "+IUnitedValue"), nameSpace);

            unitedValues.Generate(infos.Items);

            var jsonConverter = new UnitJsonConverterGenerator(Path.Combine(basePath, "+jsonConverters"), nameSpace);

            jsonConverter.Generate(infos.Items);

            var ext = new UnitExtensionsGenerator(Path.Combine(basePath, "+extensions"), nameSpace);

            ext.Generate(infos.Items);
        }