コード例 #1
0
 void PrepareInsert(string fileName)
 {
     lock (Lock) {
         SqliteCommand insert = Connection.CreateCommand();
         insert.CommandText = "INSERT INTO " + TableName(fileName) + " (OFFSET, USR, ISDEF) VALUES (@OFFSET, @USR, @ISDEF);";
         insert.CommandType = CommandType.Text;
         insert.Prepare();
         InsertCommands.Add(fileName, insert);
     }
 }
コード例 #2
0
 void HandleRemoval(object sender, ProjectFileEventArgs args)
 {
     lock (Lock) {
         foreach (var e in args)
         {
             using (var cmd = Connection.CreateCommand()) {
                 cmd.CommandText = "DROP TABLE " + TableName(e.ProjectFile.Name) + ";";
                 cmd.CommandType = CommandType.Text;
                 cmd.ExecuteNonQuery();
             }
             InsertCommands.Remove(e.ProjectFile.Name);
         }
     }
 }
コード例 #3
0
 public Commands(Connection conn)
 {
     File   = new FileCommands(conn);
     Insert = new InsertCommands(conn);
 }