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); } } }
public void AddSubscriptionUpdateTarget(OwnerSubscriptionItem targetLocation) { SubscriptionChainTargetsToUpdate.Add(targetLocation); }
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); } } }