Exemplo n.º 1
0
        public static void SetUp()
        {
            SQLiteConnection.CreateFile("blacklist.sqlite");
            SQLiteConnection connection = new SQLiteConnection(setConnection);
            SQLiteCommand    command    = new SQLiteCommand(createTable, connection);

            connection.Open();
            command.ExecuteNonQuery();
            connection.Close();
            BlacklistManager.OnChange();
        }
Exemplo n.º 2
0
        public static void Delete(string address)
        {
            SQLiteConnection connection = new SQLiteConnection(setConnection);

            connection.Open();
            SQLiteCommand command = new SQLiteCommand(String.Format(removeItem, address), connection);

            try {
                command.ExecuteNonQuery();
                BlacklistManager.OnChange();
            }
            catch (SQLiteException) {
                connection.Close();
                BlacklistManager.SetUp();
            }
            finally {
                connection.Close();
            }
        }