This is a utility class that contains convenient static methods.
More...
|
static void | ForEach< T > (this IEnumerable< T > enumeration, Action< T > action) |
| Do something with each item in a list, collection, or enumerable More...
|
|
static string | BcdToString (int val, int decimalPlace=0, bool showLeadingZeros=false) |
| Convert 4-bit BCD nibbles to a string More...
|
|
static string | ToHexString (this byte[] ba) |
|
static void | Forget (this Task task) |
| Empty method which prevents VS from generating warnings from un-awaited calls. More...
|
|
static string | RandomString (int length) |
| Get a random string with alphanumeric characters More...
|
|
static void | Error (string message, bool fatal=false) |
| Emit an error message More...
|
|
static void | Error (Exception ex) |
| Print an error to the Debug console and throw an exception if the Settings permit More...
|
|
This is a utility class that contains convenient static methods.
◆ ForEach< T >()
static void ForEach< T > |
( |
this IEnumerable< T > |
enumeration, |
|
|
Action< T > |
action |
|
) |
| |
|
static |
Do something with each item in a list, collection, or enumerable
- Template Parameters
-
T | The type of the enumerable |
- Parameters
-
enumeration | The collection, list, etc to operate over |
action | The Action to perform on each item |
◆ BcdToString()
static string BcdToString |
( |
int |
val, |
|
|
int |
decimalPlace = 0 , |
|
|
bool |
showLeadingZeros = false |
|
) |
| |
|
static |
Convert 4-bit BCD nibbles to a string
- Parameters
-
val | The number (composed of 4-bit nibbles) to convert |
decimalPlace | Where to draw a decimal point |
showLeadingZeros | Whether to show leading zeros |
- Returns
- The string
◆ ToHexString()
static string ToHexString |
( |
this byte [] |
ba | ) |
|
|
static |
◆ Forget()
static void Forget |
( |
this Task |
task | ) |
|
|
static |
Empty method which prevents VS from generating warnings from un-awaited calls.
- Parameters
-
◆ RandomString()
static string RandomString |
( |
int |
length | ) |
|
|
static |
Get a random string with alphanumeric characters
- Parameters
-
length | The number of characters the string should have |
- Returns
- the generated string
◆ Error() [1/2]
static void Error |
( |
string |
message, |
|
|
bool |
fatal = false |
|
) |
| |
|
static |
Emit an error message
- Parameters
-
message | The error to emit |
fatal | Whether this error is fatal, and should throw an exception |
◆ Error() [2/2]
static void Error |
( |
Exception |
ex | ) |
|
|
static |
Print an error to the Debug console and throw an exception if the Settings permit
- Parameters
-
ex | The exception message to print |
The documentation for this class was generated from the following file:
- F:/Git/treehopper-sdk/NET/API/Treehopper/Utilities/Utility.cs