예제 #1
0
        public FormGameItem(Item item)
        {
            InitializeComponent();

            _item = (GameItem)item;

            labelName.Text    += _item.Name;
            labelWear.Text    += _item.Wear;
            labelQuality.Text += _item.Rarity;
        }
예제 #2
0
        void listBoxReceave_DrawItem(object sender, DrawItemEventArgs e)

        {
            if (e.Index < 0)
            {
                return;
            }

            e.DrawBackground();
            e.DrawFocusRectangle();

            Color c = Color.Gray;

            GameItem selectedItem = null;

            if (listBoxReceave.Items[e.Index].GetType().Name == "GameItem")
            {
                selectedItem = (GameItem)listBoxReceave.Items[e.Index];
                c            = selectedItem.Color;
            }

            e.Graphics.DrawString(listBoxReceave.Items[e.Index].ToString(), new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold), new SolidBrush(c), e.Bounds);
        }
예제 #3
0
        private void refreshListings()
        {
            listView1.Items.Clear();

            _availableListings.Sort((a, b) => a.Price.CompareTo(b.Price));

            foreach (Listing v in _availableListings)
            {
                if (v.Item.Name.StartsWith(textBoxSearch.Text))
                {
                    GameItem item = (GameItem)v.Item;

                    listView1.Items.Add(new ListViewItem(
                                            new string[] {
                        v.ID.ToString(),
                        item.Name,
                        item.Rarity.ToString(),
                        item.Wear.ToString(),
                        _users[v.UserID].Name,
                        v.Price.ToString()
                    }));
                }
            }
        }