/// <summary> /// Wacotsuが座席確保に失敗した時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void wacotsu_Failed(object sender, Wacotsu.FailedEventArgs e) { string message = null; switch (e.FailReason) { case NiconicoApi.Live.StatusErrorReason.Closed: message = "すでに終了した放送です"; break; case NiconicoApi.Live.StatusErrorReason.NoAuth: message = "この放送を視聴するには特別な認証が必要です"; break; case NiconicoApi.Live.StatusErrorReason.NotFound: message = "放送が見つかりませんでした"; break; case NiconicoApi.Live.StatusErrorReason.NotLogin: message = "ログイン状態が解除されていて放送の情報を取得できません。\r\n標準のブラウザでニコニコ動画にログインしてからもう一度このアプリを再起動してください"; break; case NiconicoApi.Live.StatusErrorReason.RequireCommunityMember: message = "この放送を視聴するにはコミュニティに入会する必要があります"; break; default: message = "原因不明のエラーです"; break; } MessageBox.Show(message); reservedLiveListView.Items.RemoveByKey(e.LiveId); }
/// <summary> /// Wacotsuが座席確保に成功した時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void wacotsu_Success(object sender, Wacotsu.SuccessEventArgs e) { var liveInfo = liveInfos[e.LiveId]; Invoke((MethodInvoker)delegate() { // バルーンチップ&音声通知 if (ballonTipEnabledCheckBox.Checked) { System.Media.SystemSounds.Beep.Play(); var tipTitle = string.Format("<<座席確保>>{0}", liveInfo.Title); var tipDescription = e.LiveStatus.ToString(); notifyIcon.ShowBalloonTip(3000, tipTitle, tipDescription, ToolTipIcon.Info); } // ブラウザで開く browser.Open(liveInfo.WatchUri); // 確保成功リストに移動する var itemText = string.Format("<<{0}>>\r\n{1}", e.LiveStatus, liveInfo.Title); succeededLiveListView.Items.Add(e.LiveId, itemText, e.LiveId); reservedLiveListView.Items.RemoveByKey(e.LiveId); }); }