src/Elements/Generate/TypeGenerator.cs
/// <summary>
/// Generate the core element types as .cs files to the specified output directory. 
/// </summary>
/// <param name="outputBaseDir">The root directory into which generated files will be written.</param>
Generate the core element types as .cs files to the specified output directory.
Generate the core element types as . cs files to the specified output directory .
public static async Task<GenerationResult[]> GenerateElementTypesAsync(string outputBaseDir)
        {
            var typeNames = _hyparSchemas.Select(u => GetTypeNameFromSchemaUri(u)).ToList();
            var tasks = new List<Task<GenerationResult>>();
            foreach (var uri in _hyparSchemas)
            {
                var split = uri.Split(new[] { "/" }, StringSplitOptions.RemoveEmptyEntries).Skip(3);
                var outDir = Path.Combine(outputBaseDir, string.Join("/", split.Take(split.Count() - 1)).TrimEnd('.'));
                if (!Directory.Exists(outDir))
                {
                    Directory.CreateDirectory(outDir);
                }
               tasks.Add(GenerateUserElementTypeFromUriAsync(uri, outDir));
            }
            var allResults = await Task.WhenAll(tasks);
            return allResults;
        }
public static async Task < GenerationResult [ ] > GenerateElementTypesAsync ( string outputBaseDir ) { var typeNames = _hyparSchemas . Select ( u => GetTypeNameFromSchemaUri ( u ) ) . ToList ( ) ; var tasks = new List < Task < GenerationResult > > ( ) ; foreach ( var uri in _hyparSchemas ) { var split = uri . Split ( new [ ] { " " } , StringSplitOptions . RemoveEmptyEntries ) . Skip ( 3 ) ; var outDir = Path . Combine ( outputBaseDir , string . Join ( " " , split . Take ( split . Count ( ) - 1 ) ) . TrimEnd ( ' ' ) ) ; if ( ! Directory . Exists ( outDir ) ) { Directory . CreateDirectory ( outDir ) ; } tasks . Add ( GenerateUserElementTypeFromUriAsync ( uri , outDir ) ) ; } var allResults = await Task . WhenAll ( tasks ) ; return allResults ; }
Generate the core element types as .cs files to the specified output directory.
Generate the core element types as . cs files to the specified output directory .
outputBaseDir
string
The root directory into which generated files will be written.
The root directory into which generated files will be written .