Ejemplo n.º 1
0
 internal void Build(ProcessArgumentBuilder builder)
 {
     if (InputFile == null)
     {
         throw new ArgumentNullException(nameof(InputFile));
     }
     if (Generator != CodeGenerator.None || GeneratorSettings != null)
     {
         if (GeneratorSettings == null)
         {
             builder.AppendSwitch(ArgumentNames.Generator, Generator.ToGeneratorName());
         }
         else
         {
             builder.AppendSwitch(ArgumentNames.Generator,
                                  Generator == CodeGenerator.None
                 ? GeneratorSettings.Generator.ToGeneratorName()
                 : Generator.ToGeneratorName());
             builder.Append(string.Join(" ",
                                        GeneratorSettings.GetArguments()
                                        .Select(
                                            p =>
                                            $"{(p.Key.StartsWith(ArgumentNames.Separator) ? string.Empty : ArgumentNames.Separator)}{p.Key} {p.Value}")));
         }
     }
     if (Namespace.IsNotEmpty())
     {
         builder.AppendSwitch(ArgumentNames.Namespace, Namespace.Quote());
     }
     if (OutputDirectory != null)
     {
         builder.AppendSwitch(ArgumentNames.OutputDir, OutputDirectory.FullPath.Quote());
     }
     if (Modeler.IsNotEmpty())
     {
         builder.AppendSwitch(ArgumentNames.Modeler, Modeler);
     }
     if (ClientName.IsNotEmpty())
     {
         builder.AppendSwitch(ArgumentNames.ClientName, ClientName);
     }
     if (PayloadFlattenThreshold.HasValue)
     {
         builder.AppendSwitch(ArgumentNames.Threshold, PayloadFlattenThreshold.Value.ToString());
     }
     if (HeaderComment.IsNotEmpty())
     {
         builder.AppendSwitch(ArgumentNames.Header, HeaderComment.Quote());
     }
     if (AddCredentials)
     {
         builder.AppendSwitch(ArgumentNames.Credentials, "true");
     }
     if (OutputFileName.IsNotEmpty())
     {
         builder.AppendSwitch(ArgumentNames.OutputFile, OutputFileName.Quote());
     }
     if (Verbose)
     {
         builder.AppendSwitch(ArgumentNames.Verbose, "true");
     }
     builder.AppendSwitch(ArgumentNames.InputFile, InputFile.FullPath.Quote());
 }