Beispiel #1
0
        /// <summary>
        /// The constructor requires a reference to the process that will be read.
        /// The process should have .RedirectStandardOutput and .RedirectStandardError set to true.
        /// </summary>
        /// <param name="process">The process that will have its output read by this class.</param>
        public ProcessOutputHandler(LauchTool _oTool)
        {
            oTool = _oTool;
            proc  = _oTool.ExeProcess;

            StdErr = "";
            StdOut = "";
            //     Debug.Assert(proc.StartInfo.RedirectStandardError, "RedirectStandardError must be true to use ProcessOutputHandler.");
            //      Debug.Assert(proc.StartInfo.RedirectStandardOutput, "RedirectStandardOut must be true to use ProcessOutputHandler.");
        }
Beispiel #2
0
        public static void fAppError(LauchTool _oThis, string _sOut)
        {
            // lock(Data.oLockError) {
            if (_oThis.dError != null)
            {
                _oThis.dError(_oThis, _sOut);
            }
            else
            {
                /*
                 * if(_sOut.Length > 3 && _sOut[3] == '%') {
                 * Console.Write( "\r\r" + _sOut.Substring(4,_sOut.Length-4) );
                 * }else { */
                Debug.fTrace(_sOut);
                // }
            }

            //}
        }
Beispiel #3
0
        public static void fAppOutput(LauchTool _oThis, string _sOut)
        {
            //       lock(Data.oLockOutPut) {

            if (_oThis.dOut != null)
            {
                _oThis.dOut(_oThis, _sOut);
            }
            else
            {
                /*
                 * if(_sOut.Length > 3 && _sOut[3] == '%') {
                 * Console.Write( "\r\r" + _sOut.Substring(4,_sOut.Length-4) );
                 * }else { */
                lock (Debug.oLockOutPut) {                                       //???
                    Debug.fTrace(_sOut);
                }
                // }
            }

            // }
        }