/// <summary>
 /// Generates code for a particular file. All dependencies must
 /// already have been resolved.
 /// </summary>
 private void Generate(FileDescriptor descriptor)
 {
     UmbrellaClassGenerator ucg = new UmbrellaClassGenerator(descriptor);
       using (TextWriter textWriter = File.CreateText(GetOutputFile(descriptor))) {
     TextGenerator writer = new TextGenerator(textWriter);
     ucg.Generate(writer);
       }
 }
 /// <summary>
 /// Generates code for a particular file. All dependencies must
 /// already have been resolved.
 /// </summary>
 private void Generate(FileDescriptor descriptor, bool duplicates)
 {
     UmbrellaClassGenerator ucg = new UmbrellaClassGenerator(descriptor);
     using (TextWriter textWriter = File.CreateText(GetOutputFile(descriptor, duplicates)))
     {
         TextGenerator writer = new TextGenerator(textWriter, options.LineBreak);
         ucg.Generate(writer);
     }
 }
 /// <summary>
 /// Generates code for a particular file. All dependencies must
 /// already have been resolved.
 /// </summary>
 private void Generate(FileDescriptor descriptor, bool duplicates, CodeGeneratorResponse.Builder response)
 {
     var code = new StringBuilder();
     var ucg = new UmbrellaClassGenerator(descriptor);
     using (StringWriter textWriter = new StringWriter(code))
     {
         TextGenerator writer = new TextGenerator(textWriter, options.LineBreak);
         ucg.Generate(writer);
     }
     response.AddFile(new CodeGeneratorResponse.Types.File.Builder
     {
         Name = GetOutputFile(descriptor, duplicates),
         Content = code.ToString(),
     }.Build());
 }
Beispiel #4
0
 /// <summary>
 /// Generates code for a particular file. All dependencies must
 /// already have been resolved.
 /// </summary>
 private void Generate(FileDescriptor descriptor)
 {
     UmbrellaClassGenerator ucg = new UmbrellaClassGenerator(descriptor);
       using (TextWriter textWriter = File.CreateText(Path.Combine(options.OutputDirectory, descriptor.CSharpOptions.UmbrellaClassname + ".cs"))) {
     TextGenerator writer = new TextGenerator(textWriter);
     ucg.Generate(writer);
       }
 }