forked from iesmatauw/StackBuilder
/
TruckProperties.cs
74 lines (70 loc) · 2.05 KB
/
TruckProperties.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
#endregion
namespace TreeDim.StackBuilder.Basics
{
public class TruckProperties : ItemBase
{
#region Data members
private double _admissibleLoadWeight;
private double _length, _width, _height;
private Color _color = Color.Red;
#endregion
#region Constructor
public TruckProperties(Document document)
: base(document)
{
}
public TruckProperties(Document document, double length, double width, double height)
: base(document)
{
_length = length;
_width = width;
_height = height;
}
#endregion
#region Public properties
public double AdmissibleLoadWeight
{
get { return _admissibleLoadWeight; }
set { _admissibleLoadWeight = value; Modify(); }
}
public double Length
{
get { return _length; }
set { _length = value; Modify(); }
}
public double Width
{
get { return _width; }
set { _width = value; Modify(); }
}
public double Height
{
get { return _height; }
set { _height = value; Modify(); }
}
public double Volume
{
get { return _length * _width * _height; }
}
public Color Color
{
get { return _color; }
set { _color = value; Modify();}
}
#endregion
#region Object override
public override string ToString()
{
StringBuilder sBuilder = new StringBuilder();
sBuilder.Append(base.ToString());
sBuilder.Append(string.Format("TruckProperties => Length {0} Width {0} Height {0}", _length, _width, _height));
return sBuilder.ToString();
}
#endregion
}
}