I subscribe to Event inside a class . For instance,
MainStation mainStation = StationFactory.GetMainStation(); mainStation.FrequencyChanged += new EventArgs(MainStation_FrequencyChanged);
My MainStation class MainStation event under some condition, just by calling the FrequencyChanged() event
Problem
Now I have a script in which I have to create a SubStation from MainStation , which is also a subclass of MainStation with some additional features, and the FrequencyChanged event should be signed as MainStation subscripted. Consider the code below:
public class MainStation { public event EventHandler FrequencyChanged; public static SubStation CreateSubStation() { SubStation subStation = new SubStation();
Bottom line
I want to fire an event that a class subscribes from another class, also call events
Update
StationFactory creates a MainStation , and the FrequencyChanged event on the MainStation instance is set as defined in the first block of code.
source share