mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-12-01 09:51:59 -05:00
54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
namespace OpenNest
|
|
{
|
|
public enum Units
|
|
{
|
|
Inches,
|
|
Millimeters,
|
|
}
|
|
|
|
public static class UnitsHelper
|
|
{
|
|
public static string GetShortString(Units units) =>
|
|
units switch
|
|
{
|
|
Units.Inches => "in",
|
|
Units.Millimeters => "mm",
|
|
_ => string.Empty,
|
|
};
|
|
|
|
public static string GetLongString(Units units) =>
|
|
units switch
|
|
{
|
|
Units.Inches => "inches",
|
|
Units.Millimeters => "millimeters",
|
|
_ => string.Empty,
|
|
};
|
|
|
|
public static string GetShortTimeUnit(Units units) =>
|
|
units switch
|
|
{
|
|
Units.Inches => "min",
|
|
Units.Millimeters => "sec",
|
|
_ => string.Empty,
|
|
};
|
|
|
|
public static string GetLongTimeUnit(Units units) =>
|
|
units switch
|
|
{
|
|
Units.Inches => "minute",
|
|
Units.Millimeters => "second",
|
|
_ => string.Empty,
|
|
};
|
|
|
|
public static string GetShortTimeUnitPair(Units units)
|
|
{
|
|
return GetShortString(units) + "/" + GetShortTimeUnit(units);
|
|
}
|
|
|
|
public static string GetLongTimeUnitPair(Units units)
|
|
{
|
|
return GetLongString(units) + "/" + GetLongTimeUnit(units);
|
|
}
|
|
}
|
|
}
|