private static void CleanTemporaryFiles()
{
try
{
var directory = new DirectoryInfo(
Mobile.Configuration.Support.GetFilePath(Constants.TemporaryFilePath));
foreach (var file in directory.GetFiles())
{
try
{
file.Delete();
}
catch (IOException ex)
{
EventLog.Debug(new MobileException(
String.Format(
"Exception deleting temporary file '{0}'",
file), ex));
}
}
}
catch (Exception ex)
{
EventLog.Warn(new MobileException(
"Exception cleaning temporary files",
ex));
}
}