Click here to Skip to main content
12,243,038 members (50,483 online)
Click here to Skip to main content

Stats

34.7K views
1.1K downloads
148 bookmarked
Posted

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 Wolters Kluwer Belgium
Belgium Belgium
Rudi is a Software Architect at Wolters Kluwer Belgium.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160426.1 | Last Updated 17 Jul 2013
Article Copyright 2013 by Rudi Breedenraedt
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid