/// <summary>
/// Initializes static members of the <see cref="TempFile"/> class.
/// Any file names still listed in the database are attempted to be deleted.
/// </summary>
static TempFile()
{
lock (notInUse)
{
using (SQLiteCommand command = new SQLiteCommand("select filepath from tempfiles", FetchDbConn()))
using (SQLiteMonDataReader reader = new SQLiteMonDataReader(command.ExecuteReader()))
{
int filePathOrdinal = reader.GetOrdinal("filepath");
while (reader.Read())
{
notInUse.Add(reader.GetString(filePathOrdinal));
}
}
}
DeleteFiles();
}