protected virtual int CheckAutoAddChange(ExecutedRoutedEventArgs e, int proc) { if (proc != 3) { if (CmdExeUtil.IsMessageBeforeCommand(e) == true) { if (MessageBox.Show(AutoAddString + "を" + cmdMsg[proc] + "します。\r\nよろしいですか?", cmdMsg[proc] + "の確認", MessageBoxButton.OKCancel) != MessageBoxResult.OK) { return(-2); } } } else { if (CmdExeUtil.CheckAllProcCancel(e, autoAddData.IntoList(), true) == true) { return(-1); } } if (proc != 0) { if (autoAddData == null) { MessageBox.Show("項目がありません。\r\n" + "既に削除されています。", "データエラー", MessageBoxButton.OK, MessageBoxImage.Exclamation); SetViewMode(AutoAddMode.NewAdd); return(1); } } return(0); }
public static bool CheckAllProcCancel(ExecutedRoutedEventArgs e, IEnumerable <AutoAddData> dataList, bool IsDelete) { if (CmdExeUtil.IsMessageBeforeCommand(e) == false) { return(false); } List <string> titleList = dataList.Where(info => info != null).Select(info => info.DataTitle).ToList(); if (titleList.Count == 0) { return(false); } var s = IsDelete == true ? new string[] { "予約ごと削除して", "削除", "削除される予約数", "予約ごと削除" } : new string[] { "予約の録画設定を自動登録の録画設定に合わせても", "処理", "対象予約数", "予約の録画設定変更" }; var text = string.Format("{0}よろしいですか?\r\n" + "(個別予約も処理の対象となります。)\r\n\r\n" + "[{1}項目数: {2}]\r\n" + "[{3}: {4}]\r\n\r\n", s[0], s[1], titleList.Count, s[2], dataList.GetReserveList().Count) + CmdExeUtil.FormatTitleListForDialog(titleList); return(MessageBox.Show(text, "[" + s[3] + "]の確認", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation, MessageBoxResult.OK) != MessageBoxResult.OK); }
public static bool CheckAllDeleteCancel(ExecutedRoutedEventArgs e, int Count) { if (CmdExeUtil.IsMessageBeforeCommand(e) == false) { return(false); } return(MessageBox.Show(string.Format( "全て削除しますか?\r\n" + "[削除項目数: {0}]", Count) , "[全削除]の確認", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation, MessageBoxResult.OK) != MessageBoxResult.OK); }
protected override void mc_SetNotKey(object sender, ExecutedRoutedEventArgs e) { if (CmdExeUtil.IsMessageBeforeCommand(e) == true) { var text = string.Format("Notキーを変更してよろしいですか?\r\n\r\n" + "[変更項目数: {0}]\r\n[貼り付けテキスト: \"{1}\"]\r\n\r\n", dataList.Count, Clipboard.GetText()) + CmdExeUtil.FormatTitleListForDialog(dataList.Select(info => info.searchInfo.andKey).ToList()); if (MessageBox.Show(text.ToString(), "[Notキーワード変更]の確認", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation, MessageBoxResult.OK) != MessageBoxResult.OK) { return; } } IsCommandExecuted = MenuUtil.EpgAutoAddChangeNotKey(dataList); }
protected virtual bool CheckReserveChange(ExecutedRoutedEventArgs e, int proc) { if (CmdExeUtil.IsMessageBeforeCommand(e) == true) { if (MessageBox.Show("予約を" + cmdMsg[proc] + "します。\r\nよろしいですか?", cmdMsg[proc] + "の確認", MessageBoxButton.OKCancel) != MessageBoxResult.OK) { return(false); } } if (proc != 0) { if (CheckExistReserveItem() == false) { return(false); } } return(true); }
private void reserve_proc(ExecutedRoutedEventArgs e, int proc) { if (CmdExeUtil.IsMessageBeforeCommand(e) == true) { if (MessageBox.Show("予約を" + cmdMsg[proc] + "します。\r\nよろしいですか?", cmdMsg[proc] + "の確認", MessageBoxButton.OKCancel) != MessageBoxResult.OK) { return; } } bool ret = false; if (proc == 0) { ret = MenuUtil.ReserveAdd(CommonUtil.ToList(eventInfo), recSettingView); } else { List <ReserveData> list = GetReserveList(); if (proc == 1) { RecSettingData recSet = recSettingView.GetRecSetting(); list.ForEach(data => data.RecSetting = recSet); ret = MenuUtil.ReserveChange(list); } else { ret = MenuUtil.ReserveDelete(list); } } StatusManager.StatusNotifySet(ret, "録画予約を" + cmdMsg[proc]); if (ret == false) { return; } if (KeepWin == false) { this.Close(); } }