示例#1
0
 public int Eat(User who)
 {
     if (NumberOfPieces > 0)
     {
         return 8- this.NumberOfPieces--;
     }
     else
         return -1;
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            List<object> Parameters = e.Parameter as List<Object>;
            string type = Parameters[0].GetType().ToString();
            if (type == "WhoAteMyPizza.Classes.Admin")
            {
                myPizza = (Pizza)Parameters[1];
                EndButton.Visibility = Visibility.Visible;

            }
            else
                myPizza = new Pizza(10);
            Eater = (User)Parameters[0];
            textBox.Text = myPizza.cost.ToString();
        }