Exemple #1
0
 private void Alarm(string balloonTitle, string balloonMessage, string name)
 {
     if (Check(name, NotificationType.FlashWindow))
     {
         _method.FlashWindow();
     }
     if (Check(name, NotificationType.ShowBaloonTip))
     {
         _method.ShowToaster(balloonTitle, balloonMessage);
     }
     if (Check(name, NotificationType.PlaySound))
     {
         _method.PlaySound(Context.Config.Sounds[name], Context.Config.Sounds.Volume);
     }
     if (Context.Config.Pushbullet.On && CheckPush(name))
     {
         Task.Run(() =>
         {
             PushNotification.PushToPushbullet(Context.Config.Pushbullet.Token, balloonTitle,
                                               balloonMessage);
         });
     }
     if (Context.Config.Pushover.On && CheckPush(name))
     {
         Task.Run(() =>
         {
             PushNotification.PushToPushover(Context.Config.Pushover.ApiKey, Context.Config.Pushover.UserKey,
                                             balloonTitle, balloonMessage);
         });
     }
 }
Exemple #2
0
 private void buttonPushbulletTest_Click(object sender, EventArgs e)
 {
     try
     {
         PushNotification.PushToPushbullet(textBoxPushbulletToken.Text, "KancolleSniffer", "うまくいったかな?");
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "Pushbulletエラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }