C# Class Loyc.MessageSinkFromDelegate

This helper class lets you implement IMessageSink with one or two delegates (a writer method, and an optional severity filter).
Inheritance: IMessageSink
Mostra file Open project: qwertie/ecsharp Class Usage Examples

Public Methods

Method Description
IsEnabled ( Severity level ) : bool
MessageSinkFromDelegate ( WriteMessageFn writer, bool>.Func isEnabled = null ) : System

Initializes this object.

Write ( Severity level, object context, string format ) : void
Write ( Severity level, object context, string format, object arg0, object arg1 = null ) : void

Method Details

IsEnabled() public method

public IsEnabled ( Severity level ) : bool
level Severity
return bool

MessageSinkFromDelegate() public method

Initializes this object.
public MessageSinkFromDelegate ( WriteMessageFn writer, bool>.Func isEnabled = null ) : System
writer WriteMessageFn Required. A method that accepts output.
isEnabled bool>.Func Optional. A method that decides whether to /// output based on the message type. If this parameter is provided, /// then () will not invoke the writer when isEnabled /// returns false. This delegate is also called by ().
return System

Write() public method

public Write ( Severity level, object context, string format ) : void
level Severity
context object
format string
return void

Write() public method

public Write ( Severity level, object context, string format, object arg0, object arg1 = null ) : void
level Severity
context object
format string
arg0 object
arg1 object
return void