2using System.Xml.Serialization;
16[XmlType(TypeName =
"componentRequirement")]
19 private int _parentItemId;
20 private int _componentItemId;
21 private int _quantity;
62 [XmlAttribute(
"parentItemId")]
71 throw new ArgumentOutOfRangeException(
74 "The parent item identifier cannot be negative.");
78 SetProperty(ref _parentItemId, value);
87 [XmlAttribute(
"componentItemId")]
90 get => _componentItemId;
96 throw new ArgumentOutOfRangeException(
99 "The component item identifier cannot be negative.");
103 SetProperty(ref _componentItemId, value);
113 [XmlAttribute(
"quantity")]
122 throw new ArgumentOutOfRangeException(
125 "The component quantity cannot be negative.");
129 SetProperty(ref _quantity, value);
Base class for model objects that notify listeners when one of their properties changes.
int ParentItemId
Gets or sets the identifier of the item being manufactured.
ComponentRequirement(int parentItemId, int componentItemId, int quantity)
Initializes a bill-of-materials relationship.
int ComponentItemId
Gets or sets the identifier of the required component.
ComponentRequirement()
Initializes an empty component requirement.
int Quantity
Gets or sets the quantity of the component required to manufacture one unit of the parent item.