Esempio n. 1
0
        /// <summary>
        /// Print line to the main channel, (optional) and their own channel.
        /// </summary>
        /// <param name="line">Chat.log line.</param>
        /// <param name="chatColor">Line foreground <see cref="Color"/>.</param>
        /// <param name="chat">Print to this channel aswell.</param>
        public void Print(string line, Color chatColor, ConsoleControl.ConsoleControl chat = null)
        {
            // Write to the main channel
            if (Chats["All"].IsHandleCreated)
            {
                Chats["All"].Invoke((Action)(() => Chats["All"].WriteOutput(line, chatColor)));
            }

            // Write to the right channel
            if (chat != null && chat.IsHandleCreated)
            {
                chat.Invoke((Action)(() => chat.WriteOutput(line, chatColor)));
            }
        }