Ejemplo n.º 1
0
        // Events

        private void UnloadEventHandler(object sender, EventArgs e)
        {
            // Make non-blocking call to ProcessDispatcher to ThreadPool.QueueUserWorkItem to complete
            // stopping of all start calls in this AppDomain.  For containers shared among various AppDomains,
            // this will just be a ref-count subtract.  For non-shared containers, we will close the container
            // and clean-up.
            SqlDependencyProcessDispatcher dispatcher = SqlDependency.ProcessDispatcher;

            if (null != dispatcher)
            {
                dispatcher.QueueAppDomainUnloading(SqlDependency.AppDomainKey);
            }
        }
Ejemplo n.º 2
0
        private void UnloadEventHandler(object sender, EventArgs e)
        {
            IntPtr ptr;

            Bid.NotificationsScopeEnter(out ptr, "<sc.SqlDependencyPerAppDomainDispatcher.UnloadEventHandler|DEP> %d#", this.ObjectID);
            try
            {
                SqlDependencyProcessDispatcher processDispatcher = SqlDependency.ProcessDispatcher;
                if (processDispatcher != null)
                {
                    processDispatcher.QueueAppDomainUnloading(SqlDependency.AppDomainKey);
                }
            }
            finally
            {
                Bid.ScopeLeave(ref ptr);
            }
        }
Ejemplo n.º 3
0
        // ------
        // Events
        // ------

        private void UnloadEventHandler(object sender, EventArgs e)
        {
            IntPtr hscp;

            Bid.NotificationsScopeEnter(out hscp, "<sc.SqlDependencyPerAppDomainDispatcher.UnloadEventHandler|DEP> %d#", ObjectID);
            try {
                // Make non-blocking call to ProcessDispatcher to ThreadPool.QueueUserWorkItem to complete
                // stopping of all start calls in this AppDomain.  For containers shared among various AppDomains,
                // this will just be a ref-count subtract.  For non-shared containers, we will close the container
                // and clean-up.
                SqlDependencyProcessDispatcher dispatcher = SqlDependency.ProcessDispatcher;
                if (null != dispatcher)
                {
                    dispatcher.QueueAppDomainUnloading(SqlDependency.AppDomainKey);
                }
            }
            finally {
                Bid.ScopeLeave(ref hscp);
            }
        }