Click here to Skip to main content
15,891,473 members
Articles / Desktop Programming / WPF

Writing Your Own RTF Converter

Rate me:
Please Sign up or sign in to vote.
4.95/5 (234 votes)
1 Aug 2013CPOL14 min read 2.5M   40.4K   632  
An article on how to write a custom RTF parser and converter.
// -- FILE ------------------------------------------------------------------
// name       : ILogger.cs
// project    : System Framelet
// created    : Leon Poyyayil - 2005.05.03
// language   : c#
// environment: .NET 2.0
// copyright  : (c) 2004-2010 by Itenso GmbH, Switzerland
// --------------------------------------------------------------------------
using System;

namespace Itenso.Sys.Logging
{

	// ------------------------------------------------------------------------
	/// <summary>
	/// Public wrapper access to different logger implementations. All code in the
	/// framework should only use this interface. Instances can be gotten from the
	/// <see cref="Logger"/> class. This makes it easy to change the underlying
	/// logging facility without having to adapt all the using code (e.g. when
	/// switching from an own implementation to log4net or something the like).
	/// </summary>
	public interface ILogger
	{

		// ----------------------------------------------------------------------
		LoggerLevel Level { get; set; }

		// ----------------------------------------------------------------------
		bool IsDebugEnabled { get; }

		// ----------------------------------------------------------------------
		bool IsInfoEnabled { get; }

		// ----------------------------------------------------------------------
		bool IsWarnEnabled { get; }

		// ----------------------------------------------------------------------
		bool IsErrorEnabled { get; }

		// ----------------------------------------------------------------------
		bool IsFatalEnabled { get; }

		// ----------------------------------------------------------------------
		bool IsEnabledFor( LoggerLevel level );

		// ----------------------------------------------------------------------
		bool IsSupportedException( Exception exception );

		// ----------------------------------------------------------------------
		void Debug( object message );

		// ----------------------------------------------------------------------
		void Debug( object message, Exception exception );

		// ----------------------------------------------------------------------
		void DebugFormat( string format, params object[] args );

		// ----------------------------------------------------------------------
		void DebugFormat( IFormatProvider provider, string format, params object[] args );

		// ----------------------------------------------------------------------
		void Info( object message );

		// ----------------------------------------------------------------------
		void Info( object message, Exception exception );

		// ----------------------------------------------------------------------
		void InfoFormat( string format, params object[] args );

		// ----------------------------------------------------------------------
		void InfoFormat( IFormatProvider provider, string format, params object[] args );

		// ----------------------------------------------------------------------
		void Warn( object message );

		// ----------------------------------------------------------------------
		void Warn( object message, Exception exception );

		// ----------------------------------------------------------------------
		void WarnFormat( string format, params object[] args );

		// ----------------------------------------------------------------------
		void WarnFormat( IFormatProvider provider, string format, params object[] args );

		// ----------------------------------------------------------------------
		void Error( object message );

		// ----------------------------------------------------------------------
		void Error( object message, Exception exception );

		// ----------------------------------------------------------------------
		void ErrorFormat( string format, params object[] args );

		// ----------------------------------------------------------------------
		void ErrorFormat( IFormatProvider provider, string format, params object[] args );

		// ----------------------------------------------------------------------
		void Fatal( object message );

		// ----------------------------------------------------------------------
		void Fatal( object message, Exception exception );

		// ----------------------------------------------------------------------
		void FatalFormat( string format, params object[] args );

		// ----------------------------------------------------------------------
		void FatalFormat( IFormatProvider provider, string format, params object[] args );

		// ----------------------------------------------------------------------
		void Log( LoggerLevel level, object message );

		// ----------------------------------------------------------------------
		void Log( LoggerLevel level, object message, Exception exception );

		// ----------------------------------------------------------------------
		void LogFormat( LoggerLevel level, string format, params object[] args );

		// ----------------------------------------------------------------------
		void LogFormat( LoggerLevel level, IFormatProvider provider, string format, params object[] args );

		// ----------------------------------------------------------------------
		IDisposable PushContext( string context );

		// ----------------------------------------------------------------------
		int ContextDepth { get; }

		// ----------------------------------------------------------------------
		string Context { get; }

		// ----------------------------------------------------------------------
		void PopContext();

	} // interface ILogger

} // namespace Itenso.Sys.Logging
// -- EOF -------------------------------------------------------------------

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Switzerland Switzerland
👨 Senior .NET Software Engineer

🚀 My Open Source Projects
- Time Period Library 👉 GitHub
- Payroll Engine 👉 GitHub

Feedback and contributions are welcome.



Comments and Discussions