AvalonStudio.Toolchains.Llilum.LlilumToolchain.TransformMSIL C# (CSharp) Method

TransformMSIL() private method

private TransformMSIL ( IConsole console, IStandardProject superProject, IStandardProject project, ISourceFile file, string outputFile ) : void
console IConsole
superProject IStandardProject
project IStandardProject
file ISourceFile
outputFile string
return void
		private void TransformMSIL(IConsole console, IStandardProject superProject, IStandardProject project, ISourceFile file,
			string outputFile)
		{
			var startInfo = new ProcessStartInfo();

			startInfo.FileName = Path.Combine(BaseDirectory, "Llilum\\ZeligBuild\\Host\\bin\\Debug",
				"Microsoft.Zelig.Compiler.exe");

			if (Path.IsPathRooted(startInfo.FileName) && !System.IO.File.Exists(startInfo.FileName))
			{
				console.WriteLine("Unable to find compiler (" + startInfo.FileName + ") Please check project compiler settings.");
			}
			else
			{
				//startInfo.WorkingDirectory = Path.Combine(BaseDirectory, "Llilum\\ZeligBuild\\Host\\bin\\Debug");

				startInfo.Arguments = string.Format("{0} -OutputName {1} {2}",
                    GetZeligCompilerArguments(superProject, project, file), outputFile, outputFile);

				// Hide console window
				startInfo.UseShellExecute = false;
				startInfo.RedirectStandardOutput = true;
				startInfo.RedirectStandardError = true;
				startInfo.CreateNoWindow = true;

				//console.WriteLine (Path.GetFileNameWithoutExtension(startInfo.FileName) + " " + startInfo.Arguments);

				using (var process = Process.Start(startInfo))
				{
					process.OutputDataReceived += (sender, e) => { console.WriteLine(e.Data); };

					process.ErrorDataReceived += (sender, e) =>
					{
						if (e.Data != null)
						{
							console.WriteLine();
							console.WriteLine(e.Data);
						}
					};

					process.BeginOutputReadLine();

					process.BeginErrorReadLine();

					process.WaitForExit();
				}
			}
		}