Click here to Skip to main content
12,822,497 members (49,557 online)
Click here to Skip to main content

Stats

41.2K views
1.2K downloads
148 bookmarked
Posted 25 Jun 2013

Working with Units and Amounts

, 17 Jul 2013 CPOL
The ultimate Unit and Amount classes for your business and physics applications!
using System;

namespace TypedUnits
{
	/// <summary>
	/// Attribute to mark classes having static unit fields to be registered
	/// by the UnitManager's RegisterUnits method.
	/// </summary>
	/// <see cref="UnitManager.RegisterUnits(System.Reflection.Assembly)"/>
	[AttributeUsage(AttributeTargets.Class)]
	public class UnitDefinitionClassAttribute : Attribute
	{
	}

	/// <summary>
	/// Attribute to mark classes having static methods that register
	/// conversion functions. The UnitConvert class uses this attribute to
	/// identify classes with unit conversion methods in its RegisterConversions
	/// method.
	/// </summary>
	/// <see cref="UnitManager.RegisterConversions(System.Reflection.Assembly)"/>
	[AttributeUsage(AttributeTargets.Class)]
	public class UnitConversionClassAttribute : Attribute
	{
	}
}

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)

Share

About the Author

Rudi Breedenraedt
Architect RealDolmen
Belgium Belgium
Rudi is a Software Architect at RealDolmen.

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170308.1 | Last Updated 17 Jul 2013
Article Copyright 2013 by Rudi Breedenraedt
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid