Exemple #1
0
        protected void ChatForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (_proxy != null)
            {
                if (!string.IsNullOrEmpty(_userName) && IsConnected(_userName))
                {
                    Proxy.Disconnect(_userName);
                }

                while (_proxy.State == CommunicationState.Opened)
                {
                    try
                    {
                        Proxy.Close();
                    }
                    catch
                    { }
                }

                Proxy = null;
            }
        }
Exemple #2
0
        protected void ChatForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (_proxy != null)
            {
                if (!string.IsNullOrEmpty(_userName) && IsConnected(_userName))
                    Proxy.Disconnect(_userName);

                while (_proxy.State == CommunicationState.Opened)
                {
                    try
                    {
                        Proxy.Close();
                    }
                    catch
                    { }
                }

                Proxy = null;
            
            }
        }