private void bAddNew_Click(object sender, RoutedEventArgs e) { DominionBase.Cards.Constraint constraint = new DominionBase.Cards.Constraint(); this.ConstraintCollection.Add(constraint); icConstraints.Items.Add(new ucCardConstraint { Constraint = constraint }); }
private void cbCategory_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox cb = sender as ComboBox; if (cb.SelectedItem != null) { cbSet.SelectedItem = null; cbGroup.SelectedItem = null; DominionBase.Cards.Constraint constraint = new DominionBase.Cards.Constraint(DominionBase.Cards.ConstraintType.CategoryContains, cb.SelectedItem, 0, 10); IEnumerable <DominionBase.Cards.Card> cards = constraint.GetMatchingCards(this.Cards); cccSetCategoryGroupDisplay.Pile = cards; gbSetCategoryGroupDisplay.Header = String.Format("Cards where Category has {0} in it", cb.SelectedItem); tbMatchingCount.Text = cards.Count().ToString(); } }
private void cbGroup_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox cb = sender as ComboBox; if (cb.SelectedItem != null) { cbSet.SelectedItem = null; cbCategory.SelectedItem = null; DominionBase.Cards.Group group = ((KeyValuePair <DominionBase.Cards.Group, int>)cb.SelectedItem).Key; DominionBase.Cards.Constraint constraint = new DominionBase.Cards.Constraint(DominionBase.Cards.ConstraintType.MemberOfGroup, group, 0, 10); IEnumerable <DominionBase.Cards.Card> cards = constraint.GetMatchingCards(this.Cards); cccSetCategoryGroupDisplay.Pile = cards; gbSetCategoryGroupDisplay.Header = String.Format("Cards that are a member of Group: {0}", group.ToDescription()); tbMatchingCount.Text = cards.Count().ToString(); } }
private void cbGroup_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox cb = sender as ComboBox; if (cb.SelectedItem != null) { cbSet.SelectedItem = null; cbCategory.SelectedItem = null; DominionBase.Cards.Group group = ((KeyValuePair<DominionBase.Cards.Group, int>)cb.SelectedItem).Key; DominionBase.Cards.Constraint constraint = new DominionBase.Cards.Constraint(DominionBase.Cards.ConstraintType.MemberOfGroup, group, 0, 10); IEnumerable<DominionBase.Cards.Card> cards = constraint.GetMatchingCards(this.Cards); cccSetCategoryGroupDisplay.Pile = cards; gbSetCategoryGroupDisplay.Header = String.Format("Cards that are a member of Group: {0}", group.ToDescription()); tbMatchingCount.Text = cards.Count().ToString(); } }
private void cbCategory_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox cb = sender as ComboBox; if (cb.SelectedItem != null) { cbSet.SelectedItem = null; cbGroup.SelectedItem = null; DominionBase.Cards.Constraint constraint = new DominionBase.Cards.Constraint(DominionBase.Cards.ConstraintType.CategoryContains, cb.SelectedItem, 0, 10); IEnumerable<DominionBase.Cards.Card> cards = constraint.GetMatchingCards(this.Cards); cccSetCategoryGroupDisplay.Pile = cards; gbSetCategoryGroupDisplay.Header = String.Format("Cards where Category has {0} in it", cb.SelectedItem); tbMatchingCount.Text = cards.Count().ToString(); } }