private void SubscribeCimSessionEvent(string namespaceName, string query) { IObservable <CimSubscriptionResult> queryInstances = CimSession.SubscribeAsync(namespaceName, "WQL", query); var observer = new MMIObserver <CimSubscriptionResult>(); TouchScreenDisposeAble = queryInstances.Subscribe(observer); }
public IValueChangedNotify SubscribeBrightnessEvent() { string namespaceName = "root\\WMI"; string query = "SELECT Brightness from WmiMonitorBrightnessEvent"; IObservable <CimSubscriptionResult> queryInstances = CimSession.SubscribeAsync(namespaceName, "WQL", query); var observer = new MMIObserver <CimSubscriptionResult>(); TouchScreenDisposeAble = queryInstances.Subscribe(observer); return(observer); }