Example #1
0
 public TheftRequest( string thiefName, string victimName, int actionID, Card propertyToGive, List<Card> propertyToTake )
 {
     this.ThiefName = thiefName;
     this.VictimName = victimName;
     this.ActionID = actionID;
     this.PropertyToGive = propertyToGive;
     this.PropertiesToTake = propertyToTake;
 }
        private void StealButton_Click( object sender, RoutedEventArgs e )
        {
            // Set the PropertyToGive and PropertiesToTake based on the selection of the thief.
            if ( null != propertyViewThief )
            {
                this.propertyToGive = (propertyViewThief.SelectedItem as TreeViewItem).Tag as Card;
            }
            else
            {
                this.propertyToGive = new Card();
            }

            Object selectedItemTag = (propertyViewVictim.SelectedItem as TreeViewItem).Tag;
            this.propertiesToTake = (TheftType.Dealbreaker == this.type) ? (selectedItemTag as List<Card>) : new List<Card>() { (selectedItemTag as Card) };

            this.dialogResult = true;
            this.CloseWindow = true;
        }