public static void UpdateItemImageOnPanelAsync(RgDescription description, Panel imageBox)
 {
     UpdateImageOnItemPanelAsync(
         description.MarketHashName,
         $"https://steamcommunity-a.akamaihd.net/economy/image/{description.IconUrl}/192fx192f",
         imageBox);
 }
Beispiel #2
0
        public static void UpdateItemDescription(
            RgDescription description,
            RichTextBox textBox,
            Panel imageBox,
            Label label)
        {
            TradeSendControl.LastSelectedItemDescription = description;

            UpdateItemTextDescription(description, textBox, label);
            ImageUtils.UpdateItemImageOnPanelAsync(description, imageBox);
        }
Beispiel #3
0
        private void ItemsToSaleGridViewCurrentCellChanged(object sender, EventArgs e)
        {
            try
            {
                var cell = this.ItemsToTradeGridView.CurrentCell;
                if (cell == null)
                {
                    return;
                }

                var row = cell.RowIndex;
                if (row < 0)
                {
                    return;
                }

                int rowIndex;
                if (this.ItemsToTradeGridView.SelectedRows.Count > 1)
                {
                    rowIndex = this.ItemsToTradeGridView.SelectedRows[this.ItemsToTradeGridView.SelectedRows.Count - 1]
                               .Cells[0].RowIndex;
                }
                else
                {
                    rowIndex = row;
                }

                ItemsToSaleGridUtils.RowClick(
                    this.ItemsToTradeGridView,
                    row,
                    AllDescriptionsDictionary,
                    this.AllSteamItemsToTradeGridView,
                    this.ItemDescriptionTextBox,
                    this.ItemImageBox,
                    this.ItemNameLable);

                var list = ItemsToSaleGridUtils.GetFullRgItems(this.ItemsToTradeGridView, rowIndex);
                if (list != null && list.Count > 0)
                {
                    LastSelectedItemDescription = list[0].Description;
                }
            }
            catch (Exception ex)
            {
                Logger.Critical(ex);
            }
        }
Beispiel #4
0
        public void AllSteamItemsGridViewCurrentCellChanged(object sender, EventArgs e)
        {
            try
            {
                var cell = this.AllSteamItemsGridView.CurrentCell;
                if (cell == null)
                {
                    return;
                }

                var row = cell.RowIndex;
                if (row < 0)
                {
                    return;
                }

                int rowIndex;
                if (this.AllSteamItemsGridView.SelectedRows.Count > 1)
                {
                    rowIndex = this.AllSteamItemsGridView
                        .SelectedRows[this.AllSteamItemsGridView.SelectedRows.Count - 1].Cells[0].RowIndex;
                }
                else
                {
                    rowIndex = this.AllSteamItemsGridView.CurrentCell.RowIndex;
                }

                this.allItemsListGridUtils.UpdateItemDescription(
                    rowIndex,
                    this.ItemDescriptionTextBox,
                    this.ItemImageBox,
                    this.ItemNameLable);

                var list = this.allItemsListGridUtils.GetRowItemsList(rowIndex);
                if (list != null && list.Count > 0)
                {
                    LastSelectedItemDescription = list[0].Description;
                }
            }
            catch (Exception ex)
            {
                Logger.Critical($"Error on 'Market sell' - 'All items grid' current cell changed", ex);
            }
        }
Beispiel #5
0
        private static void UpdateItemTextDescription(RgDescription description, RichTextBox textBox, Control label)
        {
            textBox.Clear();

            label.Text = description.Name;

            var descriptionText = string.Empty;

            if (description.Descriptions != null)
            {
                foreach (var item in description.Descriptions)
                {
                    var text = item.Value.Trim();
                    if (!string.IsNullOrWhiteSpace(text))
                    {
                        descriptionText += text + ", ";
                    }
                }

                if (descriptionText.EndsWith(", "))
                {
                    descriptionText = descriptionText.Substring(0, descriptionText.Length - 2);
                }
            }

            var tagsText = string.Empty;

            if (description.Tags != null)
            {
                foreach (var item in description.Tags)
                {
                    var text = item.LocalizedTagName.Trim();
                    if (!string.IsNullOrWhiteSpace(text))
                    {
                        tagsText += text + ", ";
                    }
                }

                if (tagsText.EndsWith(", "))
                {
                    tagsText = tagsText.Substring(0, tagsText.Length - 2);
                }
            }

            CommonUtils.AppendBoldText(textBox, "Game: ");
            textBox.AppendText(description.Appid + "\n");

            CommonUtils.AppendBoldText(textBox, "Name: ");
            textBox.AppendText(description.MarketHashName + "\n");

            CommonUtils.AppendBoldText(textBox, "Type: ");
            textBox.AppendText(description.Type);

            if (!string.IsNullOrWhiteSpace(descriptionText))
            {
                textBox.AppendText("\n");
                CommonUtils.AppendBoldText(textBox, "Description: ");
                textBox.AppendText(descriptionText);
            }

            if (!string.IsNullOrWhiteSpace(tagsText))
            {
                textBox.AppendText("\n");
                CommonUtils.AppendBoldText(textBox, "Tags: ");
                textBox.AppendText(tagsText);
            }
        }