//--------------------------------------
//               PowerUI
//
//        For documentation or 
//    if you have any issues, visit
//        powerUI.kulestar.com
//
//    Copyright  2013 Kulestar Ltd
//          www.kulestar.com
//--------------------------------------

using System;


namespace Css.Units{
	
	/// <summary>
	/// Represents an instance of an inch unit.
	/// </summary>
	
	public class InchUnit:LengthUnit{
		
		public override float DisplayNumber{
			get{
				return (RawValue / (float)PowerUI.ScreenInfo.CssPixelDpi);
			}
		}
		
		public override string ToString(){
			return DisplayNumber+"in";
		}
		
		public override void OnValueReady(CssLexer lexer){
			// Map to pixels:
			RawValue *=(float)PowerUI.ScreenInfo.CssPixelDpi;
		}
		
		protected override Value Clone(){
			InchUnit result=new InchUnit();
			result.RawValue=RawValue;
			return result;
		}
		
		public override string[] PostText{
			get{
				return new string[]{"in"};
			}
		}
		
	}
	
}



