This class contains a large amount of useful conversions
More...
This class contains a large amount of useful conversions
◆ ConvertToBool()
| static bool Advanced_Software_Engineering.Verbs.Value.ValueHelper.ConvertToBool |
( |
string |
text | ) |
|
|
static |
Convert to boolean
- Parameters
-
- Returns
- boolean representation of the text
◆ ConvertToDouble()
| static double Advanced_Software_Engineering.Verbs.Value.ValueHelper.ConvertToDouble |
( |
string |
text | ) |
|
|
static |
Converts string to double (if possible)
- Parameters
-
| text | String to be converted to double |
- Returns
- Double representation of string
◆ ConvertToInt()
| static int Advanced_Software_Engineering.Verbs.Value.ValueHelper.ConvertToInt |
( |
string |
text | ) |
|
|
static |
Converts string to int (if possible)
- Parameters
-
| text | String to be converted to int |
- Returns
- Integer representation of string
◆ ConvertToIValue()
| static IValue Advanced_Software_Engineering.Verbs.Value.ValueHelper.ConvertToIValue |
( |
string |
text, |
|
|
ValueStorage |
storage = null |
|
) |
| |
|
static |
Converts the text to IValue
- Parameters
-
| text | text to convert |
| storage | storage to use (can be null) (optional) |
- Returns
- An IValue representation of the text
◆ ConvertToPoint()
| static Point Advanced_Software_Engineering.Verbs.Value.ValueHelper.ConvertToPoint |
( |
string |
text1, |
|
|
string |
text2 |
|
) |
| |
|
static |
Converts two strings to a point object.
- Parameters
-
| text1 | X parameter |
| text2 | Y parameter |
- Returns
- A Point object
<todo>Make unit tests for this function</todo>
◆ IntsToColor()
| static Color Advanced_Software_Engineering.Verbs.Value.ValueHelper.IntsToColor |
( |
int |
r, |
|
|
int |
g, |
|
|
int |
b, |
|
|
int |
a = 255 |
|
) |
| |
|
static |
Generate a color from RGB(A) int values
- Parameters
-
| r | Red |
| g | Green |
| b | Blue |
| a | Optional: Alpha/Transparancy (default is 255, 0 is transparent) |
- Returns
◆ TextToColor()
| static Color Advanced_Software_Engineering.Verbs.Value.ValueHelper.TextToColor |
( |
string |
text | ) |
|
|
static |
This function convers text to Color.
It can parse several different types of strings. Types of string accepted:
- A string that is the name of a predefined color. See Color class for full list.
- A string that represents a Hex Triplet (). See .
- A string that represents a Hex Quadruplet (, where represents alpha).
Color tmp = TextToColor("red"); Console.WriteLine("Name: " + tmp.toString()) //=> "red"
tmp = TextToColor("deadbe"); Console.WriteLine("Name: " + tmp.toString()) //=> "00deadbe"
//It's important to remember that C# doesn't work like HTML colors, putting alpha first, rather than last.
tmp = TextToColor("deadbeef"); Console.WriteLine("Name: " + tmp.toString()) //=> "efdeadbe"
- Parameters
-
| text | a string with a valid name or format |
- Returns
- color of the string
The documentation for this class was generated from the following file:
- Advanced Software Engineering/Verbs/Value/ValueHelper.cs