public ChangeInfo[] GetChangesAndClear()
 {
     lock(this)
     {
         last_access = DateTime.Now;
         ChangeInfo[] result = new ChangeInfo[changes.Count];
         int i = 0;
         foreach(ChangeInfo ch in changes.Values)
             result[i++] = ch;
         changes = new Dictionary<string, ChangeInfo>();
         return result;
     }
 }
 public void AddNewData(string table_name, DateTime dt, bool del)
 {
     lock(this)
     {
         ChangeInfo ch;
         if(changes.TryGetValue(table_name, out ch))
         {
             if(del)
                 ch.HasDeletedRows = true;
         }
         else
         {
             changes[table_name] = new ChangeInfo(table_name, dt, del);
         }
     }
 }