コード例 #1
0
        /// <summary>
        /// Register output stream.
        /// </summary>
        /// <param name="output_stream"></param>
        public static void UnRegisterOutputStream(
            IOutputStream output_stream)
        {
            OutputStreamHost.InitializeIfNeeded();

            _output_streams.Remove(output_stream);
        }
コード例 #2
0
 /// <summary>
 /// Reports progress.
 /// </summary>
 /// <param name="progress"></param>
 /// <param name="key"></param>
 /// <param name="message"></param>
 public static void ReportProgress(double progress, string key, string message)
 {
     OutputStreamHost.InitializeIfNeeded();
     if (progress > 1)
     {
         progress = 1;
     }
     if (progress < 0)
     {
         progress = 0;
     }
     _previous_progress = progress;
     foreach (IOutputStream stream in _output_streams)
     {
         stream.ReportProgress(progress, key, message);
     }
     if (_previous_progress == 1)
     {
         foreach (IOutputStream stream in _output_streams)
         {
             stream.WriteLine(string.Empty);
         }
         _previous_progress = 0;
     }
 }
コード例 #3
0
 public void WriteLine(object someObject)
 {
     if (someObject != null)
     {
         OutputStreamHost.WriteLine(someObject.ToString());
     }
     OutputStreamHost.WriteLine();
 }
コード例 #4
0
        /// <summary>
        /// Writes text.
        /// </summary>
        /// <param name="text"></param>
        public static void Write(string text)
        {
            OutputStreamHost.InitializeIfNeeded();

            if (_previous_progress > 0)
            {
                _previous_progress = 0;
                OutputStreamHost.WriteLine();
            }

            foreach (IOutputStream stream in _output_streams)
            {
                stream.Write(text);
            }
        }
コード例 #5
0
 public void ReportProgress(double progress, string key, string message)
 {
     OutputStreamHost.ReportProgress(progress, key, message);
 }
コード例 #6
0
 public void Write(string text)
 {
     OutputStreamHost.Write(text);
 }
コード例 #7
0
 /// <summary>
 /// Writes a line.
 /// </summary>
 /// <param name="format"></param>
 /// <param name="arg"></param>
 public static void WriteLine(string format, params object[] arg)
 {
     OutputStreamHost.WriteLine(
         string.Format(format, arg));
 }
コード例 #8
0
 /// <summary>
 /// Writes a line.
 /// </summary>
 public static void WriteLine()
 {
     OutputStreamHost.WriteLine(string.Empty);
 }
コード例 #9
0
 /// <summary>
 /// Report progress.
 /// </summary>
 /// <param name="current"></param>
 /// <param name="total"></param>
 /// <param name="key"></param>
 /// <param name="message"></param>
 public static void ReportProgress(long current, long total, string key, string message)
 {
     OutputStreamHost.ReportProgress((double)current / (double)total, key, message);
 }