Class Unit
Represents a length measurement.
Inheritance
Inherited Members
Namespace: Telerik.Charting.Styles
Assembly: Telerik.WinControls.RadChart.dll
Syntax
public class Unit
Constructors
Unit()
Creates a class instance
Declaration
public Unit()
Unit(Double)
Initializes a new instance of the Unit with the specified double precision floating point number.
Declaration
public Unit(double value)
Parameters
System.Double
value
A double precision floating point number that represents the length of the Unit in pixels. |
Unit(Double, UnitType)
Initializes a new instance of the Unit with the specified double precision floating point number and the target type
Declaration
public Unit(double value, UnitType type)
Parameters
System.Double
value
A double precision floating point number that represents the length of the Unit in pixels. |
UnitType
type
Unit type |
Unit(Int32)
Initializes a new instance of the Unit with the specified 32-bit signed integer.
Declaration
public Unit(int value)
Parameters
System.Int32
value
A 32-bit signed integer that represents the length of the Unit in pixels. |
Unit(Int32, UnitType)
Initializes a new instance of the Unit with the specified 32-bit signed integer and the target type
Declaration
public Unit(int value, UnitType type)
Parameters
System.Int32
value
A 32-bit signed integer that represents the length of the Unit in pixels. |
UnitType
type
Unit type |
Unit(Single)
Initializes a new instance of the Unit with the specified double precision floating point number.
Declaration
public Unit(float value)
Parameters
System.Single
value
A float precision floating point number that represents the length of the Unit in pixels. |
Unit(Single, UnitType)
Initializes a new instance of the Unit with the specified double precision floating point number and the target type.
Declaration
public Unit(float value, UnitType type)
Parameters
System.Single
value
A float precision floating point number that represents the length of the Unit in pixels. |
UnitType
type
Unit type (Pixel / Percentage) |
Unit(String)
Initializes a new instance of the Unit with the specified length.
Declaration
public Unit(string value)
Parameters
System.String
value
A string that represents the length of the Unit. |
Unit(String, CultureInfo)
Initializes a new instance of the Unit with the specified length.
Declaration
public Unit(string value, CultureInfo culture)
Parameters
System.String
value
A string that represents the length of the Unit. |
System.Globalization.CultureInfo
culture
CultureInfo |
Unit(UnitType)
Creates a class instance
Declaration
public Unit(UnitType type)
Parameters
UnitType
type
UnitType specifies the target Unit type |
Fields
Empty
Represents an empty Unit. This field is read-only.
Declaration
public static readonly Unit Empty
Field Value
Unit
|
Properties
IsEmpty
Gets whether Unit is empty
Declaration
public bool IsEmpty { get; }
Property Value
System.Boolean
|
Type
Gets or sets the unit type of the Unit.
Declaration
public UnitType Type { get; set; }
Property Value
UnitType
|
Value
Gets or sets the length of the Unit.
Declaration
public float Value { get; set; }
Property Value
System.Single
|
Methods
Equals(Object)
Compares this Unit with the specified object.
Declaration
public override bool Equals(object obj)
Parameters
System.Object
obj
The specified object for comparison. |
Returns
System.Boolean
true if the Unit that this method is called from is equal to the specified object; otherwise, false. |
Overrides
GetHashCode()
Returns a hash code for this Unit.
Declaration
public override int GetHashCode()
Returns
System.Int32
Hash code |
Overrides
Parse(String)
Converts the specified string to a Unit.
Declaration
public static Unit Parse(string s)
Parameters
System.String
s
The string to convert. |
Returns
Unit
A Unit that represents the specified string. |
Parse(String, CultureInfo)
Declaration
public static Unit Parse(string s, CultureInfo culture)
Parameters
System.String
s
|
System.Globalization.CultureInfo
culture
|
Returns
Unit
|
Percentage(Double)
Creates a Unit of type Percentage from the specified double-precision floating-point number.
Declaration
public static Unit Percentage(double n)
Parameters
System.Double
n
A double-precision floating-point number that represents the length of the Unit |
Returns
Unit
A Unit of type Percentage that represents the length specified by the double-precision floating-point number. |
Pixel(Single)
Creates a Unit of type Pixel from the specified 32-bit signed integer.
Declaration
public static Unit Pixel(float n)
Parameters
System.Single
n
A 32-bit signed integer that represents the length of the Unit. |
Returns
Unit
A Unit of type Pixel that represents the length specified by the n parameter. |
ToString()
Base ToString override
Declaration
public override string ToString()
Returns
System.String
String representation of the Unit instance |
Overrides
ToString(CultureInfo)
Base ToString override
Declaration
public string ToString(CultureInfo culture)
Parameters
System.Globalization.CultureInfo
culture
CultureInfo |
Returns
System.String
String representation of the Unit instance |
Operators
Equality(Unit, Unit)
Compares two Unit objects to determine whether they are equal.
Declaration
public static bool operator ==(Unit left, Unit right)
Parameters
Unit
left
The Unit on the left side of the operator. |
Unit
right
The Unit on the right side of the operator. |
Returns
System.Boolean
true if both Unit objects are equal; otherwise, false. |
Implicit(Single to Unit)
Implicitly creates a Unit of type Pixel from the specified float.
Declaration
public static implicit operator Unit(float n)
Parameters
System.Single
n
A float that represents the length of the Unit. |
Returns
Unit
A Unit of type Pixel that represents the specified by the n parameter. |
Inequality(Unit, Unit)
Compares two Unit objects to determine whether they are not equal.
Declaration
public static bool operator !=(Unit left, Unit right)
Parameters
Unit
left
The Unit on the left side of the operator. |
Unit
right
The Unit on the right side of the operator. |
Returns
System.Boolean
true if the Unit objects are not equal; otherwise, false. |