public static CashManager RestoreState()
        {
            if (File.Exists(_fileName))
            {
                return(VendingMachineStateHandler.Restore <CashManager>(_fileName));
            }

            CashManager cashManager = new CashManager();

            return(cashManager);
        }
        public static VendingLogic RestoreState()
        {
            if (File.Exists(_fileName))
            {
                return(VendingMachineStateHandler.Restore <VendingLogic>(_fileName));
            }

            VendingLogic vendingLogic = new VendingLogic();

            vendingLogic.LoadProductsForSale();
            return(vendingLogic);
        }
 // + Save-restore methods
 public void SaveState()
 {
     VendingMachineStateHandler.Save <CashManager>(_fileName, this);
 }
 // + Save-restore methods
 public void SaveState()
 {
     VendingMachineStateHandler.Save <VendingLogic>(_fileName, this);
 }