Exemple #1
0
        /// <summary>
        /// Display server channel list
        /// </summary>
        public void DisplayChannelWindow()
        {
            if (wChannelList == null)
            {
                wChannelList = new Forms.Channels(this);
            }

            wChannelList.Show();
        }
Exemple #2
0
        /// <summary>
        /// Destroy this class, be careful, it can't be used in any way after you
        /// call this
        /// </summary>
        public void Destroy()
        {
            if (IsDestroyed)
            {
                // avoid calling this function multiple times, otherwise it could crash
                Core.DebugLog("Destroy() called multiple times on " + ServerName);
                return;
            }

            Core.DebugLog("Destroying network " + ServerName);

            isDestroyed = true;

            lock (ChannelList)
            {
                ChannelList.Clear();
            }

            if (wChannelList != null)
            {
                wChannelList.Hide();
                wChannelList.Dispose();
                wChannelList = null;
            }

            lock (PrivateChat)
            {
                // release all windows
                foreach (User user in PrivateChat)
                {
                    user.Destroy();
                }
                PrivateChat.Clear();
            }

            lock (Channels)
            {
                foreach (Channel xx in Channels)
                {
                    xx.Destroy();
                }
                Channels.Clear();
            }

            lock (PrivateWins)
            {
                foreach (Graphics.Window cw in PrivateWins.Values)
                {
                    cw._Destroy();
                }
                PrivateWins.Clear();
            }

            _Protocol = null;
            SystemWindow = null;

            lock (Descriptions)
            {
                Descriptions.Clear();
            }

            Core.SystemForm.ChannelList.RemoveServer(this);
        }