public Subscriber(string ID, ErroresDatos pub) { id = ID; // Subscribe to the event using C# 2.0 syntax pub.ThresholdReached += HandleCustomEvent; }