Name

Unit

Synopsis

This class is a simple value type used to represent a specific increment of a specific unit of measurement. The Unit class combines a numeric Value property that quantifies the size with a Type property that indicates what scale of measurement is being used. Several shared (static) methods are provided to convert a value of a specific scale to a unit. For example, you can use Percentage() to convert a percentage value to a unit that has the corresponding Type set to UnitType.Percentage.

Public Structure Unit
                  ' Public Constructors
   Public Sub New(ByVal value As Double) 
   Public Sub New(ByVal value As Double, 
        ByVal type As UnitType) 
   Public Sub New(ByVal value As Integer) 
   Public Sub New(ByVal value As String) 
   Public Sub New(ByVal value As String, 
        ByVal culture As System.Globalization.CultureInfo) 
' Public Shared Fields
   public Shared ReadOnly Empty As Unit  
' Public Instance Properties
   Public ReadOnly Property IsEmpty As Boolean  
   Public ReadOnly Property Type As UnitType  
   Public ReadOnly Property Value As Double  
' Public Shared Methods
   Public Shared Function Parse(ByVal s As String) As Unit  
   Public Shared Function Parse(ByVal s As String, 
        ByVal culture As System.Globalization.CultureInfo) As Unit  
   Public Shared Function Percentage(
        ByVal n As Double) As Unit  
   Public Shared Function Pixel(ByVal n As Integer) As Unit  
   Public Shared Function Point(ByVal n As Integer) As Unit  
   Public Shared Boolean operator Sub !=( ByVal left As Unit, ByVal right As Unit) Public Shared Boolean operator ...

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.