Exemplo n.º 1
0
        private static void DisconnectTransport()
        {
            if (!IsTransportConnected)
            {
                return;
            }

            // Close global glyph cache channel.
            s_serviceChannel.Close();

            HRESULT.Check(UnsafeNativeMethods.WgxConnection_Disconnect(s_pConnection));

            // Release references to global glyph cache and service channel.
            s_serviceChannel = null;
            s_pConnection    = IntPtr.Zero;

            IsTransportConnected = false;
        }
Exemplo n.º 2
0
            internal void RemoveChannels()
            {
                if (_asyncChannel != null)
                {
                    _asyncChannel.Close();
                    _asyncChannel = null;
                }

                if (_asyncOutOfBandChannel != null)
                {
                    _asyncOutOfBandChannel.Close();
                    _asyncOutOfBandChannel = null;
                }

                RemoveSyncChannels();

                if (_pSyncConnection != IntPtr.Zero)
                {
                    HRESULT.Check(UnsafeNativeMethods.WgxConnection_Disconnect(_pSyncConnection));
                    _pSyncConnection = IntPtr.Zero;
                }
            }