Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » Attributes » Downloads
 
Add your own
alternative version
Go to top

Make NDoc compile the code examples contained in your documentation using NLiterate

, 26 Apr 2004
An utility that merges and recompiles the examples in your documentation using NDoc.
// The MIT License
// Copyright (c) 2004 Jonathan de Halleux
//
// Permission is hereby granted, free of charge, to any person obtaining a 
// copy of this software and associated documentation files (the "Software"), 
// to deal in the Software without restriction, including without limitation 
// the rights to use, copy, modify, merge, publish, distribute, sublicense, 
// and/or sell copies of the Software, and to permit persons to whom the 
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in 
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
// DEALINGS IN THE SOFTWARE.

using System;

namespace NLiterate
{
	/// <summary>
	/// Event data containing a <see cref="CodeSnippet"/>.
	/// </summary>
	public class CodeSnippetEventArgs : EventArgs
	{
		private CodeSnippet snippet;

		/// <summary>
		/// Initializes a new instance of the <see cref="CodeSnippetEventArgs"/>
		/// class with a snippet.
		/// </summary>
		/// <param name="snippet">Snippet to attach to the class</param>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="snippet"/> is a null reference (Nothing in 
		/// Visual Basic)
		/// </exception>
		public CodeSnippetEventArgs(CodeSnippet snippet)
		{
			if (snippet==null)
				throw new ArgumentNullException("snippet");
			this.snippet = snippet;
		}

		/// <summary>
		/// Gets the <see cref="CodeSnippet"/> instance attached to the class.
		/// </summary>
		/// <value>
		/// The <see cref="CodeSnippet"/> instance attached.
		/// </value>
		public CodeSnippet Snippet
		{
			get
			{
				return this.snippet;
			}
		}
	}

	/// <summary>
	/// Delegate for <see cref="CodeSnippetEventArgs"/>.
	/// </summary>
	/// <param name="sender">
	/// object that raised the event
	/// </param>
	/// <param name="e">
	/// <see cref="CodeSnippetEventArgs"/> instance.
	/// </param>
	public delegate void CodeSnippetEventHandler(
		Object sender, 
		CodeSnippetEventArgs e);
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Jonathan de Halleux
Engineer
United States United States
Jonathan de Halleux is Civil Engineer in Applied Mathematics. He finished his PhD in 2004 in the rainy country of Belgium. After 2 years in the Common Language Runtime (i.e. .net), he is now working at Microsoft Research on Pex (http://research.microsoft.com/pex).

| Advertise | Privacy | Mobile
Web01 | 2.8.140922.1 | Last Updated 27 Apr 2004
Article Copyright 2004 by Jonathan de Halleux
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid