Reputation: 31
Is there some doco on IAutoSubscriptionService. How do I use using (ESP.GetEcoService().StartSubscribe(subscriber)) to trigger an event when an object changes. That is for any attribute of an object.
Upvotes: 0
Views: 30
Reputation: 2435
The StartSubscribe gives a IDisposable context back and it is typically used like this:
using (theAutoSubscriptionService.StartSubscribe(subscriber))
{
arbitrary c# code accessing model elements
- all access will be added to subscription!
A thing of beauty really!
}
When something later change - the ISubscriber.Receive will fire. For adhoc usage consider the EventSubscriber class
Upvotes: 0