Beispiel #1
0
        //proc 0:追加、1:変更、2:削除、3:予約ごと削除
        protected override int CheckAutoAddChange(ExecutedRoutedEventArgs e, int proc)
        {
            int ret = base.CheckAutoAddChange(e, proc);

            //データの更新。最初のキャンセルを過ぎていたら画面を更新する。
            if (ret >= 0)
            {
                SearchPg();
            }

            if (ret != 0)
            {
                return(ret);
            }

            if (proc < 2 && Settings.Instance.CautionManyChange == true && searchKeyView.checkBox_keyDisabled.IsChecked != true)
            {
                if (MenuUtil.CautionManyMessage(lstCtrl.dataList.GetNoReserveList().Count, "予約追加の確認") == false)
                {
                    return(2);
                }
            }

            return(0);
        }
Beispiel #2
0
        //proc 0:追加、1:変更、2:削除
        private bool CheckAutoAddChange(ExecutedRoutedEventArgs e, int proc)
        {
            if (CmdExeUtil.IsDisplayKgMessage(e) == true)
            {
                var strMode = new string[] { "追加", "変更", "削除" }[proc];
                if (MessageBox.Show("キーワード予約登録を" + strMode + "します。\r\nよろしいですか?", strMode + "の確認", MessageBoxButton.OKCancel) != MessageBoxResult.OK)
                {
                    return(false);
                }
            }

            //データの更新。最初のキャンセルを過ぎたら画面を更新する。
            SearchPg();

            if (proc != 0)
            {
                if (CommonManager.Instance.DB.EpgAutoAddList.ContainsKey(this.autoAddID) == false)
                {
                    MessageBox.Show("項目がありません。\r\n" + "既に削除されています。\r\n" + "(別のEpgtimerによる操作など)", "データエラー", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    SetViewMode(SearchMode.NewAdd);
                    this.autoAddID = 0;
                    return(false);
                }
            }

            if (proc != 2 && Settings.Instance.CautionManyChange == true && searchKeyView.searchKeyDescView.checkBox_keyDisabled.IsChecked != true)
            {
                if (MenuUtil.CautionManyMessage(lstCtrl.dataList.GetNoReserveList().Count, "予約追加の確認") == false)
                {
                    return(false);
                }
            }

            return(true);
        }
        private void mc_Delete(object sender, ExecutedRoutedEventArgs e)
        {
            if (listView_result.SelectedItem == null)
            {
                return;
            }
            //
            List <IRecWorkMainData> dataList = lstCtrl.GetSelectedItemsList().Select(data => data.Data).ToList();

            dataList.RemoveAll(d => d is RecFileInfo && (d as RecFileInfo).ProtectFlag != 0);

            if (CmdExeUtil.CheckDeleteCancel(e, dataList) == true)
            {
                return;
            }

            if (CmdExeRecinfo.mcs_DeleteCheckDelFile(dataList.OfType <RecFileInfo>()) == false)
            {
                return;
            }

            if (MenuUtil.CautionManyMessage(dataList.Count, "削除の確認") == false)
            {
                return;
            }

            MenuUtil.ReserveDelete(dataList.OfType <ReserveData>().ToList(), false);
            MenuUtil.RecinfoDelete(dataList.OfType <RecFileInfo>().ToList(), false);
            MenuUtil.AutoAddDelete(dataList.OfType <AutoAddData>().ToList(), false);

            StatusManager.StatusNotifySet(true, mc.GetCmdMessageFormat("削除を実行", dataList.Count));
        }
Beispiel #4
0
        protected override void mc_ChangeOnOff(object sender, ExecutedRoutedEventArgs e)
        {
            //多数アイテム処理の警告。合計数に対して出すので、結構扱いづらい。
            if (MenuUtil.CautionManyMessage(this.itemCount, "簡易予約/有効←→無効") == false)
            {
                return;
            }

            if (MenuUtil.ReserveChangeOnOff(dataList, this.recSettingView, false) == false)
            {
                return;
            }
            IsCommandExecuted = MenuUtil.ReserveAdd(eventListEx, this.recSettingView, 0, false);
        }
Beispiel #5
0
        protected override void mc_ChangeOnOff(object sender, ExecutedRoutedEventArgs e)
        {
            //多数アイテム処理の警告。合計数に対して出すので、結構扱いづらい。
            if (MenuUtil.CautionManyMessage(dataList.Count + eventListEx.Count, "簡易予約/有効←→無効") == false)
            {
                return;
            }

            bool ret1  = MenuUtil.ReserveChangeOnOff(dataList, false);
            var  eList = dataList.Count == 0 ? eventListEx :
                         HasList == true?eventListEx.FindAll(data => data.IsReservable == true) : new List <EpgEventInfo>();

            bool ret2 = MenuUtil.ReserveAdd(eList, GetRecSetting(), 0, false);

            IsCommandExecuted = !(ret1 == false && ret2 == false || dataList.Count == 0 && ret2 == false || eventListEx.Count == 0 && ret1 == false);
        }
        private void mc_ChgOnOff(object sender, ExecutedRoutedEventArgs e)
        {
            if (listView_result.SelectedItem == null)
            {
                return;
            }
            //
            List <IRecWorkMainData> dataList = lstCtrl.GetSelectedItemsList().Select(data => data.Data).ToList();

            if (MenuUtil.CautionManyMessage(dataList.Count, "変更の確認") == false)
            {
                return;
            }

            MenuUtil.ReserveChangeOnOff(dataList.OfType <ReserveData>().DeepClone(), null, false);
            MenuUtil.RecinfoChgProtect(dataList.OfType <RecFileInfo>().DeepClone(), false);
            MenuUtil.AutoAddChangeKeyEnabled(dataList.OfType <AutoAddData>().DeepClone());

            StatusManager.StatusNotifySet(true, mc.GetCmdMessageFormat("状態切替を実行", dataList.Count));
        }
        private void mc_SetRecTag(object sender, ExecutedRoutedEventArgs e)
        {
            if (listView_result.SelectedItem == null)
            {
                return;
            }
            //
            List <IRecWorkMainData> dataList = lstCtrl.GetSelectedItemsList().Select(data => data.Data).Where(data => data is IRecSetttingData).ToList();

            if (CmdExeUtil.CheckSetFromClipBoardCancel(e, dataList, "録画タグ") == true)
            {
                return;
            }

            if (MenuUtil.CautionManyMessage(dataList.Count, "変更の確認") == false)
            {
                return;
            }

            MenuUtil.ReserveChangeRecTag(dataList.OfType <ReserveData>().DeepClone(), Clipboard.GetText(), false);
            MenuUtil.AutoAddChangeRecTag(dataList.OfType <AutoAddData>().DeepClone(), Clipboard.GetText(), false);

            StatusManager.StatusNotifySet(true, mc.GetCmdMessageFormat("状態切替を実行", dataList.Count));
        }