private ParentNCSubscription CreateSubscriptionGen(ParentNCSubscriptionRequest request, ICacheDelegates <CallPSParentNodeChangedEventSubDelegate> callPSParentNodeChangedEventSubsCache) { ParentNCSubscription result = new ParentNCSubscription(request, callPSParentNodeChangedEventSubsCache); request.MarkAsUsed(); return(result); }
public IDisposable SubscribeToParentNodeHasChanged(EventHandler <PSNodeParentChangedEventArgs> handler) { ParentNCSubscriptionRequest subRequest = new ParentNCSubscriptionRequest(CompKey, handler); lock (_sync) { ParentNCSubscription sub = ParentNCSubscriberCollection.GetOrAdd(subRequest, _callPSParentNodeChangedEventSubsCache); } UnsubscriberForPropStore unsubscriber = new UnsubscriberForPropStore(new WeakReference <BagNode>(this), subRequest); return(unsubscriber); }