示例#1
0
        public bool UnsubscribeOutput(OutputSubscriptionRequest _subReq)
        {
            var subReq = _subReq.Clone();

            LogOutputSubReq("UnsubscribeOutput", subReq);
            var ret = false;

            if (ActiveOutputSubscriptions.ContainsKey(subReq.SubscriptionDescriptor.SubscriberGuid))
            {
                var provider = GetProvider <IOutputProvider>(subReq.ProviderDescriptor.ProviderName);
                ret = provider.UnSubscribeOutputDevice(subReq);
                if (ret)
                {
                    ActiveOutputSubscriptions.Remove(subReq.SubscriptionDescriptor.SubscriberGuid);
                }
            }
            return(ret);
        }
示例#2
0
        public bool SubscribeOutput(OutputSubscriptionRequest _subReq)
        {
            var subReq = _subReq.Clone();

            LogOutputSubReq("SubscribeOutput", subReq);
            if (ActiveOutputSubscriptions.ContainsKey(subReq.SubscriptionDescriptor.SubscriberGuid))
            {
                // If this Subscriber has an existing subscription...
                // ... then remove the old subscription first.
                // unsub output here
                UnsubscribeOutput(ActiveOutputSubscriptions[subReq.SubscriptionDescriptor.SubscriberGuid]);
            }
            var  provider = GetProvider <IOutputProvider>(subReq.ProviderDescriptor.ProviderName);
            bool ret      = false;

            ret = provider.SubscribeOutputDevice(subReq);
            if (ret)
            {
                ActiveOutputSubscriptions.Add(subReq.SubscriptionDescriptor.SubscriberGuid, subReq);
            }
            return(ret);
        }