[Quantproject-developers] QuantProject/b2_DataAccess DataBaseLocator.cs, 1.4, 1.5
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2006-07-02 19:26:06
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2038/b2_DataAccess Modified Files: DataBaseLocator.cs Log Message: Now the database.xml file is deleted automatically when path is not valid Index: DataBaseLocator.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseLocator.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DataBaseLocator.cs 10 Aug 2005 16:46:59 -0000 1.4 --- DataBaseLocator.cs 2 Jul 2006 19:26:02 -0000 1.5 *************** *** 62,68 **** //gets full path of the file that contains the database this.Path = xmlTextReader.GetAttribute(0); ! if(!File.Exists(this.path)) ! throw new Exception("Specified file in DataBase.xml doesn't exist!\n" + ! "Delete Database.xml and retry!"); } } --- 62,73 ---- //gets full path of the file that contains the database this.Path = xmlTextReader.GetAttribute(0); ! if(!File.Exists(this.path)) ! { ! xmlTextReader.Close(); ! stream.Close(); ! File.Delete(xmlPath); ! MessageBox.Show("Specified file in DataBase.xml doesn't exist!\n\n" + ! "Retry and select again Database.mdb."); ! } } } *************** *** 74,79 **** { MessageBox.Show(ex.ToString()); ! xmlTextReader.Close(); ! stream.Close(); } } --- 79,86 ---- { MessageBox.Show(ex.ToString()); ! if(xmlTextReader != null) ! xmlTextReader.Close(); ! if(this.stream != null) ! stream.Close(); } } |