コード例 #1
0
        public void Disconnect()
        {
            List <int> l_ServerHandleList = m_ServerModel.GetServerHandleList();

            if (l_ServerHandleList.Count > 0)
            {
                try
                {
                    int[] l_RemoveRes;
                    m_Group.RemoveItems(l_ServerHandleList.ToArray(), out l_RemoveRes);
                }
                catch (Exception)
                {
                }
            }

            if (m_Group != null)
            {
                m_Group.DataChanged -= new DataChangeEventHandler(Group_DataChange);

                try
                {
                    m_Group.Remove(true);
                }
                catch (Exception)
                {
                }
            }

            if (m_Server != null)
            {
                m_Server.ShutdownRequested -= new ShutdownRequestEventHandler(Server_ShutdownRequest);

                try
                {
                    m_Server.Disconnect();
                }
                catch (Exception)
                {
                }
            }
        }