protected override void mc_ChangeRecSetting(object sender, ExecutedRoutedEventArgs e) { if (mcc_chgRecSetting(e) == false) { return; } IsCommandExecuted = MenuUtil.ReserveChange(dataList); }
protected override void mc_ChgBulkRecSet(object sender, ExecutedRoutedEventArgs e) { var mList = dataList.FindAll(info => info.IsEpgReserve == false); if (MenuUtil.ChangeBulkSet(dataList, this.Owner, mList.Count == dataList.Count) == false) { return; } IsCommandExecuted = MenuUtil.ReserveChange(dataList); }
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(); } }
private void reserve_add_chg(ExecutedRoutedEventArgs e, int proc) { try { if (CheckReserveChange(e, proc) == false) { return; } var resInfo = reserveInfo.DeepClone(); if (resModeProgram == true) { if (GetReserveTimeInfo(ref resInfo) == -2) { MessageBox.Show("終了日時が開始日時より前です"); return; } //サービスや時間が変わったら、個別予約扱いにする。タイトルのみ変更は見ない。 if (resInfo.EventID != 0xFFFF || reserveInfo.IsSamePg(resInfo) == false) { resInfo.EventID = 0xFFFF; resInfo.ReleaseAutoAdd(); } } else { //EPG予約に変える場合、またはEPG予約で別の番組に変わる場合 if (eventInfoNow != null && (reserveInfo.IsManual == true || reserveInfo.IsSamePg(eventInfoNow) == false)) { //基本的にAddReserveEpgWindowと同じ処理内容 if (MenuUtil.CheckReservable(CommonUtil.ToList(eventInfoNow)) == null) { return; } eventInfoNow.ConvertToReserveData(ref resInfo); resInfo.ReleaseAutoAdd(); } } if (checkBox_releaseAutoAdd.IsChecked == true) { resInfo.ReleaseAutoAdd(); } resInfo.RecSetting = recSettingView.GetRecSetting(); bool ret = false; HashSet <uint> oldset = null; if (proc == 0) { resInfo.Comment = ""; oldset = new HashSet <uint>(CommonManager.Instance.DB.ReserveList.Keys); ret = MenuUtil.ReserveAdd(CommonUtil.ToList(resInfo)); StatusManager.StatusNotifySet(ret, "録画予約を追加"); } else { ret = MenuUtil.ReserveChange(CommonUtil.ToList(resInfo)); StatusManager.StatusNotifySet(ret, "録画予約を変更"); } if (ret == false) { return; } if (KeepWin == false) { this.Close(); return; } if (proc == 0) { var list = new List <ReserveData>(); CommonManager.CreateSrvCtrl().SendEnumReserve(ref list); var newlist = list.Where(rs => oldset.Contains(rs.ReserveID) == false).ToList(); if (newlist.Count == 1) { ChangeData(newlist[0]); } } SetReserveTabHeader(false); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
private void button_chg_reserve_Click(object sender, ExecutedRoutedEventArgs e) { try { if (CmdExeUtil.IsDisplayKgMessage(e) == true) { bool change_proc = false; switch (addMode) { case AddMode.Add: change_proc = (MessageBox.Show("予約を追加します。\r\nよろしいですか?", "予約の確認", MessageBoxButton.OKCancel) == MessageBoxResult.OK); break; case AddMode.Re_Add: change_proc = (MessageBox.Show("この内容で再予約します。\r\nよろしいですか?", "再予約の確認", MessageBoxButton.OKCancel) == MessageBoxResult.OK); break; case AddMode.Change: change_proc = (MessageBox.Show("この予約を変更します。\r\nよろしいですか?", "変更の確認", MessageBoxButton.OKCancel) == MessageBoxResult.OK); break; } if (change_proc == false) { return; } } if (addMode == AddMode.Change && CheckExistReserveItem() == false) { return; } //ダイアログを閉じないときはreserveInfoを変更しないよう注意する if (ReserveMode == UIReserveMode.Program) { var resInfo = new ReserveData(); if (GetReserveTimeInfo(ref resInfo) == -2) { MessageBox.Show("終了日時が開始日時より前です"); return; } //reserveInfo取得前に保存する。サービスや時間が変わったら、個別予約扱いにする。タイトルのみ変更は見ない。 bool chgManualMode = !CtrlCmdDefEx.EqualsPg(resInfo, reserveInfo, false, true); GetReserveTimeInfo(ref reserveInfo); if (reserveInfo.EventID != 0xFFFF || chgManualMode == true) { reserveInfo.EventID = 0xFFFF; reserveInfo.Comment = ""; } reserveInfo.StartTimeEpg = reserveInfo.StartTime; } else if (ReserveMode == UIReserveMode.EPGManual) { //EPG予約に変える場合、またはEPG予約で別の番組に変わる場合 if (eventInfoNew != null) { //基本的にAddReserveEpgWindowと同じ処理内容 if (MenuUtil.IsEnableReserveAdd(eventInfoNew) == false) { return; } eventInfoNew.ConvertToReserveData(ref reserveInfo); reserveInfo.Comment = ""; } // 自動予約から個別予約に変える場合 else if (GetReserveModeFromInfo() == UIReserveMode.EPGAuto) { reserveInfo.Comment = ""; } } reserveInfo.RecSetting = recSettingView.GetRecSetting(); if (addMode == AddMode.Change) { bool ret = MenuUtil.ReserveChange(CommonUtil.ToList(reserveInfo)); CommonManager.Instance.StatusNotifySet(ret, "録画予約を変更"); } else { bool ret = MenuUtil.ReserveAdd(CommonUtil.ToList(reserveInfo)); CommonManager.Instance.StatusNotifySet(ret, "録画予約を追加"); } // EPG自動予約以外になったら戻せないようにしておく if (ReserveMode != UIReserveMode.EPGAuto) { CanSelectAutoAdd = false; } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } DialogResult = true; }