Beispiel #1
0
        //장바구니 데이터 개별 선택
        private void listBox1_DoubleClick(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex < 0)
            {
                return;
            }

            tabControl1.SelectedTab = tabControl1.TabPages[2];

            panel3.Controls.Clear();

            int idx = listBox1.SelectedIndex;

            string filepath = buylist[idx].Image;

            byte[] data = new System.Net.WebClient().DownloadData(filepath);
            System.IO.MemoryStream ms = new System.IO.MemoryStream(data);
            Image img = Image.FromStream(ms);

            shopingItem item =
                new shopingItem(img, buylist[idx].Title,
                                buylist[idx].Lprice.ToString(),
                                buylist[idx].Link.ToString(),
                                this);

            this.Invoke(new MethodInvoker(
                            delegate()
            {
                panel3.Controls.Add(item);
            }
                            ));
        }
Beispiel #2
0
        //출력
        private void PlintSearchList()
        {
            panel1.Controls.Clear();
            x = 0;
            y = 0;

            Loading lo = new Loading();

            lo.Function = (() =>
            {
                for (int i = 0; i < bd.buydateList.Count; i++)
                {
                    string filepath = bd.buydateList[i].Image;
                    byte[] data = new System.Net.WebClient().DownloadData(filepath);
                    System.IO.MemoryStream ms = new System.IO.MemoryStream(data);
                    Image img = Image.FromStream(ms);

                    shopingItem item =
                        new shopingItem(img, bd.buydateList[i].Title,
                                        bd.buydateList[i].Lprice_s,
                                        bd.buydateList[i].Link.ToString(),
                                        this);

                    this.Invoke(new MethodInvoker(
                                    delegate()
                    {
                        panel1.Controls.Add(item);
                    }
                                    )
                                );

                    if (x == 0 && y == 0)
                    {
                        this.Invoke(new MethodInvoker(
                                        delegate()
                        {
                            item.Location = new System.Drawing.Point(x, y + 10);
                        }
                                        )
                                    );
                        x = item.Location.X;
                        y = item.Location.Y;
                    }
                    else
                    {
                        this.Invoke(new MethodInvoker(
                                        delegate()
                        {
                            item.Location = new System.Drawing.Point(x, y + 180);
                        }
                                        )
                                    );
                        x = item.Location.X;
                        y = item.Location.Y;
                    }

                    item.num.Text = (i + 1).ToString();
                }
            });
            lo.ShowDialog();
        }