Skip to content

Instantly share code, notes, and snippets.

@leegould
Created April 27, 2012 14:10
Show Gist options
  • Save leegould/2509572 to your computer and use it in GitHub Desktop.
Save leegould/2509572 to your computer and use it in GitHub Desktop.
Message Writer
using System;
namespace Utils
{
public abstract class MessageWriter
{
public Action<string, object[]> Writer { get; set; }
/// <summary>
/// If the Writer method is not null, writes the message to it.
/// </summary>
/// <param name="message">The message format.</param>
/// <param name="args">The format arguments.</param>
public void WriteMessage(string message, params object[] args)
{
if (Writer != null)
{
Writer(message, args);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment