private void LimitAcceptedCardTypes() { CardTypeCollection acceptedTypes = new CardTypeCollection(); foreach (CardType ct in _cardTypes) { if (Regex.IsMatch(_acceptedTypes, ".*" + ct.Name + ".*")) acceptedTypes.Add(ct); } _cardTypes = acceptedTypes; }
public object Create(object parent, object configContext, XmlNode section) { XmlNodeList cardTypes; CardTypeCollection al = new CardTypeCollection(); cardTypes = section.SelectNodes("cardTypes//cardType"); foreach (XmlNode cardType in cardTypes) { String name = cardType.Attributes.GetNamedItem("name").Value; String regExp = cardType.Attributes.GetNamedItem("regExp").Value; //Add them to the card types collection CardType ct = new CardType(name, regExp); al.Add(ct); } return(al); }