コード例 #1
0
        public static string GetClearDescription(FullHistoryTradeItem item)
        {
            var description = item?.Description;

            if (item == null || description == null)
            {
                return(string.Empty);
            }

            var descriptionTextBuilder = new StringBuilder($"Amount: {item.Asset.Amount}{Environment.NewLine}");

            descriptionTextBuilder.Append($"Game: {description.AppId}{Environment.NewLine}");
            descriptionTextBuilder.Append($"Name: {description.MarketHashName}{Environment.NewLine}");
            descriptionTextBuilder.Append($"Type: {description.Type}{Environment.NewLine}");

            var descriptions = description.Descriptions?.Where(d => !string.IsNullOrWhiteSpace(d.Value.Trim()))
                               .ToArray();

            if (descriptions != null && descriptions.Any())
            {
                descriptionTextBuilder.Append($"Description: {string.Join(", ", descriptions.Select(d => d.Value.Trim()))}{Environment.NewLine}");
            }

            return(descriptionTextBuilder.ToString());
        }
コード例 #2
0
 public static string GetClearType(FullHistoryTradeItem item)
 {
     return(GetClearType(item.Description.Type));
 }