Esempio n. 1
0
        //切换视图
        private void buttonItem17_Click(object sender, EventArgs e)
        {
            VirtualListView listViewEx1 = CurrentListView();

            if (listViewEx1 == null)
            {
                return;
            }

            bool largeicon = true;

            if (listViewEx1.View == View.LargeIcon)
            {
                largeicon = false;
            }

            if (!listViewEx1.VirtualMode)
            {
                CardDescription[] Cards = CurrentCards();
                for (int i = 0; i < listViewEx1.Items.Count; i++)
                {
                    listViewEx1.Items[i].ImageIndex = ListViewItemFactory.GetImageIndexByID(Cards[i].ID, largeicon);
                }
            }

            if (largeicon)
            {
                listViewEx1.View = View.LargeIcon;
            }
            else
            {
                listViewEx1.View = View.Details;
            }
        }
Esempio n. 2
0
        private void ShowDeckList(CardDescription[] Cards, VirtualListView listview)
        {
            ListViewItem[] resultItem = new ListViewItem[Cards.Length];
            for (int i = 0; i < Cards.Length; i++)
            {
                CardDescription card = Cards[i];

                bool largeicon = false;
                if (listViewEx1.View == View.LargeIcon)
                {
                    largeicon = true;
                }

                resultItem[i] = ListViewItemFactory.GetItemByCard(card, largeicon);
            }

            listview.BeginUpdate();
            if (listview.VirtualMode)
            {
                View v = listview.View;
                listview.View            = View.List;
                listview.VirtualListSize = Cards.Length;
                listview.View            = v;
            }
            else
            {
                listview.Items.Clear();
                listview.Items.AddRange(resultItem);
            }
            listview.EndUpdate();
        }
Esempio n. 3
0
        private void listViewEx3_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            if (FusionCards.Length == 0 || e.ItemIndex >= FusionCards.Length)
            {
                e.Item = emptyItem;
                return;
            }

            CardDescription card = FusionCards[e.ItemIndex];

            bool largeicon = false;

            if (listViewEx1.View == View.LargeIcon)
            {
                largeicon = true;
            }

            e.Item = ListViewItemFactory.GetItemByCard(card, largeicon);
        }
Esempio n. 4
0
        //切换视图
        private void buttonItem4_Click(object sender, EventArgs e)
        {
            pnSameTitle.Visible = true;
            pnSameTitle.Enabled = false;
            pnSameTitle.Update();
            listViewEx1.BeginUpdate();

            if (!listViewEx1.VirtualMode)
            {
                bool largeicon = true;
                if (listViewEx1.View == View.LargeIcon)
                {
                    largeicon = false;
                }

                for (int i = 0; i < Cards.Length; i++)
                {
                    listViewEx1.Items[i].ImageIndex = ListViewItemFactory.GetImageIndexByID(Cards[i].ID, largeicon);
                }
            }

            if (listViewEx1.View == View.Details)
            {
                listViewEx1.View = View.LargeIcon;
            }
            else if (listViewEx1.View == View.LargeIcon)
            {
                listViewEx1.View = View.Details;
            }
            else
            {
                MessageBox.Show("Error!");
            }

            listViewEx1.EndUpdate();
            pnSameTitle.Visible = false;
            pnSameTitle.Enabled = true;
        }
Esempio n. 5
0
        public void DoSearch(string queryString)
        {
            pnSameTitle.Visible = true;
            //pnSameTitle.Enabled = false;
            pnSameTitle.Update();

            CardLibrary cardLibrary = CardLibrary.GetInstance();
            string      querystring = QueryMapper.Mapper(queryString);

            string filter = QueryMapper.Mapper(GetFilter());

            if (string.Equals(queryString.Trim(), ""))
            {
                CurrentQueryString = filter;
            }
            else if (string.Equals(filter, ""))
            {
                CurrentQueryString = querystring;
            }
            else
            {
                CurrentQueryString = string.Format("+({0}) +({1})", querystring, filter);
            }

            if (CurrentQueryString.Trim().Equals(""))
            {
                Cards = cardLibrary.GetCards(sorter.GetSortFields());
            }
            else
            {
                Cards = cardLibrary.Search(CurrentQueryString, sorter.GetSortFields());
            }

            bool largeicon = false;

            if (listViewEx1.View == View.LargeIcon)
            {
                largeicon = true;
            }

            listViewEx1.BeginUpdate();
            if (listViewEx1.VirtualMode)
            {
                View v = listViewEx1.View;
                listViewEx1.View            = View.List;
                listViewEx1.VirtualListSize = Cards.Length;
                listViewEx1.View            = v;
            }
            else
            {
                listViewEx1.Items.Clear();
                for (int i = 0; i < Cards.Length; i++)
                {
                    listViewEx1.Items.Add(ListViewItemFactory.GetItemByCard(Cards[i], largeicon));
                }
                //listViewEx1.Items.AddRange(resultItem);
            }
            listViewEx1.EndUpdate();

            this.Text = "结果数:" + Cards.Length;
            CountCards();

            pnSameTitle.Visible = false;
            listViewEx1.Update();
            //pnSameTitle.Enabled = true;

            if (listViewEx1.View == View.LargeIcon && !Global.loadPicEnd)
            {
                CheckPics();
            }
        }