static void Main(string[] args) { carPortfolio[] data = new carPortfolio[4]; data[0] = new carPortfolio("Tesla Model S", 1, "First indeed!", "grey", 30, 40); data[1] = new carPortfolio("Tesla Model X", 2, "Super xXx!", "white", 10, 20); data[2] = new carPortfolio("Tesla Roadster 2", 3, "The fasterest!", "red", 50, 70); data[3] = new carPortfolio("Tesla Roadster", 4, "Almost perfect car!", "red", 40, 60); Race race = new Race(data); race.Prepared += delegate(object sender, EventArgs e) { race.Start(race, EventArgs.Empty); }; race.Started += delegate(object sender, EventArgs e) { race.CarryOn(race, EventArgs.Empty); }; race.Finished += delegate(object sender, EventArgs e) { race.Finish(race, EventArgs.Empty); }; //data.Prepared += data.OnPrepared(data); //data.Started += data.OnStarted(data); //data.Finished += data.OnFinished(data); race.Prepare(); //race.start(); //race.carryOn(); //race.finish(); }
static void Main(string[] args) { carPortfolio[] data = new carPortfolio[4]; data[0] = new carPortfolio("Tesla Model S", 1, "First indeed!", "grey", 30, 40); data[1] = new carPortfolio("Tesla Model X", 2, "Super xXx!", "white", 10, 20); data[2] = new carPortfolio("Tesla Roadster 2", 3, "The fasterest!", "red", 50, 70); data[3] = new carPortfolio("Tesla Roadster", 4, "Almost perfect car!", "red", 40, 60); Race race = new Race(data); race.prepare(); race.start(); race.carryOn(); race.finish(); }