Enhanced C#
Language of your choice: library documentation
|
This helper class lets you implement IMessageSink with one or two delegates (a writer method, and an optional severity filter). More...
This helper class lets you implement IMessageSink with one or two delegates (a writer method, and an optional severity filter).
Public Member Functions | |
MessageSinkFromDelegate (WriteMessageFn writer, Func< Severity, bool > isEnabled=null) | |
Initializes this object. More... | |
void | Write (Severity level, object context, string format) |
void | Write (Severity level, object context, string format, object arg0, object arg1=null) |
void | Write (Severity level, object context, string format, params object[] args) |
bool | IsEnabled (Severity level) |
Returns true if messages of the specified type will actually be printed, or false if Write(type, ...) has no effect. More... | |
Public Member Functions inherited from Loyc.IMessageSink< in in TContext > | |
void | Write (Severity level, TContext context, [Localizable] string format) |
Writes a message to the target that this object represents. More... | |
void | Write (Severity level, TContext context, [Localizable] string format, object arg0, object arg1=null) |
void | Write (Severity level, TContext context, [Localizable] string format, params object[] args) |
|
inline |
Initializes this object.
writer | Required. A method that accepts output. |
isEnabled | Optional. A method that decides whether to output based on the message type. If this parameter is provided, then Write() will not invoke the writer when isEnabled returns false. This delegate is also called by IsEnabled(). |
|
inline |
Returns true if messages of the specified type will actually be printed, or false if Write(type, ...) has no effect.
Implements Loyc.IMessageSink< in in TContext >.