Esempio n. 1
0
        /// <summary>
        /// Removes all subscriptions for the collection that is contained in the event.
        /// </summary>
        /// <param name="args">Node event arguments.</param>
        private void OnCollectionNoAccess(NodeEventArgs args)
        {
            // Make sure that this is an event for a collection.
            if (args.Collection == args.ID)
            {
                // Search the POBox collections for a subscription for this collection.
                Property p = new Property(Subscription.SubscriptionCollectionIDProperty, args.ID);

                // Find all of the subscriptions for this POBox.
                ICSList list = store.GetNodesByProperty(p, SearchOp.Equal);
                foreach (ShallowNode sn in list)
                {
                    // Make sure that this node is a subscription.
                    if (sn.Type == NodeTypes.SubscriptionType)
                    {
                        // Get the collection (POBox) for this subscription.
                        POBox poBox = POBox.GetPOBoxByID(store, sn.CollectionID);
                        if (poBox != null)
                        {
                            // Delete this subscription from the POBox.
                            poBox.Commit(poBox.Delete(new Subscription(poBox, sn)));
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Call back when PO Box is created
        /// </summary>
        /// <param name="args"></param>
        private void OnPOBoxCreated(NodeEventArgs args)
        {
            // Get the POBox that caused the event.
            POBox poBox = POBox.GetPOBoxByID(store, args.ID);

            if (poBox != null)
            {
                // Save the domain ID for this POBox.
                poBoxTable[args.ID] = poBox.Domain;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Handles queuing of subscriptions to the subscription thread when they change.
        /// </summary>
        /// <param name="args"></param>
        private void OnSubscriptionChanged(NodeEventArgs args)
        {
            // Get the POBox for this subscription.
            POBox poBox = POBox.GetPOBoxByID(store, args.Collection);

            if (poBox != null)
            {
                StartSubscription(poBox, args.ID);
            }
            else
            {
                log.Debug("Error: OnSubscriptionChanged - Cannot find POBox {0} for subscription {1}.", args.Collection, args.ID);
            }
        }