Example #1
0
 private void raiseEvent(Job sender, EncoderCallbackEventArgs e)
 {
     if (EncoderCallback != null)
     {
         EncoderCallback(sender, e);
     }
 }
Example #2
0
        private void setProgress(double n)
        {
            EncoderCallbackEventArgs e = new EncoderCallbackEventArgs(EncoderCallbackEventArgs.EventType.Progress);

            e.Progress = n;
            raiseEvent(m_job, e);
        }
Example #3
0
        private void readStdStream(bool bStdOut)
        {
            EncoderCallbackEventArgs e = new EncoderCallbackEventArgs(bStdOut ? EncoderCallbackEventArgs.EventType.StdOut : EncoderCallbackEventArgs.EventType.StdErr);

            using (StreamReader r = bStdOut ? m_process.StandardOutput : m_process.StandardError) {
                while (!m_process.HasExited)
                {
                    Thread.Sleep(0);
                    string text1 = r.ReadToEnd(); //r.ReadLine();
                    if (!String.IsNullOrEmpty(text1))
                    {
                        e.Message = text1;
                        raiseEvent(m_job, e);
                    }
                    Thread.Sleep(0);
                }
            }
        }