示例#1
0
        public SteamTradeHistoryItemsModel(IEnumerable <FullHistoryTradeItem> itemsList)
        {
            this.ItemsList = new ObservableCollection <FullHistoryTradeItem>(itemsList);

            this.ItemModel = itemsList.FirstOrDefault();

            this.Count = itemsList.Sum(i => int.Parse(i.Asset.Amount));

            this.ItemName = this.ItemModel?.Description.MarketName;

            this.Type = SteamUtils.GetClearItemType(this.ItemModel?.Description.Type);

            this.Description = new Lazy <string>(() => SteamUtils.GetClearDescription(this.ItemModel));
        }
示例#2
0
        public SteamTradeItemsModel(IEnumerable <FullTradeItem> itemsList)
        {
            IEnumerable <FullTradeItem> fullTradeItems = itemsList as FullTradeItem[] ?? itemsList.ToArray();

            this.ItemsList = new ObservableCollection <FullTradeItem>(fullTradeItems);

            this.ItemModel = fullTradeItems.FirstOrDefault();

            this.Count = fullTradeItems.Sum(i => int.Parse(i.Asset.Amount));

            this.ItemName = this.ItemModel?.Description.MarketName;

            this.Type = SteamUtils.GetClearItemType(this.ItemModel?.Description.Type);

            this.Description = new Lazy <string>(() => SteamUtils.GetClearDescription(this.ItemModel));
        }
        public SteamItemsModel(FullRgItem[] itemsList)
        {
            this.ItemsList = new ObservableCollection <FullRgItem>(itemsList);

            this.ItemModel = itemsList.FirstOrDefault();

            this.Count = itemsList.Select(i => int.Parse(i.Asset.Amount)).Sum();

            this.ItemName = this.ItemModel?.Description.MarketName;

            this.Game = this.ItemModel?.Description?.Tags?.FirstOrDefault(tag => tag.Category == "Game")
                        ?.LocalizedTagName;

            this.Type = SteamUtils.GetClearItemType(this.ItemModel?.Description?.Type);

            this.Description = new Lazy <string>(() => SteamUtils.GetClearDescription(this.ItemModel));

            this.NumericUpDown = new NumericUpDownModel(this.Count);
        }
示例#4
0
        public MarketRelistModel(IReadOnlyCollection <MyListingsSalesItem> itemsToSaleList)
        {
            this.ItemsList = new ObservableCollection <MyListingsSalesItem>(itemsToSaleList);

            this.Count = itemsToSaleList.Count;

            this.ItemModel = itemsToSaleList.FirstOrDefault();

            this.ItemName = this.ItemModel?.Name;

            this.Game = SteamUtils.GetClearItemType(this.ItemModel?.Game);

            this.ListedPrice = this.ItemModel?.Price;

            this.ListedDate = this.ItemModel?.Date;

            this.Description = new Lazy <string>(() => SteamUtils.GetClearDescription(this.ItemModel));

            this.Checked = new CheckedModel();

            this.RelistPrice = new PriceModel();
        }