示例#1
0
            static void PostStart(ProcessManager.IProcess process)
            {
                var proc = process.process;

                proc.BeginOutputReadLine();
                proc.BeginErrorReadLine();
            }
示例#2
0
            void PreStart(ProcessManager.IProcess process)
            {
                var proc = process.process;

                proc.OutputDataReceived += ProcessOnOutputDataReceived;
                proc.ErrorDataReceived  += ProcessOnErrorDataReceived;
                proc.Exited             += ProcessOnExited;
            }
示例#3
0
            /// <summary>Create a new compile operation.</summary>
            /// <param name="startInfo">
            /// Specific info to provide to the process generated.
            ///
            /// Some properties will be override to enable redirection of input and output streams.
            /// </param>
            /// <param name="sourceFile">Path of the source file to compile.</param>
            /// <param name="intermediateSourceFile">Path of the intermediate file to use.</param>
            /// <param name="targetFile">Path to the generated file.</param>
            /// <param name="options">Options to use for compilation.</param>
            public CompileOperation(
                ProcessStartInfo startInfo,
                FileInfo sourceFile,
                FileInfo intermediateSourceFile,
                FileInfo targetFile,
                ShaderCompilerOptions options
                )
            {
                startInfo.RedirectStandardInput  = false;
                startInfo.RedirectStandardError  = true;
                startInfo.RedirectStandardOutput = true;
                startInfo.UseShellExecute        = false;
                startInfo.CreateNoWindow         = true;

                commandLine = $"{startInfo.FileName} {startInfo.Arguments}";

                m_Process = ProcessManager.Enqueue(startInfo, PreStart, PostStart);

                this.sourceFile = sourceFile;
                this.targetFile = targetFile;
                this.options    = options;

                this.intermediateSourceFile = intermediateSourceFile;
            }
示例#4
0
 public static bool IsComplete(this ProcessManager.IProcess process)
 {
     return(process != null && process.process != null && process.hasStarted && process.process.HasExited);
 }