예제 #1
0
        private void button2_ClickAsync(object sender, EventArgs e)
        {
            HitomiDataQuery query = new HitomiDataQuery();

            query.TagInclude = new List <string>();
            query.TagInclude.Add("loli");
            query.Artists = new List <string>();
            query.Artists.Add("hisasi");
            HitomiDataSearch search = new HitomiDataSearch(data);

            var result = search.Search(query);

            MessageBox.Show(result.Count.ToString());
        }
예제 #2
0
        private void bDataSearch_Click(object sender, EventArgs e)
        {
            HitomiDataQuery query = new HitomiDataQuery();

            if (tbTagInclude.Text != "")
            {
                query.TagInclude = new List <string>(tbTagInclude.Text.Split(' '));
            }
            if (tbTagExclude.Text != "")
            {
                query.TagExclude = new List <string>(tbTagExclude.Text.Split(' '));
            }
            if (tbArtists.Text != "")
            {
                query.Artists = new List <string>(tbArtists.Text.Split(' '));
            }
            if (tbTitle.Text != "")
            {
                query.Title = new List <string>(tbTitle.Text.Split(' '));
            }

            HitomiDataSearch    search = new HitomiDataSearch(hitomi_data);
            List <ListViewItem> lvil   = new List <ListViewItem>();

            foreach (var v in search.Search(query))
            {
                lvil.Add(new ListViewItem(new string[]
                {
                    v.ID.ToString(),
                    v.Name,
                    string.Join(",", v.Artists ?? Enumerable.Empty <string>()),
                    string.Join(",", v.Tags ?? Enumerable.Empty <string>())
                }));
            }
            lvSearch.Items.Clear();
            lvSearch.Items.AddRange(lvil.ToArray());

            lIndex.Text = lvil.Count + " 개의 항목이 검색됨";
        }