Example #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            _breads    = BreadsStorage.ReadXML <ObservableCollection <Bread> >("breadfile.xml");
            _doughdata = doughstorage.ReadXML <ObservableCollection <doughdata> >("doughfile.xml");
            _inventory = inventorystorage.ReadXML <ObservableCollection <Inventory> >("inventoryfile.xml");



            if (_breads == null)
            {
                _breads = new ObservableCollection <Bread>();
                //_students = GenerateStudents(50);
            }
            if (_doughdata == null)
            {
                _doughdata = new ObservableCollection <doughdata>();
                //_students = GenerateStudents(50);
            }
            if (_inventory == null)
            {
                _inventory = new ObservableCollection <Inventory>();
                //_students = GenerateStudents(50);
            }
        }
Example #2
0
 private void Application_Exit(object sender, ExitEventArgs e)
 {
     BreadsStorage.WriteXml <ObservableCollection <Bread> >(_breads, "breadfile.xml");
     doughstorage.WriteXml <ObservableCollection <doughdata> >(_doughdata, "doughfile.xml");
     inventorystorage.WriteXml <ObservableCollection <Inventory> >(_inventory, "inventoryfile.xml");
 }