Beispiel #1
0
        internal void Start()
        {
            // Do something to start the car.
            Console.WriteLine($"Starting car {LicenseNumber}...");

            // Once the car is started, raise OnStarted event here.
            var e = new CarStartedEventArgs(LicenseNumber);

            OnStarted(e);
        }
Beispiel #2
0
 private static void CarStarted(object sender, CarStartedEventArgs e)
 {
     Console.WriteLine($"Car {e.LicenseNumber} is started.");
 }
Beispiel #3
0
 protected virtual void OnStarted(CarStartedEventArgs e)
 {
     Started.Raise(this, e);
 }