コード例 #1
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);
        }
コード例 #2
0
        public static bool CheckReserveOnRec(List <ReserveData> itemlist, string description)
        {
            if (Settings.Instance.CautionOnRecChange == false)
            {
                return(true);
            }
            int cMin = Settings.Instance.CautionOnRecMarginMin;

            List <string> list = itemlist.Select(item => CommonManager.Instance.DB.ReserveList.ContainsKey(item.ReserveID) == false ? item : CommonManager.Instance.DB.ReserveList[item.ReserveID])
                                 .Where(item => item.IsEnabled == true && item.OnTime(DateTime.UtcNow.AddHours(9).AddMinutes(cMin)) >= 0)
                                 .Select(item => new ReserveItem(item).StartTime + " " + item.Title).ToList();

            if (list.Count == 0)
            {
                return(true);
            }

            string text = string.Format("録画中または{0}分以内に録画開始される予約が含まれています。\r\n"
                                        + "処理を続けますか?\r\n\r\n"
                                        + "[該当予約数: {1}]\r\n\r\n", cMin, list.Count)
                          + CmdExeUtil.FormatTitleListForDialog(list);

            return(MessageBox.Show(text, "[予約" + description + "]の確認", MessageBoxButton.OKCancel,
                                   MessageBoxImage.Question, MessageBoxResult.Cancel) == MessageBoxResult.OK);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: MenuUtil.cs プロジェクト: nekopanda/EDCB
        public static bool CheckReserveOnRec(List <ReserveData> itemlist, string description)
        {
            if (Settings.Instance.CautionOnRecChange == false)
            {
                return(true);
            }
            int cMin = Settings.Instance.CautionOnRecMarginMin;

            List <string> list = itemlist.Where(item => item.IsEnabled == true && item.IsOnRec(cMin) == true)
                                 .Select(item => new ReserveItem(item).StartTime + " " + item.Title).ToList();

            if (list.Count == 0)
            {
                return(true);
            }

            string text = string.Format("録画中または{0}分以内に録画開始される予約が含まれています。\r\n"
                                        + "処理を続けますか?\r\n\r\n"
                                        + "[該当予約数: {1}]\r\n\r\n", cMin, list.Count)
                          + CmdExeUtil.FormatTitleListForDialog(list);

            return(MessageBox.Show(text, "[予約" + description + "]の確認", MessageBoxButton.OKCancel,
                                   MessageBoxImage.Exclamation, MessageBoxResult.Cancel) == MessageBoxResult.OK);
        }