Enhanced C#
Language of your choice: library documentation
Properties | Public Member Functions | List of all members
Loyc.MessageMulticaster< TContext > Class Template Reference

A message sink that sends its messages to a list of other sinks. More...


Source file:
Inheritance diagram for Loyc.MessageMulticaster< TContext >:
Loyc.IMessageSink< TContext > Loyc.IMessageSink< in in TContext >

Remarks

A message sink that sends its messages to a list of other sinks.

Alias for MessageSplitter<object>.

Null elements are allowed in the List and are ignored.

Properties

IList< IMessageSink< TContext > > List [get]
 

Public Member Functions

 MessageMulticaster (IEnumerable< IMessageSink< TContext >> targets)
 
 MessageMulticaster (params IMessageSink< TContext >[] targets)
 
void Write (Severity level, TContext context, string format)
 Writes a message to the target that this object represents. More...
 
void Write (Severity level, TContext context, string format, object arg0, object arg1=null)
 
void Write (Severity level, TContext context, string format, params object[] args)
 
bool IsEnabled (Severity level)
 Returns true if s.IsEnabled(type) is true for at least one target message sink 's'. More...
 
 MessageMulticaster (IEnumerable< IMessageSink< object >> targets)
 
 MessageMulticaster (params IMessageSink< object >[] targets)
 
- Public Member Functions inherited from Loyc.IMessageSink< 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)
 
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...
 

Member Function Documentation

◆ IsEnabled()

bool Loyc.MessageMulticaster< TContext >.IsEnabled ( Severity  level)
inline

Returns true if s.IsEnabled(type) is true for at least one target message sink 's'.

Implements Loyc.IMessageSink< in in TContext >.

◆ Write()

void Loyc.MessageMulticaster< TContext >.Write ( Severity  level,
TContext  context,
string  format 
)
inline

Writes a message to the target that this object represents.

Parameters
levelSeverity or importance of the message; widely-used types include Error, Warning, Note, Debug, and Verbose. The special type Detail is intended to provide more information about a previous message.
contextAn object that the message is related to, or that represents the location that the message applies to. The message sink may try to convert this object to a string and include it in its output. See also MessageSink.ContextToString().
formatA message to display. If there are additional arguments, placeholders such as {0} and {1} refer to these arguments.

Implements Loyc.IMessageSink< in in TContext >.