Cleanup classes.

This commit is contained in:
aj
2018-05-31 22:26:55 -04:00
parent c3f24df75e
commit 8967aa8b55
5 changed files with 102 additions and 90 deletions

42
CutToLength/UIItem.cs Normal file
View File

@@ -0,0 +1,42 @@
namespace CutToLength
{
public class UIItem
{
private string name;
public UIItem()
{
}
public string Name
{
get
{
return string.IsNullOrWhiteSpace(name) ?
GetDefaultName() :
name;
}
set
{
name = value;
}
}
public double Length { get; set; }
public double TotalLength
{
get { return Length * Quantity; }
}
public int Quantity { get; set; } = 1;
private string GetDefaultName()
{
if (Length == 0)
return "-";
return string.Format("{0}\" LG", Length);
}
}
}