Mono.CSharp.CSharpCodeCompiler.CompileFromSourceBatch C# (CSharp) Method

CompileFromSourceBatch() private method

private CompileFromSourceBatch ( CompilerParameters options, string sources ) : CompilerResults
options System.CodeDom.Compiler.CompilerParameters
sources string
return System.CodeDom.Compiler.CompilerResults
		private CompilerResults CompileFromSourceBatch (CompilerParameters options, string[] sources)
		{
			if (options == null) {
				throw new ArgumentNullException ("options");
			}

			if (sources == null) {
				throw new ArgumentNullException ("sources");
			}

			string[] fileNames = new string[sources.Length];

			for (int i = 0; i < sources.Length; i++) {
				fileNames[i] = GetTempFileNameWithExtension (options.TempFiles, i + ".cs");
				FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
				using (StreamWriter s = new StreamWriter (f, Encoding.UTF8)) {
					s.Write (sources[i]);
					s.Close ();
				}
				f.Close ();
			}
			return CompileFromFileBatch (options, fileNames);
		}
	}