Пример #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);
 }