//--------------------------------------
//               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 a pc unit.
	/// </summary>
	
	public class PcUnit:LengthUnit{
		
		public override float DisplayNumber{
			get{
				return (RawValue * 72f / (12f * PowerUI.ScreenInfo.CssPixelDpi) );
			}
		}
		
		public override string ToString(){
			return DisplayNumber+"pc";
		}
		
		public override void OnValueReady(CssLexer lexer){
			// Map to pixels:
			RawValue *= 12f * PowerUI.ScreenInfo.CssPixelDpi / 72f;
		}
		
		protected override Value Clone(){
			PcUnit result=new PcUnit();
			result.RawValue=RawValue;
			return result;
		}
		
		public override string[] PostText{
			get{
				return new string[]{"pc"};
			}
		}
		
	}
	
}



