// Constructor public UserInterface() { InitializeComponent(); // NOTE: This is where we set up all the objects, // and create the various relationships between them. baggingAreaScale = new BaggingAreaScale(); scannedProducts = new ScannedProducts(); barcodeScanner = new BarcodeScanner(); looseItemScale = new LooseItemScale(); selfCheckout = new SelfCheckout(baggingAreaScale, scannedProducts, looseItemScale); barcodeScanner.LinkToSelfCheckout(selfCheckout); baggingAreaScale.LinkToSelfCheckout(selfCheckout); looseItemScale.LinkToSelfCheckout(selfCheckout); //button enabled/disabled btnUserWeighsLooseProduct.Enabled = false; btnUserPutsProductInBaggingAreaCorrect.Enabled = false; btnUserPutsProductInBaggingAreaIncorrect.Enabled = false; btnUserChooseToPay.Enabled = false; btnAdminOverridesWeight.Enabled = false; UpdateDisplay(); }
// Constructor public UserInterface() { InitializeComponent(); displayList = new List <DisplayList>(); baggingAreaScale = new BaggingAreaScale(); scannedProducts = new ScannedProducts(); barcodeScanner = new BarcodeScanner(); looseItemScale = new LooseItemScale(); selfCheckout = new SelfCheckout(baggingAreaScale, scannedProducts, looseItemScale); barcodeScanner.LinkToSelfCheckout(selfCheckout); baggingAreaScale.LinkToSelfCheckout(selfCheckout); looseItemScale.LinkToSelfCheckout(selfCheckout); UpdateDisplay(); }
public void LinkToSelfCheckout(SelfCheckout sc) { this.selfCheckout = sc; }
public void LinkToSelfCheckout(SelfCheckout selfCheckout) { this.selfCheckout = selfCheckout; }
public void LinkToSelfCheckout(SelfCheckout selfCheckout) { this.selfCheckout = selfCheckout; //reference self checkout }