Пример #1
0
        private static void processMessage(NetMessage.Message message, string data)
        {
            switch (message)
            {
            case NetMessage.Message.OK: break;

            case NetMessage.Message.ERROR:
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(data);
                Console.ResetColor();
                break;

            case NetMessage.Message.LOG:
                Console.WriteLine(data);
                break;

            case NetMessage.Message.Undefined: break;

            case NetMessage.Message.XML:
                _form.Invoke(new Action(() => _form.CallBack(message, data)));
                break;

            case NetMessage.Message.GET:
                _form.Invoke(new Action(() => _form.CallIn(message, data)));
                break;

            default: throw new ArgumentOutOfRangeException();
            }
        }