예제 #1
0
        /// <summary>
        /// Creates a new instance of the <see cref="Rift.ItemDialog"/> class.
        /// </summary>
        public ItemDialog(ShopItem item, GameAccount account)
        {
            InitializeComponent();

            this.item    = item;
            this.account = account;

            labelAccountValue.Text      = account.Name;
            labelTitle.Text             = item.Title;
            labelTitle.LinkColor        = QualityColorHelper.GetForeColor(item.Quality);
            labelTitle.VisitedLinkColor = labelTitle.LinkColor;
            labelIdValue.Text           = item.Identifier.ToString("D");
            labelCountBase.Text         = string.Format("{0} ×", item.Count);
            labelPriceValue.Text        = string.Format("{0}@", item.Price);

            if (item.Restriction != ItemRaceRestriction.Universal)
            {
                labelRace.Text =
                    item.Restriction == ItemRaceRestriction.Asmodians
                        ? Resources.ItemRaceAsmo
                        : Resources.ItemRaceEly;
            }

            characterRegex = new Regex(Resources.RegexCharacterName);

            App.CurrentContext.Cache.GetImageAsync(IconPathResolver.ExpandUri(item.IconUri), UpdateItemIcon);

            for (var i = 1; i <= 5; ++i)
            {
                comboBoxCount.Items.Add(string.Format("{0}", i * item.Count));
            }

            comboBoxCount.SelectedIndex = 0;
        }
예제 #2
0
        /// <summary>
        /// Creates a new instance of the <see cref="Rift.Forms.ShopItemPanel"/> class
        /// from the specified <see cref="Rift.Data.ShopItem"/>.
        /// </summary>
        /// <param name="item">A <see cref="Rift.Data.ShopItem"/> to view.</param>
        public ShopItemPanel(ShopItem item)
        {
            ContainedItem = item;
            itemIcon      = null;
            priceText     = string.Format("{0}@", item.Price);

            titleColor      = QualityColorHelper.GetForeColor(item.Quality);
            backgroundColor = Color.FromArgb(BackgroundAlpha, QualityColorHelper.GetBackColor(item.Quality));

            if (!string.IsNullOrEmpty(item.IconUri))
            {
                App.CurrentContext.Cache.GetImageAsync(IconPathResolver.ExpandUri(item.IconUri), HandleImage);
            }
        }