コード例 #1
0
ファイル: Program.cs プロジェクト: jasonsun01/EventAssignment
 public void HaveNewCustomer(object sender, HandleEventArgs eventArgs)
 {
     IsOpen = true;
     Console.WriteLine("Table is open!");
     AssignCustomerTable = SetTableOccupied;
     SetTableOccupied(this, eventArgs);
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: jasonsun01/EventAssignment
 public void SetTableOccupied(Object sender, HandleEventArgs eventArgs)
 {
     CurrentCustomer = eventArgs.customer;
     Console.WriteLine("{0} {1} got a table.", eventArgs.customer.FirstName, eventArgs.customer.LastName);
     IsOpen   = false;
     HaveMeal = CurrentCustomer.Changemeal;
     HaveMeal(this, new HandleEventArgs(CurrentCustomer, this));
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: jasonsun01/EventAssignment
        public void Changemeal(object sender, HandleEventArgs eventArgs)
        {
            foreach (string meal in Enum.GetNames(typeof(Customer.Meals)))
            {
                if (meal.Equals("done"))
                {
                    Console.WriteLine("{0} {1} is having {2}.", this.FirstName, this.LastName, meal);
                    Program.AssignCustomerTalbe();
                }
                else if (meal.Equals("none"))
                {
                    continue;
                }

                else
                {
                    Console.WriteLine("{0} {1} is having {2}.", this.FirstName, this.LastName, meal);
                }
            }
        }