32
32
namespace Mono.Addins
35
/// An IProgressStatus class which writes output to the console.
34
37
public class ConsoleProgressStatus: MarshalByRefObject, IProgressStatus
43
/// Initializes a new instance
45
/// <param name="verboseLog">
46
/// Set to true to enabled verbose log
39
48
public ConsoleProgressStatus (bool verboseLog)
57
/// Initializes a new instance
59
/// <param name="logLevel">
60
/// Verbosity level. 0: not verbose, 1: normal, >1 extra verbose
47
62
public ConsoleProgressStatus (int logLevel)
49
64
this.logLevel = logLevel;
68
/// Sets the description of the current operation.
70
/// <param name="msg">
74
/// This method is called by the add-in engine to show a description of the operation being monitorized.
52
76
public void SetMessage (string msg)
81
/// Sets the progress of the operation.
83
/// <param name="progress">
84
/// A number between 0 and 1. 0 means no progress, 1 means operation completed.
87
/// This method is called by the add-in engine to show the progress of the operation being monitorized.
56
89
public void SetProgress (double progress)
94
/// Writes text to the log.
96
/// <param name="msg">
60
99
public void Log (string msg)
62
101
Console.WriteLine (msg);
105
/// Reports a warning.
107
/// <param name="message">
111
/// This method is called by the add-in engine to report a warning in the operation being monitorized.
65
113
public void ReportWarning (string message)
68
116
Console.WriteLine ("WARNING: " + message);
120
/// Reports an error.
122
/// <param name="message">
125
/// <param name="exception">
126
/// Exception that caused the error. It can be null.
129
/// This method is called by the add-in engine to report an error occurred while executing the operation being monitorized.
71
131
public void ReportError (string message, Exception exception)
73
133
if (logLevel == 0)