/// <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; } }
internal bool isNotifyEnabled(TrayFlags.PopValues flag) { if (!flagFunctor.ContainsKey(flag)) { return(false); } return(flagFunctor[flag].Invoke()); }
/// <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; }
/// <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; } }
/// <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; }