Example #1
0
 private void AssignFieldFromEntry(CardDetailEntry entry)
 {
     switch (entry.FieldName)
     {
         case CardFieldName.CardName:
             CardName = (CardDetailEntryString) entry;
             break;
         case CardFieldName.ManaCost:
             ManaCost = (CardDetailEntrySequence) entry;
             break;
         case CardFieldName.ConvertedManaCost:
             if (!Int32.TryParse(((CardDetailEntryString) entry).Value, out ConvertedManaCost))
             {
                 Debug.Assert(false);
             }
             break;
         case CardFieldName.Types:
             Types = (CardDetailEntryString) entry;
             break;
         case CardFieldName.CardText:
             CardText = (CardDetailEntrySequence) entry;
             CardTextInnerHtml = entry.InnerHtmlCode;
             CardTextOuterHtml = entry.OuterHtmlCode;
             break;
         case CardFieldName.Watermark:
             Watermark = (CardDetailEntryString) entry;
             break;
         case CardFieldName.PowerToughness:
             ExtractPowerToughnessOrLoyalty(((CardDetailEntryString) entry).Value, out Power, out Toughness);
             break;
         case CardFieldName.Expansion:
             Expansion = (CardDetailEntrySequence) entry;
             break;
         case CardFieldName.Rarity:
             Rarity = (CardDetailEntryString) entry;
             break;
         case CardFieldName.CardNumber:
             CardNumber = (CardDetailEntryString) entry;
             break;
         case CardFieldName.Artist:
             Artist = (CardDetailEntryString) entry;
             break;
         case CardFieldName.CommunityRating:
             CommunityRating = (CardDetailEntryString) entry;
             break;
         case CardFieldName.Image:
             ImageUrl = (CardDetailEntryString) entry;
             break;
     }
 }
Example #2
0
 public void AddEntry(CardDetailEntry entry)
 {
     Debug.Assert(!_entries.Contains(entry));
     _entries.Add(entry);
     AssignFieldFromEntry(entry);
 }