Пример #1
0
 private void filterOnKeywordToolStripMenuItem_Click(object sender, EventArgs e)
 {
    if (filterOnKeywordToolStripMenuItem.Text.ToLower().Contains("filter on:"))
    {
       string[] kw = toolStripMenuItem_DeleteKeyword.Text.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
       if (kw.Length >= 2)
       {
          string k = kw[1].Trim();
          long id = _keywordListCache[k];
          _database.SetWorkingFilterTable(new long[] { id });
          _filterType = EnumsAndConstants.FilterType.Custom;
          _updateThumbView(Properties.Resources.FilterQuery);
       }
    }
 }
Пример #2
0
      private void backgroundWorker_Import_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
      {
         toolStripProgressBar1.Value = 0;
         _filterType = EnumsAndConstants.FilterType.All;

         _updateThumbView();

         Dictionary<long, Image> insertList = (Dictionary<long, Image>)e.Result;
         Debug.WriteLine(insertList.Count, "insertList");

         updateKeywordList();
         dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells["thumb"];
         toggleCheckKwCheckBoxes((long)dataGridView1.CurrentRow.Cells["id"].Value);
      }
Пример #3
0
      private void showDuplicatesToolStripMenuItem_Click(object sender, EventArgs e)
      {
         if (_filterType == EnumsAndConstants.FilterType.Duplicates)
            return;

         try
         {
            _filterType = EnumsAndConstants.FilterType.Duplicates;
            pictureBox1.Image = null;
            string query = "SELECT id, thumb FROM Images WHERE (hash IN (SELECT hash FROM Images Images_1 GROUP BY hash HAVING (COUNT(hash) > 1))) ORDER BY hash";
            _updateThumbView(query);
         }
         catch
         {
         }
      }
Пример #4
0
      private void filterButton_Click(object sender, EventArgs e)
      {
         if (!_database.IsOpen())
            return;

         FilterForm form = new FilterForm();
         form.DB = _database;
         form.KWList = _keywordListCache;
         DialogResult result = form.ShowDialog(this);

         if (result == DialogResult.OK)
         {
            try
            {
               pictureBox1.Image = null;
               if (form.KWIds.Count > 0)
               {                  
                  _database.SetWorkingFilterTable(form.KWIds.ToArray());
                  _filterType = EnumsAndConstants.FilterType.Custom;                  
                  _updateThumbView(Properties.Resources.FilterQuery);
               }
               else
               {
                  _database.ClearWorkingFilterTable();
                  _filterType = EnumsAndConstants.FilterType.All;
                  _updateThumbView();
               }
            }
            catch 
            {
            }
         }
      }
Пример #5
0
      private void buttonFilterAll_Click(object sender, EventArgs e)
      {
         if (!_database.IsOpen())
            return;

         if (_filterType == EnumsAndConstants.FilterType.All)
            return;

         _filterType = EnumsAndConstants.FilterType.All;
         pictureBox1.Image = null;
         _updateThumbView();
      }
Пример #6
0
      private void buttonFilterNoKeys_Click(object sender, EventArgs e)
      {
         if (!_database.IsOpen())
            return;

         _filterType = EnumsAndConstants.FilterType.NoKeywords;
         pictureBox1.Image = null;
         string query = "SELECT id,thumb FROM Images WHERE (id NOT IN (SELECT ImageId FROM ImageKeywords))";
         _updateThumbView(query);
      }