Пример #1
0
 public static void EventHandle(Event e)
 {
     switch (e.eventType)
     {
         case EventType.EVENT_REALMLIST:
             HandleRealmlist((Realm[])e.eventArgs[0]);
             break;
         case EventType.EVENT_CHARLIST:
             HandleCharlist((Character[])e.eventArgs[0]);
             break;
         case EventType.EVENT_LOG:
             mainDisplay.Add((String)e.eventArgs[0]+"\n\r");
             mainDisplay.Refresh();
             Console.ForegroundColor = ConsoleColor.Gray;
             break;
         case EventType.EVENT_CHAT_MSG:
             HandleChatMsg((ChatMsg)e.eventArgs[0], (string)e.eventArgs[1], (string)e.eventArgs[2], (string)e.eventArgs[3]);
             break;
         case EventType.EVENT_ERROR:
             //MessageBox.Show((string)e.eventArgs[0], "Error!");
             break;
         case EventType.EVENT_DISCONNECT:
             //HandleDisconnect();
             break;
     }
 }
Пример #2
0
        public void EventHandler(Event e)
        {
            switch (e.eventType)
            {
                case EventType.EVENT_REALMLIST:
                    HandleRealmlist((Realm[])e.eventArgs[0]);
                    break;
                case EventType.EVENT_CHARLIST:
                    HandleCharlist((Character[])e.eventArgs[0]);
                    break;
                case EventType.EVENT_LOG:
                    HandleLog((string)e.eventArgs[0]);
                    break;
                case EventType.EVENT_CHAT_MSG:
                    HandleChatMsg((ChatMsg)e.eventArgs[0], (string)e.eventArgs[1],(string)e.eventArgs[2], (string)e.eventArgs[3]);
                    break;
                case EventType.EVENT_ERROR:
                    MessageBox.Show((string)e.eventArgs[0], "Error!");
                    break;
                case EventType.EVENT_DISCONNECT:
                    HandleDisconnect();
                    break;

            }
        }
Пример #3
0
 // Event Handler
 public static void EventHandler(Event e)
 {
     if (test.InvokeRequired)
         test.Invoke(new EventInvoke(EventHandler), new object[1] { e });
     else
         test.EventHandler(e);
 }
Пример #4
0
 // Event Handler
 public static void EventHandler(Event e)
 {
     EventHandle(e);
 }
Пример #5
0
 public static void SendError(string msg)
 {
     Event m2 = new Event(EventType.EVENT_ERROR, "0", new object[1] { msg });
     Event(m2);
 }
Пример #6
0
        public static CallBackEvent Event; // For sending events to the UI

        #endregion Fields

        #region Methods

        public static void Debug()
        {
            Event m2 = new Event(EventType.EVENT_LOG, "0", new object[0]);
            Event(m2);
        }