Exemplo n.º 1
0
 // loads from flat file
 private void LoadXML()
 {
     try
     {
         CFile oFile = new CFile(Properties.Settings.Default.FileName);
         _mCustomers = (List<CCustomer>)oFile.DeSerialize(typeof(List<CCustomer>));
         oFile = null;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
 // saves to flat file
 private void SaveXML()
 {
     try
     {
         if (_mCustomers.Count < 1)
         {
             throw new Exception("Must have at least one customer");
         }
         CFile oFile = new CFile(Properties.Settings.Default.FileName);
         oFile.Serialize(typeof(List<CCustomer>), _mCustomers.ToList());
         oFile = null;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }