protected void GetPartOfTheirCollection(CardSet cardSet, RaritySet rarity )
        {
            DoTradeChecks();
            if (!InTrade || !CollectionCheck())
            {
                return;
            }

            this.MagicOnlineInterface.PickCardSet(cardSet);
            AutoItX.Sleep(250);

            this.MagicOnlineInterface.PickRarity(rarity);
            if (CollectionCheck() && InTrade)
            {
                var collection = this.MagicOnlineInterface.ExamineCollection(FindXCardsFromTheirCollection, this.TheirCollection.Values.Sum(p => p.CopiesOfCard));
                AddToTheirCollection(collection);
            }
        }
        public void PickRarity(RaritySet raritySet)
        {
            //            for (int i = 0; i < 5; i++)
            //            {
                _logger.TraceFormat(LogMessageFormat, this._currentSelectedRarity, raritySet);
                this._currentSelectedRarity =
                    (RaritySet) PickFilterOption((int) this._currentSelectedRarity, (int) raritySet,
                                                 _pbv.FilterRaritySelectorPosition);

                //try
                //{
                //    AutoItX.Sleep(i > 2 ? 5000 : 2000);

                //    var rarity = _pbv.TradeFilterRarityText.GetOCRValue().Enumerize();
                //    var rarityNames = Enum.GetNames(typeof(RaritySet));
                //    var diffSet = (from r in rarityNames
                //                   let diff = Levenshtein.Compute(rarity, r)
                //                   where diff < 4
                //                   select r).FirstOrDefault();

                //    if (diffSet != null)
                //    {
                //        this._currentSelectedRarity = (RaritySet) Enum.Parse(typeof (RaritySet), diffSet);
                //        if (this._currentSelectedRarity != raritySet)
                //        {
                //            _logger.Info("Incorrect filter set for rarity trying again.");
                //        }
                //        else
                //        {
                //            break;
                //        }
                //    }
                //}
                //catch (Exception ex)
                //{
                //    _logger.Error(ex, "Exception parsing enum value from screen");
                //}
            //            }
        }
 public void Reset()
 {
     this._currentSelectedSet = CardSet.AllCards;
     this._currentSelectedRarity = RaritySet.AnyRarity;
     this._currentSelectedVersion = VersionSet.AllVersions;
 }
 protected Dictionary<int, MagicCard> GetPartOfTheirCollection(CardSet cardSet, RaritySet rarity )
 {
     DoTradeChecks();
     TradeFilterHandler.PickRarity(rarity);
     TradeFilterHandler.PickCardSet(cardSet);
     return MagicOnlineInterface.ExamineCollection();
 }