SSQLE  1.0
Simple SQL Editor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties
Static Public Member Functions | Static Private Member Functions | List of all members
SSQLE.ColorExtensions Class Reference

Extension and support methods for manipulating with Color structure. More...

Static Public Member Functions

static Color FromString (string str)
 Converts a string to a Color based on its content. More...
 
static string ToSettingsString (this Color color)
 Converts color to string either using ToName or ToHexaCode. More...
 

Static Private Member Functions

static string ToHexaCode (this Color color)
 Converts a Color to hexa code to be used in settings. More...
 
static string ToName (this Color color)
 Converts color to it's name. Only Colors, which are members of KnownColor enumeration are valid. More...
 

Detailed Description

Extension and support methods for manipulating with Color structure.

Member Function Documentation

static Color SSQLE.ColorExtensions.FromString ( string  str)
static

Converts a string to a Color based on its content.

Parameters
strString to convert.
Returns
Color structure constructed from str .

Is capable of converting strings in two formats, either

  • #RRGGBB ; As HexaCode.
    See also
    ToHexaCode
    .
  • string, for which Color.FromName(string) returns valid color.
Exceptions
ArgumentExceptionIf invalid string is provided.
static string SSQLE.ColorExtensions.ToHexaCode ( this Color  color)
staticprivate

Converts a Color to hexa code to be used in settings.

Parameters
colorColor to convert.
Returns
Hexa code in format #RRGGBB, where R,G,B are hexadecimal numbers.
static string SSQLE.ColorExtensions.ToName ( this Color  color)
staticprivate

Converts color to it's name. Only Colors, which are members of KnownColor enumeration are valid.

Parameters
colorColor, which name we want to know.
Returns
Name of the color, or null if color is not member of KnownColor enumeration
static string SSQLE.ColorExtensions.ToSettingsString ( this Color  color)
static

Converts color to string either using ToName or ToHexaCode.

Parameters
colorColor to convert.
Returns
Textual representation to be used in Settings.
See also
Settings

The documentation for this class was generated from the following file: