コード例 #1
0
ファイル: SubscribeSupport.cs プロジェクト: michlG/Caloom
        public static void NotifySubscribers(string targetLocation)
        {
            var ictx = InformationContext.Current;

            if (ictx.IsExecutingSubscriptions)
            {
                return;
            }
            SubscriptionCollection subscriptionCollection = GetSubscriptions(targetLocation);
            string targetParentLocation = GetParentDirectoryTarget(targetLocation);
            SubscriptionCollection parentSubscriptionCollection = GetSubscriptions(targetParentLocation);

            if (subscriptionCollection == null && parentSubscriptionCollection == null)
            {
                return;
            }
            VirtualOwner          owner            = VirtualOwner.FigureOwner(targetLocation);
            OwnerSubscriptionItem subscriptionItem = new OwnerSubscriptionItem
            {
                Owner = owner, TargetLocation = targetLocation
            };

            ictx.AddSubscriptionUpdateTarget(subscriptionItem);
            return;

            if (subscriptionCollection != null)
            {
                foreach (var subscription in subscriptionCollection.CollectionContent)
                {
                    OperationRequest operationRequest = new OperationRequest
                    {
                        SubscriberNotification = subscription
                    };
                    //QueueSupport.PutToOperationQueue(operationRequest);
                    ictx.AddOperationRequestToFinalizingQueue(operationRequest);
                }
            }
            if (parentSubscriptionCollection != null)
            {
                foreach (var subscription in parentSubscriptionCollection.CollectionContent)
                {
                    OperationRequest operationRequest = new OperationRequest
                    {
                        SubscriberNotification = subscription
                    };
                    //QueueSupport.PutToOperationQueue(operationRequest);
                    ictx.AddOperationRequestToFinalizingQueue(operationRequest);
                }
            }
        }
コード例 #2
0
 public void AddSubscriptionUpdateTarget(OwnerSubscriptionItem targetLocation)
 {
     SubscriptionChainTargetsToUpdate.Add(targetLocation);
 }
コード例 #3
0
ファイル: InformationContext.cs プロジェクト: michlG/Caloom
 public void AddSubscriptionUpdateTarget(OwnerSubscriptionItem targetLocation)
 {
     SubscriptionChainTargetsToUpdate.Add(targetLocation);
 }
コード例 #4
0
ファイル: SubscribeSupport.cs プロジェクト: kallex/Caloom
        public static void NotifySubscribers(string targetLocation)
        {
            var ictx = InformationContext.Current;
            if (ictx.IsExecutingSubscriptions)
                return;
            SubscriptionCollection subscriptionCollection = GetSubscriptions(targetLocation);
            string targetParentLocation = GetParentDirectoryTarget(targetLocation);
            SubscriptionCollection parentSubscriptionCollection = GetSubscriptions(targetParentLocation);
            if (subscriptionCollection == null && parentSubscriptionCollection == null)
                return;
            VirtualOwner owner = VirtualOwner.FigureOwner(targetLocation);
            OwnerSubscriptionItem subscriptionItem = new OwnerSubscriptionItem
                                                         {Owner = owner, TargetLocation = targetLocation};
            ictx.AddSubscriptionUpdateTarget(subscriptionItem);
            return;

            if(subscriptionCollection != null)
            {
                foreach(var subscription in subscriptionCollection.CollectionContent)
                {
                    OperationRequest operationRequest = new OperationRequest
                                                            {
                                                                SubscriberNotification = subscription
                                                            };
                    //QueueSupport.PutToOperationQueue(operationRequest);
                    ictx.AddOperationRequestToFinalizingQueue(operationRequest);
                }
            }
            if(parentSubscriptionCollection != null)
            {
                foreach (var subscription in parentSubscriptionCollection.CollectionContent)
                {
                    OperationRequest operationRequest = new OperationRequest
                    {
                        SubscriberNotification = subscription
                    };
                    //QueueSupport.PutToOperationQueue(operationRequest);
                    ictx.AddOperationRequestToFinalizingQueue(operationRequest);
                }
            }
        }