private static CSharpCommandLineArguments BuildCommandLineArguments(CompilerParameters parameters, TextWriter outputWriter) { IEnumerable <string> enumerable = CSharpCompilationArguments.BuildCommandLineArgArray(parameters); outputWriter.Write(Res.Compilation_Arguments); foreach (string current in enumerable) { outputWriter.Write(current + " "); } outputWriter.WriteLine(); enumerable = enumerable.Concat(new string[] { "SuppressNoSourceFileSpecifiedWarning" }); string currentDirectory = Environment.CurrentDirectory; string environmentVariable = Environment.GetEnvironmentVariable("LIB"); CSharpCommandLineParser @default = CSharpCommandLineParser.Default; return(@default.Parse(enumerable, currentDirectory, environmentVariable)); }
private static IEnumerable <string> BuildCommandLineArgArray(CompilerParameters parameters) { string text = CSharpCompilationArguments.BuildCommandLineArgString(parameters); char[] array = text.ToCharArray(); bool flag = false; for (int i = 0; i < array.Length; i++) { if (array[i] == '"') { flag = !flag; } if (!flag && array[i] == ' ') { array[i] = '\n'; } } IEnumerable <string> lines = new string(array).Split('\n'); return(lines.Where(str => !string.IsNullOrWhiteSpace(str))); }
private CSharpCompilationArguments(CompilerParameters parameters, bool corrected, TextWriter outputWriter) : base(parameters, CSharpCompilationArguments.BuildCommandLineArguments(parameters, outputWriter)) { }
internal CSharpCompilationArguments(CompilerParameters parameters, TextWriter outputWriter) : this(CSharpCompilationArguments.CorrectedParamaters(parameters), true, outputWriter) { }