Пример #1
0
 //сериализира при затваряне на програмата
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     //xml.Serialize<List<Product>>(productsList);
     XmlService.Serialize <List <Product> >(XmlService.ListOfProducts);
 }
Пример #2
0
 //десериализира при зареждане на формата
 private void Form1_FormLoad(object sender, EventArgs e)
 {
     //productsList = xml.Deserialize<List<Product>>();
     XmlService.ListOfProducts = XmlService.Deserialize <List <Product> >();
     AddProductsToPanel();
 }