//The constructor for the GUI public SystemSchedulerGUI(ISimulationEnvironment env, SystemScheduler systemScheduler, ICTCOffice ctc) { //Get everything up and running on the form InitializeComponent(); //Copy all of our incoming data to our globals _environment = env; _ctcOffice = ctc; _systemScheduler = systemScheduler; //Subscribed to the environment tick event _environment.Tick += EnvironmentTickHandler; }
//The constructor for the system scheduler public SystemScheduler(ISimulationEnvironment env, ICTCOffice ctc) { //Store all of the incoming data to our globals _env = env; _ctc = ctc; //Get the current time _currentTime = DateTime.Now; _currentTime.AddMilliseconds(_currentTime.Millisecond * -1); //Subscribed to the environment tick event _env.Tick += _environment_Bollocks; //Also listen for when we are asked to start and stop _ctc.StartAutomation += _ctc_StartAutomation; _ctc.StopAutomation += _ctc_StopAutomation; }