示例#1
0
        /// <summary>
        /// 删除预览
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RadButton_Click_2(object sender, RoutedEventArgs e)
        {
            if (GridScan.SelectedItems == null)
            {
                MessageBox.Show("请选择需删除的预览项!");
                return;
            }

            List <API.BookKey> list = GridScan.ItemsSource as List <API.BookKey>;

            foreach (var item in GridScan.SelectedItems)
            {
                API.BookKey bk = item as API.BookKey;
                foreach (var child in list)
                {
                    if (child == bk)
                    {
                        list.Remove(child);
                        break;
                    }
                }
            }

            GridScan.ItemsSource = list;
            GridScan.Rebind();
        }
示例#2
0
        /// <summary>
        /// 添加关键字
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RadButton_Click(object sender, RoutedEventArgs e)
        {
            //if (GridList.SelectedItem == null)
            //{
            //    MessageBox.Show("请选择需添加关键字的书籍!");
            //    return;
            //}

            if (string.IsNullOrEmpty(keys.Text))
            {
                Tool.PlayBackgAnimation(keys);
                return;
            }

            List <string>      key = keys.Text.Split("\r\n".ToCharArray()).ToList();
            List <API.BookKey> BKS = new List <API.BookKey>();

            foreach (var item in key)
            {
                if (string.IsNullOrEmpty(item))
                {
                    continue;
                }
                API.BookKey bk = new API.BookKey();
                bk.BKey = item;
                BKS.Add(bk);
            }

            GridScan.ItemsSource = BKS;
            GridScan.Rebind();
            keys.Text = string.Empty;
        }
示例#3
0
 /// <summary>
 /// 清空预览
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void RadButton_Click_1(object sender, RoutedEventArgs e)
 {
     GridScan.ItemsSource = null;
     GridScan.Rebind();
 }