Click here to Skip to main content
15,886,077 members
Articles / Web Development / ASP.NET

XsdTidy beautifies the Xsd.exe output *with full DocBook .NET Wrapper*

Rate me:
Please Sign up or sign in to vote.
4.89/5 (32 votes)
1 Mar 20048 min read 185.6K   2.4K   72  
Refactors the Xsd.exe classes. Shipped with a full .NET wrapper of DocBook.
using System;
using System.Reflection;
using System.Reflection.Emit;

namespace XsdTidy.Collections
{
	/// <summary>
	/// A dictionary with keys of type TypeBuilder and values of type ConstructorBuilder
	/// </summary>
	public class TypeBuilderConstructorBuilderDictionary: System.Collections.DictionaryBase
	{
		/// <summary>
		/// Initializes a new empty instance of the TypeBuilderConstructorBuilderDictionary class
		/// </summary>
		public TypeBuilderConstructorBuilderDictionary()
		{
			// empty
		}

		/// <summary>
		/// Gets or sets the ConstructorBuilder associated with the given TypeBuilder
		/// </summary>
		/// <param name="key">
		/// The TypeBuilder whose value to get or set.
		/// </param>
		public virtual ConstructorBuilder this[TypeBuilder key]
		{
			get
			{
				return (ConstructorBuilder) this.Dictionary[key];
			}
			set
			{
				this.Dictionary[key] = value;
			}
		}

		/// <summary>
		/// Adds an element with the specified key and value to this TypeBuilderConstructorBuilderDictionary.
		/// </summary>
		/// <param name="key">
		/// The TypeBuilder key of the element to add.
		/// </param>
		/// <param name="value">
		/// The ConstructorBuilder value of the element to add.
		/// </param>
		public virtual void Add(TypeBuilder key, ConstructorBuilder value)
		{
			this.Dictionary.Add(key, value);
		}

		/// <summary>
		/// Determines whether this TypeBuilderConstructorBuilderDictionary contains a specific key.
		/// </summary>
		/// <param name="key">
		/// The TypeBuilder key to locate in this TypeBuilderConstructorBuilderDictionary.
		/// </param>
		/// <returns>
		/// true if this TypeBuilderConstructorBuilderDictionary contains an element with the specified key;
		/// otherwise, false.
		/// </returns>
		public virtual bool Contains(TypeBuilder key)
		{
			return this.Dictionary.Contains(key);
		}

		/// <summary>
		/// Determines whether this TypeBuilderConstructorBuilderDictionary contains a specific key.
		/// </summary>
		/// <param name="key">
		/// The TypeBuilder key to locate in this TypeBuilderConstructorBuilderDictionary.
		/// </param>
		/// <returns>
		/// true if this TypeBuilderConstructorBuilderDictionary contains an element with the specified key;
		/// otherwise, false.
		/// </returns>
		public virtual bool ContainsKey(TypeBuilder key)
		{
			return this.Dictionary.Contains(key);
		}

		/// <summary>
		/// Determines whether this TypeBuilderConstructorBuilderDictionary contains a specific value.
		/// </summary>
		/// <param name="value">
		/// The ConstructorBuilder value to locate in this TypeBuilderConstructorBuilderDictionary.
		/// </param>
		/// <returns>
		/// true if this TypeBuilderConstructorBuilderDictionary contains an element with the specified value;
		/// otherwise, false.
		/// </returns>
		public virtual bool ContainsValue(ConstructorBuilder value)
		{
			foreach (ConstructorBuilder item in this.Dictionary.Values)
			{
				if (item == value)
					return true;
			}
			return false;
		}

		/// <summary>
		/// Removes the element with the specified key from this TypeBuilderConstructorBuilderDictionary.
		/// </summary>
		/// <param name="key">
		/// The TypeBuilder key of the element to remove.
		/// </param>
		public virtual void Remove(TypeBuilder key)
		{
			this.Dictionary.Remove(key);
		}

		/// <summary>
		/// Gets a collection containing the keys in this TypeBuilderConstructorBuilderDictionary.
		/// </summary>
		public virtual System.Collections.ICollection Keys
		{
			get
			{
				return this.Dictionary.Keys;
			}
		}

		/// <summary>
		/// Gets a collection containing the values in this TypeBuilderConstructorBuilderDictionary.
		/// </summary>
		public virtual System.Collections.ICollection Values
		{
			get
			{
				return this.Dictionary.Values;
			}
		}
	}

}

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


Written By
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).

Comments and Discussions