Esempio n. 1
0
        public async Task <string> AddSubscriptionObserverAsync(string subscriptionUriString, TimeSpan lifetime,
                                                                ErrorObserver observer)
        {
            IErrorObserver observerRef = await client.CreateObjectReference <IErrorObserver>(observer);

            ISubscription subscription = GetSubscription(subscriptionUriString);

            return(await subscription.AddObserverAsync(lifetime, observerRef));
        }
Esempio n. 2
0
        public async Task <string> AddResourceObserverAsync(string resourceUriString, TimeSpan lifetime,
                                                            ErrorObserver observer)
        {
            IErrorObserver objRef = await client.CreateObjectReference <IErrorObserver>(observer);

            IPiSystem resource = GetPiSystem(resourceUriString);

            return(await resource.AddObserverAsync(lifetime, objRef));
        }