Esempio n. 1
0
        public void Add_Text(string text, Brush col, TextType type)
        {
            // InvokeRequired required compares the thread ID of the
            // calling thread to the thread ID of the creating thread.
            // If these threads are different, it returns true.

            string    time     = DateTime.Now.ToLongTimeString() + " :[" + text + Environment.NewLine;
            Chat_Line new_chat = new Chat_Line();

            new_chat.text  = time;
            new_chat.color = col;
            new_chat.type  = type;

            Globals.ChatLock.EnterWriteLock();
            try
            {
                Chat_Messages.Enqueue(new_chat);
            }
            finally
            {
                Globals.ChatLock.ExitWriteLock();
            }

            Globals.l2net_home.timer_chat.Start();
        }
Esempio n. 2
0
        public void Add_Text(string text, System.Drawing.Brush col, TextType type)
        {
            // InvokeRequired required compares the thread ID of the
            // calling thread to the thread ID of the creating thread.
            // If these threads are different, it returns true.

            string time = System.DateTime.Now.ToLongTimeString() + " :[" + text + Environment.NewLine;
            Chat_Line new_chat = new Chat_Line();
            new_chat.text = time;
            new_chat.color = col;
            new_chat.type = type;

            Globals.ChatLock.EnterWriteLock();
            try
            {
                Chat_Messages.Enqueue(new_chat);
            }
            finally
            {
                Globals.ChatLock.ExitWriteLock();
            }

            Globals.l2net_home.timer_chat.Start();
        }