コード例 #1
0
ファイル: MediaSystem.cs プロジェクト: xiaomaofeng/wpf
        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;
        }
コード例 #2
0
ファイル: ChannelManager.cs プロジェクト: dox0/DotNet471RS3
            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;
                }
            }