public void setUp() { Configuration configuration = new Configuration(); configuration.AddEventType("ObjLocation", typeof(ObjLocation).FullName); configuration.AddEventType("ZoneHumidity", typeof(ZoneHumidity).FullName); configuration.AddEventType("ObjTemperature", typeof(ObjTemperature).FullName); configuration.AddEventType("ZoneTemperature", typeof(ZoneTemperature).FullName); String a = typeof(ObjLocation).FullName; listener_ObjLoc = new ZoneObjsListener(frm); epService_ObjLoc = EPServiceProviderManager.GetProvider("ZoneObjsEngine", configuration); ZoneObjsStmt stmt_ZoneObjs = new ZoneObjsStmt(epService_ObjLoc.EPAdministrator); stmt_ZoneObjs.AddListener(listener_ObjLoc); listener_ObjTemp = new ObjTempListener(frm); epService_ObjTemp = EPServiceProviderManager.GetProvider("ObjTempEngine", configuration); ObjTempStmt stmt_ObjTemp = new ObjTempStmt(epService_ObjTemp.EPAdministrator); stmt_ObjTemp.AddListener(listener_ObjTemp); listener_ZoneTemp = new ZoneTempListener(frm); epService_ZoneTemp = EPServiceProviderManager.GetProvider("ZoneTempEngine", configuration); ZoneTempStmt stmt_ZoneTemp = new ZoneTempStmt(epService_ZoneTemp.EPAdministrator); stmt_ZoneTemp.AddListener(listener_ZoneTemp); listener_ZoneHumidity = new ZoneHumidityListener(frm); epService_ZoneHumidity = EPServiceProviderManager.GetProvider("ZoneHumidityEngine", configuration); ZoneHumidityStmt stmt_ZoneHumidity = new ZoneHumidityStmt(epService_ZoneHumidity.EPAdministrator); stmt_ZoneHumidity.AddListener(listener_ZoneHumidity); //cep demo listener_Alarm = new AlarmListener(frm); epService1 = EPServiceProviderManager.GetProvider("Alarm1Engine", configuration); AlarmStmt stmt_Alarm = new AlarmStmt(epService1.EPAdministrator); stmt_Alarm.AddListener(listener_Alarm); }
public void AddListener(ZoneHumidityListener listener) { statement.Events += listener.Update; }