static void Environment_ServiceRequiresScheduling(object sender, ServiceInstanceEventArgs e) { Console.WriteLine(" --> child of: {0}", e.ServiceInstance.ParentInstance != null ? e.ServiceInstance.ParentInstance.Configuration.ServiceName : "(no parent)"); e.ServiceInstance.StateChanged += instance_StateChanged; e.ServiceInstance.OutputGenerated += instance_OutputGenerated; e.ServiceInstance.Start(); }
/// <summary> /// Add event from the environment to schedule service /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Listener_ServiceRequiresScheduling(object sender, ServiceInstanceEventArgs e) { if (e.ServiceInstance != null) { if (e.ServiceInstance.ParentInstance == null) { AddUnplannedServiceToSchedule(e.ServiceInstance); } else { AddRequestToSchedule(e.ServiceInstance); } } }