DekGenius.com
[ Team LiB ] Previous Section Next Section

Unit

System.Web.UI.WebControls (system.web.dll)struct

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 struct Unit {
// Public Constructors
   public Unit(double value);
   public Unit(double value, UnitType type);
   public Unit(int value);
   public Unit(string value);
   public Unit(string value, System.Globalization.CultureInfo culture);
// Public Static Fields
   public static readonly Unit Empty;
// Public Instance Properties
   public bool IsEmpty{get; }
   public UnitType Type{get; }
   public double Value{get; }
// Public Static Methods
   public static Unit Parse(string s);
   public static Unit Parse(string s, System.Globalization.CultureInfo culture);
   public static Unit Percentage(double n);
   public static Unit Pixel(int n);
   public static Unit Point(int n);
   public static bool operator !=(Unit left,         Unit right);
   public static bool operator =  =(Unit left,         Unit right);
   public static implicit operator Unit(int n);
// Public Instance Methods
   public override bool Equals(object obj);        // overrides ValueType
   public override int GetHashCode( );               // overrides ValueType
   public override string ToString( );               // overrides ValueType
   public string ToString(System.Globalization.CultureInfo culture);
}

Hierarchy

System.Object System.ValueType Unit

Returned By

FontUnit.Unit, Style.{BorderWidth, Height, Width}, WebControl.{BorderWidth, Height, Width}

Passed To

FontUnit.FontUnit( ), Style.{BorderWidth, Height, Width}, WebControl.{BorderWidth, Height, Width}

    [ Team LiB ] Previous Section Next Section