Exemplo n.º 1
0
        /// <summary>
        /// Print message to screen and cancel out any
        /// previous message.
        /// </summary>
        /// <param name="str">The string to write out.</param>
        public void Write(String str)
        {
            if (!_doWrite)
            {
                return;
            }

            int charCount = Cancel(false);

            _out.Write(str);
            _writtenString = str;

            /* wipe the difference between the previous
             * message and this one */
            int lenDiff = charCount - str.Length;

            if (lenDiff > 0)
            {
                writeChars(lenDiff, " ");
                writeChars(lenDiff, BACKSPACE);
            }
            _out.Flush();
        }
Exemplo n.º 2
0
 public void Update(long value)
 {
     if (_expectedTargetValue > 0 && value <= _expectedTargetValue)
     {
         long newDots = (_screenWidth * value) / _expectedTargetValue;
         if (newDots > _progressDots)
         {
             _etaWriter.Cancel(false);
             while (_progressDots < newDots)
             {
                 _out.Write(".");
                 ++_progressDots;
             }
             _out.Flush();
         }
         WriteEta(value);
     }
 }