static void Main(string[] args) { Shelter sht = new Shelter(10); Console.Write("Currently there are " + sht.bookedShelter + " shelter bookings are to be cancelled"); Booth bthA = new Booth("A", sht); Booth bthB = new Booth("B", sht); Thread t1 = new Thread(new ThreadStart(bthA.performCancelation)); Thread t2 = new Thread(new ThreadStart(bthB.performCancelation)); t1.Start(); t2.Start(); t1.Join(); t2.Join(); Console.WriteLine("\n\rCancellations made by Booth A = "+bthA.getNoOfCancellations()); Console.WriteLine("Cancellations made by Booth B = " + bthB.getNoOfCancellations()); XDocument myDocument = XmlDataClass.createData(); Console.WriteLine(myDocument.ToString()); Console.ReadKey(); XmlDataClass.SaveDataToFile("booking_cancelation.xml"); Console.ReadKey(); }
public Booth(String bothname,Shelter shelter) { this.shlt = shelter; this.bothName = bothname; }