Subscribe() public method

public Subscribe ( string relativePath, EventHandler propertyChangedHandler ) : WoopsaClientSubscription
relativePath string
propertyChangedHandler EventHandler
return WoopsaClientSubscription
        public WoopsaSubscriptionServiceSubscriptionServerSubClient(
            WoopsaSubscriptionChannel channel,
            WoopsaContainer root,
            int subscriptionId, string propertyPath,
            TimeSpan monitorInterval, TimeSpan publishInterval,
            WoopsaBaseClientObject subClient, string relativePropertyPath) :
            base(channel, root, subscriptionId, propertyPath, monitorInterval, publishInterval)
        {
            bool isSingleNotification =
                monitorInterval == WoopsaSubscriptionServiceConst.MonitorIntervalLastPublishedValueOnly &&
                publishInterval == WoopsaSubscriptionServiceConst.PublishIntervalOnce;
            EventHandler <WoopsaNotificationEventArgs> handler;

            if (isSingleNotification)
            {
                handler =
                    (sender, e) =>
                {
                    EnqueueNewMonitoredValue(e.Notification.Value);
                    DoPublish();     // there is not publish timer, force publishing the unique notification
                }
            }
            ;
            else
            {
                handler =
                    (sender, e) =>
                {
                    EnqueueNewMonitoredValue(e.Notification.Value);
                }
            };
            _clientSubscription = subClient.Subscribe(relativePropertyPath, handler,
                                                      monitorInterval, publishInterval);
        }
 public WoopsaSubscriptionServiceSubscriptionServerSubClient(
     WoopsaSubscriptionChannel channel,
     WoopsaContainer root,
     int subscriptionId, string propertyPath,
     TimeSpan monitorInterval, TimeSpan publishInterval,
     WoopsaBaseClientObject subClient, string relativePropertyPath)
     : base(channel, root, subscriptionId, propertyPath, monitorInterval, publishInterval)
 {
     bool isSingleNotification =
         monitorInterval == WoopsaSubscriptionServiceConst.MonitorIntervalLastPublishedValueOnly &&
         publishInterval == WoopsaSubscriptionServiceConst.PublishIntervalOnce;
     EventHandler<WoopsaNotificationEventArgs> handler;
     if (isSingleNotification)
         handler =
             (sender, e) =>
             {
                 EnqueueNewMonitoredValue(e.Notification.Value);
                 DoPublish(); // there is not publish timer, force publishing the unique notification
             };
     else
         handler =
             (sender, e) =>
             {
                 EnqueueNewMonitoredValue(e.Notification.Value);
             };
     _clientSubscription = subClient.Subscribe(relativePropertyPath, handler,
             monitorInterval, publishInterval);
 }