コード例 #1
0
 /// <summary>
 ///   Writes a message using the specified channel.
 /// </summary>
 /// <param name="message">the message to write</param>
 public void Write(string message)
 {
     log.Debug(message);
     // New system that dispatches events using the ui event system
     GenericEventArgs eventArgs = new GenericEventArgs();
     eventArgs.eventType = "CHAT_MSG_SYSTEM";
     eventArgs.eventArgs = new string[2];
     eventArgs.eventArgs[0] = message;
     eventArgs.eventArgs[1] = string.Empty;
     UiSystem.DispatchEvent(eventArgs);
 }
コード例 #2
0
 public static void DispatchEvent(GenericEventArgs eventArgs)
 {
     string eventName = eventArgs.eventType;
     if (!eventRegistry.ContainsKey(eventName))
         return;
     List<Frame> subscribers = eventRegistry[eventName];
     foreach (Frame frame in subscribers) {
         try {
             frame.OnEvent(eventArgs);
         } catch (Exception ex) {
             LogUtil.ExceptionLog.WarnFormat("Exception in frame event handler: {0}", ex);
         }
     }
 }
コード例 #3
0
        /// <summary>
        ///   This method is called when the player enters the world.
        ///   Generally this only happens when the player logs in.
        ///   This injects 'PLAYER_ENTERING_WORLD' and 'UNIT_NAME_UPDATE' 
        ///   UI events so that any interested widgets can update their data.
        /// </summary>
        public void PlayerEnteringWorld()
        {
            GenericEventArgs eventArgs;
            eventArgs = new GenericEventArgs();
            eventArgs.eventType = "PLAYER_ENTERING_WORLD";
            UiSystem.DispatchEvent(eventArgs);

            eventArgs = new GenericEventArgs();
            eventArgs.eventType = "UNIT_NAME_UPDATE";
            eventArgs.eventArgs = new string[1];
            eventArgs.eventArgs[0] = "player";
            UiSystem.DispatchEvent(eventArgs);
        }