예제 #1
0
        /// <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;
            }
        }
예제 #2
0
 internal bool isNotifyEnabled(TrayFlags.PopValues flag)
 {
     if (!flagFunctor.ContainsKey(flag))
     {
         return(false);
     }
     return(flagFunctor[flag].Invoke());
 }
예제 #3
0
        /// <summary>
        /// Handles the click on the tray button
        /// Maximizes current windows
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void handleTrayClick(object sender, RoutedEventArgs e)
        {
            //Fire tray click event
            if (trayClicked != null)
            {
                trayClicked();
            }

            if (currEvent != TrayFlags.PopValues.None)
            {
                foreach (var wind in activeWindow)
                {
                    if (TrayFlags.handlesEvent(wind, currEvent))
                    {
                        wind.Visibility  = Visibility.Visible;
                        wind.WindowState = WindowState.Normal;
                        wind.Show();
                    }
                }
            }
            currEvent = TrayFlags.PopValues.None;
        }
예제 #4
0
        /// <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;
            }
        }
예제 #5
0
        /// <summary>
        /// Handles the click on the tray button
        /// Maximizes current windows 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void handleTrayClick(object sender, RoutedEventArgs e)
        {
            //Fire tray click event
            if(trayClicked != null)
                trayClicked();

            if (currEvent != TrayFlags.PopValues.None)
            {
                foreach (var wind in activeWindow)
                {
                    if (TrayFlags.handlesEvent(wind, currEvent))
                    {                      
                            wind.Visibility = Visibility.Visible;
                            wind.WindowState = WindowState.Normal;
                            wind.Show();                        
                    }
                }
            }
            currEvent = TrayFlags.PopValues.None;
        }