Archive Browser
Download CustomTypeConverter1.zip version 1.0.0.0, last updated 28/07/2013 (12.74 KB)
Download- md5: b750911ae2f67565a562ace5615f3f06
using System.ComponentModel;
using System.Globalization;
/*
Custom Type Converter Sample 1
http://cyotek.com/blog/creating-a-custom-typeconverter-part-1
*/
namespace CustomTypeConverter1
{
[TypeConverter(typeof(LengthConverter))]
internal class Length
{
#region Overridden Members
public override string ToString()
{
string value;
string unit;
value = this.Value.ToString(CultureInfo.InvariantCulture);
unit = this.Unit.ToString();
return string.Concat(value, unit);
}
#endregion
#region Properties
public Unit Unit { get; set; }
public float Value { get; set; }
#endregion
}
}
Donate
This software may be used free of charge, but as with all free software there are costs involved to develop and maintain.
If this site or its services have saved you time, please consider a donation to help with running costs and timely updates.
Donate