Ejemplo n.º 1
0
 public void UnregisterModule(RegisteredModule module)
 {
     db.Execute(@"DELETE FROM RegisteredModules WHERE ComponentClass = @CompClass AND ID = @MID", new { CompClass = module.ComponentClass, MID = module.ID });
 }
Ejemplo n.º 2
0
 public RegisteredModule RegisterModule(RegisteredModule KeylessModule)
 {
     using (var trans = db.BeginTransaction())
     {
         int id = db.Query<int>(@"INSERT INTO RegisteredModules (ComponentClass, DisplayName, ExecutionClassName) VALUES (@CompClass, @DispName, @ExecClass);
         SELECT last_insert_rowid();",
             new { CompClass = KeylessModule.ComponentClass, DispName = KeylessModule.DisplayName, ExecClass = KeylessModule.ExecutionClassName }
             ).First<int>();
         foreach (var excap in KeylessModule.ExecutionCapabilities)
         {
             db.Execute(@"INSERT OR REPLACE INTO RegisteredModulesCapabilities (ClassID, Capabilities) VALUES (@CID, @Cap)", new { CID = id, Cap = excap });
         }
         foreach (var typesupp in KeylessModule.TypeSupport)
         {
             db.Execute(@"INSERT OR REPLACE INTO RegisteredModulesTypeSupport (ClassID, TypeID) VALUES (@CID, @TID)", new { CID = id, TID = typesupp });
         }
         foreach (var targsupp in KeylessModule.TargetSupport)
         {
             db.Execute(@"INSERT OR REPLACE INTO RegisteredModulesTargetSupport (ClassID, TargetType) VALUES (@CID, @TS)", new { CID = id, TS = targsupp });
         }
         trans.Commit();
         KeylessModule.ID = id;
     }
     return KeylessModule;
 }