/// <summary>
        /// Handles the tray event if the active window responds to any of the flag
        /// Only one event should be passed in at a time!
        /// </summary>
        /// <param name="flags"></param>
        public void handleTrayEvent(TrayFlags.PopValues flag, User targUser = null, string keyword = null)
        {
            if (!SettingsManager.getMgr().isNotifyEnabled(flag)) return;

            foreach (Window w in activeWindow)
            {
                if (!TrayFlags.handlesEvent(w, flag))
                {
                    log.Info("Received event: " + flag.ToString() + ". Ignoring - " + activeWindow.ToString() + " does not accept event");
                    continue;
                }

                

                currEvent = flag;
                this.targUser = targUser;
                this.keyword = keyword;

                string message = TrayFlags.trayLang[currEvent];
                message = message.Replace("#", targUser.Name);
                message = message.Replace("$", keyword);

                log.Info("Recieved tray event: " + flag.ToString() + ", with targUser: "******", message: " + message);

                kIcon.ShowBalloonTip("Kaillera Event", message, BalloonIcon.Info);
                return;
            }
        }
Example #2
0
 internal bool isNotifyEnabled(TrayFlags.PopValues flag)
 {
     if(!flagFunctor.ContainsKey(flag)) return false;
     return flagFunctor[flag].Invoke();
 }