Esempio n. 1
0
        // ------------------------------------------------------------ //

        public void Update()
        {
            var api = HotItemController.CurrentApi;

            Cookie cookie = null;

            if (!String.IsNullOrEmpty(api.ExchangeHost))
            {
                cookie = new Cookie("s", HotItemController.Config.SessionKey, "/", api.ExchangeHost);
            }
            ScrapeHelper.Get(api.UriBuyGems(10000), api.ExchangeHost, cookie, api.ExchangeReferer, CompletedGemPrice, api.UserAgent);
            ScrapeHelper.Get(api.UriBuyGold(10000), api.ExchangeHost, cookie, api.ExchangeReferer, CompletedGoldPrice, api.UserAgent);

            BuyGemsRules.Money = new Money(BuyGemPrice * 100)
            {
                Name = "Gems for Gold"
            };;
            BuyGoldRules.Money = new Money(BuyGoldPrice * 100)
            {
                Name = "Gold for Gems"
            };

            if (_isBuyGemActive)
            {
                foreach (NotifierRule r in BuyGemsRules.Rules)
                {
                    if (r.Compare(BuyGemsRules.Money.TotalCopper))
                    {
                        HotItemController.Self.AddNotification(this,
                                                               new Event.NotificationEventArgs(0, null, r,
                                                                                               Event.NotificationType
                                                                                               .BuyGems)
                        {
                            GemRuleViewModel
                                =
                                    BuyGemsRules
                        });
                    }
                }
            }

            if (_isBuyGoldActive)
            {
                foreach (NotifierRule r in BuyGoldRules.Rules)
                {
                    if (r.Compare(BuyGoldRules.Money.TotalCopper))
                    {
                        HotItemController.Self.AddNotification(this,
                                                               new Event.NotificationEventArgs(0, null, r,
                                                                                               Event.NotificationType
                                                                                               .BuyGold)
                        {
                            GemRuleViewModel
                                =
                                    BuyGoldRules
                        });
                    }
                }
            }
        }