Unit
Represents a length measurement.
Definition
Namespace:Telerik.Reporting.Charting.Styles
Assembly:Telerik.Reporting.dll
Syntax:
[TypeConverter(typeof(UnitConverter))]
public class Unit
Inheritance: objectUnit
Constructors
Creates a class instance
public Unit()
Initializes a new instance of the Unit with the specified double precision floating point number and the target type
public Unit(double value, UnitType type)
A double precision floating point number that represents the length of the Unit in pixels.
typeUnitTypeUnit type
Initializes a new instance of the Unit with the specified double precision floating point number.
public Unit(double value)
A double precision floating point number that represents the length of the Unit in pixels.
Initializes a new instance of the Unit with the specified double precision floating point number and the target type.
public Unit(float value, UnitType type)
A float precision floating point number that represents the length of the Unit in pixels.
typeUnitTypeUnit type (Pixel / Percentage)
Initializes a new instance of the Unit with the specified double precision floating point number.
public Unit(float value)
A float precision floating point number that represents the length of the Unit in pixels.
Initializes a new instance of the Unit with the specified 32-bit signed integer and the target type
public Unit(int value, UnitType type)
A 32-bit signed integer that represents the length of the Unit in pixels.
typeUnitTypeUnit type
Initializes a new instance of the Unit with the specified 32-bit signed integer.
public Unit(int value)
A 32-bit signed integer that represents the length of the Unit in pixels.
Initializes a new instance of the Unit with the specified length.
public Unit(string value, CultureInfo culture)
A string that represents the length of the Unit.
cultureCultureInfoCultureInfo
Initializes a new instance of the Unit with the specified length.
public Unit(string value)
A string that represents the length of the Unit.
Creates a class instance
Fields
Properties
IsEmpty
bool
Gets whether Unit is empty
public bool IsEmpty { get; }
Value
float
Gets or sets the length of the Unit.
public float Value { get; set; }
Methods
Compares this Unit with the specified object.
public override bool Equals(object obj)
The specified object for comparison.
Returns:bool
true if the Unit that this method is called from is equal to the specified object; otherwise, false.
Overrides:
Returns a hash code for this Unit.
public override int GetHashCode()
int
Hash code
Overrides:
public static Unit Parse(string s, CultureInfo culture)
Converts the specified string to a Unit.
public static Unit Parse(string s)
The string to convert.
Returns:A Unit that represents the specified string.
Creates a Unit of type Percentage from the specified double-precision floating-point number.
public static Unit Percentage(double n)
A double-precision floating-point number that represents the length of the Unit
Returns:A Unit of type Percentage that represents the length specified by the double-precision floating-point number.
Creates a Unit of type Pixel from the specified 32-bit signed integer.
public static Unit Pixel(float n)
A 32-bit signed integer that represents the length of the Unit.
Returns:A Unit of type Pixel that represents the length specified by the n parameter.
Base ToString override
public override string ToString()
string
String representation of the Unit instance
Overrides:
Base ToString override
public string ToString(CultureInfo culture)
CultureInfo
Returns:string
String representation of the Unit instance
Operators
Implicitly creates a Unit of type Pixel from the specified float.
public static implicit operator Unit(float n)
A float that represents the length of the Unit.
Returns:A Unit of type Pixel that represents the specified by the n parameter.
Compares two Unit objects to determine whether they are not equal.
Compares two Unit objects to determine whether they are equal.