--- xmlTools/posUpdate/Util.cs 2013/03/21 10:40:39 711 +++ xmlTools/trunk/posUpdate/Util.cs 2013/03/26 02:30:48 742 @@ -18,15 +18,15 @@ namespace xmlTools /// static public bool backupFile(string file) { - //try - //{ - // System.IO.File.Copy(file, file + ".bak", false); //make a backup first //false is to not override already created backups - //} - //catch (Exception e) - //{ - // Program.printAppError(Program.appErrors.BACKUPS_ALREADY_EXISTS, "Couldn't backup file " + file + " :\n" + e.Message); - // return false; - //} + try + { + System.IO.File.Copy(file, file + ".bak", false); //make a backup first //false is to not override already created backups + } + catch (Exception e) + { + Program.printAppError(Program.appErrors.BACKUPS_ALREADY_EXISTS, "Couldn't backup file " + file + " :\n" + e.Message); + return false; + } return true; } @@ -136,5 +136,10 @@ namespace xmlTools { return Type.GetType("Mono.Runtime") != null; } + + public static bool ContainsIgnoreCase(string source, string sToSearch) + { + return source.IndexOf(sToSearch, StringComparison.OrdinalIgnoreCase) >= 0; + } } }