[]
Encapsulates a value for a CSSProperty.
public struct CSSValue
When callign any of the Get...Value() properties the current unit type must be valid. Ensure the unit type is valid using CSSValue.Unit.
Name | Description |
---|---|
CSSValue(eCSSUnit) | Constructs the class with the specified unit type. |
CSSValue(eCSSUnit, Color, string) | Constructs the class with the specified color. |
CSSValue(int, eCSSUnit) | Constructs the class with the specified unit type, and integer value. |
CSSValue(float, eCSSUnit) | Constructs the class with the specified unit type, and value. |
CSSValue(string, eCSSUnit) | Constructs the class with the specified unit type, and string value. |
Name | Description |
---|---|
Unit | Gets/sets the Unit value. |
Name | Description |
---|---|
CopyFrom(CSSValue) | Performs a "deep copy" (memebers and child memebers) the specified CSSValue to this CSSValue instance. |
Equals(object) | Override of System.Object.Equals(). Checks for value equality of the Unit and actual Value contained in this object. |
GetColorValue() | Returns the current color value as a Color object. If the current unit type is string it will be converted using ColorTranslator.FromHtml(). If the current value is a Color it is returned directly. |
GetFloatValue() | Returns a value as a float. |
GetHashCode() | Provides a hashcode by XORing the Unit.GetHashCode() and {value}.GetHashCode(). |
GetIntValue() | Returns an integer value. |
GetLengthPixels(float) | Returns a length value in pixel units. |
GetLengthTwips(float) | Returns a length value in twip units. |
GetPercentValue() | Returns the current percent value as a float. |
GetStringValue() | Returns the current string value. |
IsAngularUnit() | Returns true if the unit type is currently a valid Angle unit. |
IsColorUnit() | Returns true if the unit type is current a valid color unit (eCSSUnit.Color_Hex or eCSSUnit.Color_Name or eCSSUnit.Color_RGBFunc or eCSSUnit.Color_System). |
IsFixedLengthUnit() | Returns true if the unit type is currently a valid fixed length unit. |
IsFrequencyUnit() | Returns true if the current unit type is a valid Frequency unit. |
IsLengthUnit() | Returns true if the unit type is currently a valid length unit (fixed or relative). |
IsRelativeLengthUnit() | Returns true if the unit type is currently a valid relative length unit. |
IsTimeUnit() | Returns true if the current unit type is a valid time unit. |
Reset() | Resets this current value. Sets all value members to their appropriate empty equivelent (numbers are set to 0), and sets the current Unit type to eCSSUnit.Null. |
SetAutoValue() | Specifies that this CSSValue's value is the CSS keyword 'auto'. |
SetColorValue(eCSSUnit, Color, string) | Specifies this class's current value as a System.Drawing.Color object. Will set the Unit value to eCSSUnit.Color. |
SetFloatValue(float, eCSSUnit) | Specifies this current value as a float. |
SetInheritValue() | Indicates that this value is not null, not none, but should be inherited from the
parent object of the object who's style this value is applied to. |
SetIntValue(int, eCSSUnit) | Specifies the value as an integer. |
SetNoneValue() | Sets this class's value to the special CSS value 'none' (e.g. border properties, background-image, display, etc...). |
SetNormalValue() | Sets this class'es value to the special CSS value 'normal'. (e.g. font-style, font-variant, font-weight, word-spacing, letter-spacing, line-height). |
SetPercentValue(float) | Specifies the value as a percent. |
SetStringValue(string, eCSSUnit) | Specifies this class's current value as a string. |
ToDebugString() | Writes out the current unit type and value in a string formatted appropriately for debugging purposes. |
ToString() | Writes out this class's current value in string form. |
Name | Description |
---|---|
operator ==(CSSValue, CSSValue) | After checking arguments for null, uses valA.Equals(valB). |
operator !=(CSSValue, CSSValue) | After checking both arguments for null, uses !valA.Equals(valB). If either argument is null, true will be returned. |