diff --git a/CutList/Forms/Document.cs b/CutList/Forms/Document.cs index 5323259..1f93caa 100644 --- a/CutList/Forms/Document.cs +++ b/CutList/Forms/Document.cs @@ -11,19 +11,50 @@ namespace CutList.Forms { public class Document { + private List _partsToNest; + private List _stockBins; + public Document() { - PartsToNest = new List(); - StockBins = new List(); + _partsToNest = new List(); + _stockBins = new List(); } [JsonIgnore] - public string LastFilePath { get; private set; } + public string LastFilePath { get; internal set; } - public List PartsToNest { get; set; } + /// + /// Parts to be nested. For JSON serialization, this exposes the list. + /// For runtime use, prefer using methods to modify the collection. + /// + public List PartsToNest + { + get => _partsToNest; + set => _partsToNest = value ?? new List(); + } - public List StockBins { get; set; } + /// + /// Stock bins available. For JSON serialization, this exposes the list. + /// For runtime use, prefer using methods to modify the collection. + /// + public List StockBins + { + get => _stockBins; + set => _stockBins = value ?? new List(); + } public Tool Tool { get; set; } + + /// + /// Gets a read-only view of parts to nest. + /// + [JsonIgnore] + public IReadOnlyList PartsReadOnly => _partsToNest.AsReadOnly(); + + /// + /// Gets a read-only view of stock bins. + /// + [JsonIgnore] + public IReadOnlyList StockBinsReadOnly => _stockBins.AsReadOnly(); } } \ No newline at end of file