/// <summary> /// Generate C# code. /// </summary> private void Generate() { var generatedCode = GenerateHelper(); // Create directory to generate files if (!_configuration.Verbose) { IoUtils.CreateDirectoryFromNamespace(_configuration.OutputDirectory, _configuration.Namespace); } foreach (var entry in generatedCode) { if (!_configuration.Verbose) { string saveLoc = _configuration.OutputDirectory + @"\" + entry.Key.Namespace.Replace('.', '\\') + @"\" + entry.Key.Schema.Title + ".cs"; IoUtils.GenerateFile(entry.Value, saveLoc); Console.WriteLine("Wrote " + saveLoc); } else { Console.WriteLine(entry.Value); } } }
/// <summary> /// Generate C# code. /// </summary> private void Generate() { var generatedCode = GenerateHelper(); // Create directory to generate files if (!_configuration.Verbose && _configuration.GenerateNamespaceDirectories) { IoUtils.CreateDirectoryFromNamespace(_configuration.OutputDirectory, _configuration.Namespace); } foreach (var entry in generatedCode) { if (!_configuration.Verbose) { string saveLoc = Path.Combine(_configuration.OutputDirectory, _configuration.GenerateNamespaceDirectories ? entry.Key.Namespace.Replace('.', Path.DirectorySeparatorChar) : "", entry.Key.Schema.Title + ".cs"); IoUtils.GenerateFile(entry.Value, saveLoc); Console.WriteLine("Wrote " + saveLoc); } else { Console.WriteLine(entry.Value); } } }