Click here to Skip to main content
15,896,453 members
Articles / Programming Languages / C#

Yet Another Custom Formatter

Rate me:
Please Sign up or sign in to vote.
4.80/5 (17 votes)
20 Jul 2011CPOL22 min read 24.7K   410   50  
Helper class to build formatted strings and lists. Lots of features and very quick.
using System;

namespace Framework.Exceptions
{
	/// <summary>
	/// An exception that 'cannot' happen and is just included to allow compilation.
	/// Hopefully, a future version of dotCover will allow marking of exceptions
	/// such as this and not show them as uncovered allowing 100% code coverage.
	/// e.g.
	/// A method with a switch containing cases for all possible items in an enum
	/// and which returns from each case. Something outside the switch is required
	/// to make it compile so use this exception.
	/// (unless one of the items is chosen to be default which I am not keen on)
	/// </summary>
	public class CodeShouldBeUnreachableException: Exception
	{
		public CodeShouldBeUnreachableException()
		{
		}

		public CodeShouldBeUnreachableException(string message): base(message)
		{
		}
	}
}

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) Hunton Information Systems Ltd.
United Kingdom United Kingdom
Simon Hewitt is a freelance IT consultant and is MD of Hunton Information Systems Ltd.

He is currently looking for contract work in London.

He is happily married to Karen (originally from Florida, US), has a lovely daughter Bailey, and they live in Kings Langley, Hertfordshire, UK.

Comments and Discussions