Table of Contents

Class Helpers

Namespace
BlueM.Wave
Assembly
Wave.dll
[StandardModule]
public sealed class Helpers
Inheritance
Helpers
Inherited Members

Properties

CurrentDateFormat

Returns the current date time format as set by the operating system

public static string CurrentDateFormat { get; }

Property Value

string

CurrentListSeparator

Returns the list separator as set by the operating system (e.g. "," or ";")

public static string CurrentListSeparator { get; }

Property Value

string

CurrentNumberFormat

Returns the number format as set by the operating system

public static NumberFormatInfo CurrentNumberFormat { get; }

Property Value

NumberFormatInfo

DateFormats

Date formats

public static Dictionary<string, string> DateFormats { get; }

Property Value

Dictionary<string, string>

Dictionary of available DateFormats

Remarks

DefaultEncoding

Default Encoding (as set by the operating system, usually ISO-8859-1)

public static Encoding DefaultEncoding { get; }

Property Value

Encoding

DefaultNumberFormat

Default NumberFormat

public static NumberFormatInfo DefaultNumberFormat { get; }

Property Value

NumberFormatInfo

NumberFormatInfo instance with decimal separator "." and no NumberGroupSeparator

Methods

CalendarMonths()

Returns a list of calendar months from January to December

public static List<Month> CalendarMonths()

Returns

List<Month>

GetRelativePath(string, string)

Creates a relative path from one file or folder to another.

public static string GetRelativePath(string fromPath, string toPath)

Parameters

fromPath string

Contains the directory that defines the start of the relative path.

toPath string

Contains the path that defines the endpoint of the relative path.

Returns

string

The relative path from the start directory to the end path.

Remarks

This function is a replacement for IO.Path.GetRelativePath() which is only available in later .NET versions. Based on C# code from https://stackoverflow.com/a/32113484

Exceptions

ArgumentNullException

fromPath or toPath is null.

UriFormatException
InvalidOperationException

StringToDouble(string, NumberFormatInfo)

Converts a string to a double

public static double StringToDouble(string str, NumberFormatInfo format = null)

Parameters

str string

string to be converted

format NumberFormatInfo

optional NumberFormatInfo object to use for the conversion. If not provided, the DefaultNumberInfo is used.

Returns

double

Double value, set to NaN if the string was not parseable. NaN and +-Infinity in the input string are recognized and converted to the correspoing Double value.

getColorPalette(string)

Returns a specified color palette

public static Color[] getColorPalette(string name = "Material")

Parameters

name string

Available color palettes are "Material", "Distinct", "Color Wheel" and "Random". Defaults to "Material".

Returns

Color[]

A color palette