private void MoveViewRecinfoTarget() { //一覧以外では「前へ」「次へ」の移動の時に追従させる if (DataView is EpgViewBase) { //BeginInvokeはフォーカス対応 MenuUtil.CheckJumpTab(new ReserveItem(recInfo.ToReserveData()), true); Dispatcher.BeginInvoke(new Action(() => { DataView.MoveToRecInfoItem(recInfo); }), DispatcherPriority.Loaded); } else { UpdateViewSelection(3); } }
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 void mc_RestoreItem(object sender, ExecutedRoutedEventArgs e) { int count = 0; int id = CmdExeUtil.ReadIdData(e); try//Historysは操作以外で削除されないが、直接実行なので念のため { count = CmdHistorys.Historys[id].Items.Count; IsCommandExecuted = true == MenuUtil.RecWorkMainDataAdd(CmdHistorys.Historys[id].Items); if (IsCommandExecuted == true) { CmdHistorys.Historys.RemoveAt(id); } } catch { } StatusManager.StatusNotifySet(IsCommandExecuted, GetCmdMessageFormat("アイテムの復元", count)); }
protected override void mc_Delete(object sender, ExecutedRoutedEventArgs e) { if (e.Command == EpgCmds.DeleteAll) { if (CmdExeUtil.CheckAllDeleteCancel(e, dataList.Count) == true) { return; } } else { if (CmdExeUtil.CheckKeyboardDeleteCancel(e, dataList.Select(data => data.DataTitle).ToList()) == true) { return; } } IsCommandExecuted = MenuUtil.AutoAddDelete(dataList); }
protected bool mcc_chgRecSetting(ExecutedRoutedEventArgs e) { List <RecSettingData> infoList = dataList.OfType <IRecSetttingData>().RecSettingList(); if (e.Command == EpgCmds.ChgOnPreset) { MenuUtil.ChangeOnPreset(dataList.OfType <IRecSetttingData>(), CmdExeUtil.ReadIdData(e, 0, 0xFE)); } else if (e.Command == EpgCmds.ChgRecmode) { MenuUtil.ChangeRecmode(infoList, (byte)CmdExeUtil.ReadIdData(e, 0, 5)); } else if (e.Command == EpgCmds.ChgPriority) { MenuUtil.ChangePriority(infoList, (byte)CmdExeUtil.ReadIdData(e, 1, 5)); } else if (e.Command == EpgCmds.ChgRelay) { MenuUtil.ChangeRelay(infoList, (byte)CmdExeUtil.ReadIdData(e, 0, 1)); } else if (e.Command == EpgCmds.ChgPittari) { MenuUtil.ChangePittari(infoList, (byte)CmdExeUtil.ReadIdData(e, 0, 1)); } else if (e.Command == EpgCmds.ChgTuner) { MenuUtil.ChangeTuner(infoList, (uint)CmdExeUtil.ReadIdData(e, 0, int.MaxValue - 1)); } else if (e.Command == EpgCmds.ChgMarginStart) { int?offset = CmdExeUtil.ReadIdData(e); MenuUtil.ChangeMargin(infoList, offset == 0, offset, null, true); } else if (e.Command == EpgCmds.ChgMarginEnd) { int?offset = CmdExeUtil.ReadIdData(e); MenuUtil.ChangeMargin(infoList, offset == 0, null, offset, true); } else if (e.Command == EpgCmds.ChgMarginValue) { return(MenuUtil.ChangeMarginValue(infoList, CmdExeUtil.ReadIdData(e, 0, 2) == 1, this.Owner)); } return(true); }
protected override void mc_Delete(object sender, ExecutedRoutedEventArgs e) { List <ReserveData> resList = dataList.ToList(); if (e.Command == EpgCmds.DeleteAll) { recinfoList.Clear(); } recinfoList = recinfoList.GetNoProtectedList(); dataList.AddRange(recinfoList.Select(info => new ReserveDataEnd { Title = "[録画済み] " + info.Title })); if (mcs_DeleteCheck(e) == false || CmdExeRecinfo.mcs_DeleteCheckDelFile(recinfoList) == false) { return; } IsCommandExecuted = MenuUtil.ReserveDelete(resList) && MenuUtil.RecinfoDelete(recinfoList); }
protected override void mc_Delete(object sender, ExecutedRoutedEventArgs e) { dataList = dataList.GetNoProtectedList(); if (mcs_DeleteCheck(e) == false) { return; } if (IniFileHandler.GetPrivateProfileInt("SET", "RecInfoDelFile", 0, SettingPath.CommonIniPath) == 1) { if (MessageBox.Show("録画ファイルが存在する場合は一緒に削除されます。\r\nよろしいですか?", "ファイル削除", MessageBoxButton.OKCancel) != MessageBoxResult.OK) { return; } } IsCommandExecuted = MenuUtil.RecinfoDelete(dataList); }
private void button_add_reserve_Click(object sender, ExecutedRoutedEventArgs e) { if (CmdExeUtil.IsDisplayKgMessage(e) == true) { if (MessageBox.Show("予約を追加します。\r\nよろしいですか?", "追加の確認", MessageBoxButton.OKCancel) != MessageBoxResult.OK) { return; } } bool ret = MenuUtil.ReserveAdd(CommonUtil.ToList(eventInfo), recSettingView); CommonManager.Instance.StatusNotifySet(ret, "録画予約を追加"); if (ret == false) { return; } DialogResult = 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(); } }
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 button_del_epgAutoAdd_Click(object sender, ExecutedRoutedEventArgs e) { bool ret = false; try { ret = CheckAutoAddChange(e, 2); if (ret == true) { ret = MenuUtil.AutoAddDelete(CommonUtil.ToList(CommonManager.Instance.DB.EpgAutoAddList[autoAddID])); if (ret == true) { SetViewMode(SearchMode.NewAdd); this.autoAddID = 0; } } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } CommonManager.Instance.StatusNotifySet(ret, "キーワード予約を削除", this); }
private void button_del_reserve_Click(object sender, ExecutedRoutedEventArgs e) { if (CmdExeUtil.IsDisplayKgMessage(e) == true) { if (MessageBox.Show("この予約を削除します。\r\nよろしいですか?", "削除の確認", MessageBoxButton.OKCancel) != MessageBoxResult.OK) { return; } } if (CheckExistReserveItem() == false) { return; } bool ret = MenuUtil.ReserveDelete(CommonUtil.ToList(reserveInfo)); CommonManager.Instance.StatusNotifySet(ret, "録画予約を削除"); DialogResult = true; }
protected override void SetData(bool IsAllData = false) { base.SetData(IsAllData); if (HasList == true)//SearchItemリストがある場合 { List <SearchItem> searchList = _getSearchList(IsAllData); searchList = searchList == null ? new List <SearchItem>() : searchList.OfType <SearchItem>().ToList();//無くても大丈夫なはずだが一応 OrderAdjust(searchList); dataList = searchList.GetReserveList(); eventList = searchList.GetEventList(); eventListEx = searchList.GetNoReserveList(); headData = searchList.Count == 0 ? null : searchList[0].IsReserved == true ? searchList[0].ReserveInfo as IAutoAddTargetData : searchList[0].EventInfo; headDataEv = searchList.Count == 0 ? null : searchList[0].EventInfo; recinfoList = eventList.SelectMany(data => MenuUtil.GetRecFileInfoList(data)).ToList(); headDataRec = MenuUtil.GetRecFileInfo(eventList.FirstOrDefault()); } else { //終了済み録画データの処理 recinfoList = dataList.OfType <ReserveDataEnd>().SelectMany(data => MenuUtil.GetRecFileInfoList(data)).ToList(); headDataRec = recinfoList.FirstOrDefault(); dataList.RemoveAll(data => data is ReserveDataEnd); eventList = _getEpgEventList == null ? null : _getEpgEventList(); eventList = eventList == null ? new List <EpgEventInfo>() : eventList.OfType <EpgEventInfo>().ToList(); eventListEx = new List <EpgEventInfo>(); eventList.ForEach(epg => { if (dataList.All(res => epg.CurrentPgUID() != res.CurrentPgUID())) { eventListEx.Add(epg); } }); headData = dataList.Count != 0 ? dataList[0] as IAutoAddTargetData : eventList.Count != 0 ? eventList[0] : null; headDataEv = eventList.Count != 0 ? eventList[0] as IAutoAddTargetData : dataList.Count != 0 ? dataList[0] : null; } eventList = eventList.Distinct().ToList(); eventListEx = eventListEx.Distinct().ToList(); recinfoList = recinfoList.Distinct().ToList(); }
private void mc_ReSearch(object sender, ExecutedRoutedEventArgs e) { if (listView_result.SelectedItem == null) { return; } // string word = MenuUtil.TrimEpgKeyword(lstCtrl.SelectSingleItem().EventName, CmdExeUtil.IsKeyGesture(e)); if (e.Command == EpgCmds.ReSearch) { TextBox_SearchWord.Text = word; mc_Search(sender, e); } else { WriteWindowSaveData(); InfoSearchSettingData data = SearchInfo.DeepClone(); data.SearchWord = word; new InfoSearchWindow(data, noSearchSettingSave).Show(); } }
protected override void mcs_ctxmLoading_switch(ContextMenu ctxm, MenuItem menu) { base.mcs_ctxmLoading_switch(ctxm, menu); // // ジャンル登録 // if (menu.Tag == EpgCmds.SetGenre) { SearchWindow sw1 = Owner as SearchWindow; if (sw1.listView_result.SelectedItem != null) { SearchItem si1 = sw1.listView_result.SelectedItem as SearchItem; if (si1 != null && si1.EventInfo.ContentInfo != null) { MenuUtil.addGenre(menu, si1.EventInfo.ContentInfo.nibbleList, (contentKindInfo0) => { sw1.searchKeyView.setGenre(contentKindInfo0); }); } } } }
public List <EpgAutoAddData> SearchEpgAutoAddList(bool?IsEnabled = null, bool ByFazy = false) { var list = GetEpgAutoAddList(IsEnabled); if (IsEpgReserve == false) { //プログラム予約の場合はそれっぽい番組を選んで、キーワード予約の検索にヒットしていたら選択する。 EpgEventInfo trgInfo = this.SearchEventInfoLikeThat(); if (trgInfo != null) { list.AddRange(trgInfo.SearchEpgAutoAddList(IsEnabled, ByFazy)); } } else { if (ByFazy == true) { list.AddRange(MenuUtil.FazySearchEpgAutoAddData(DataTitle, IsEnabled)); } } return(list.Distinct().ToList()); }
public void CtxmGenerateOnPresetItems(MenuItem menu, ICommand icmd) { var delList = menu.Items.OfType <MenuItem>().Where(item => item.Command == icmd).ToList(); delList.ForEach(item => menu.Items.Remove(item)); if (menu.IsEnabled == false) { return; } foreach (var item in Settings.Instance.RecPresetList) { var menuItem = new MenuItem(); menuItem.Header = string.Format("プリセット(_{0}) : " + MenuUtil.ToAccessKeyForm(item.ToString()), ToAccessKey(item.ID)); menuItem.Command = icmd; menuItem.CommandParameter = new EpgCmdParam(menu.CommandParameter as EpgCmdParam); (menuItem.CommandParameter as EpgCmdParam).ID = item.ID; menuItem.Tag = menuItem.Command; menu.Items.Add(menuItem); } }
private void mc_Research(object sender, ExecutedRoutedEventArgs e) { try { if (listView_result.SelectedItem != null) { SearchItem item = lstCtrl.SelectSingleItem(); EpgSearchKeyInfo defKey = GetSearchKey(); defKey.andKey = MenuUtil.TrimEpgKeyword(item.EventName, CmdExeUtil.IsKeyGesture(e)); defKey.regExpFlag = 0; defKey.serviceList.Clear(); UInt64 sidKey = item.EventInfo.Create64Key(); defKey.serviceList.Add((Int64)sidKey); if (e.Command == EpgCmds.ReSearch) { SetSearchKey(defKey); SearchPg(); } else { var dlg = new SearchWindow(); dlg.SetViewMode(winMode == SearchMode.Change ? SearchMode.NewAdd : winMode); if (Settings.Instance.MenuSet.CancelAutoAddOff == true) { defKey.keyDisabledFlag = 0; } dlg.SetSearchKey(defKey); dlg.SetRecSetting(this.GetRecSetting()); dlg.Left = this.Left + 50; dlg.Top = this.Top + 25; dlg.checkBox_windowPinned.IsChecked = checkBox_windowPinned.IsChecked; dlg.Show(); } } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
private void button_add_epgAutoAdd_Click(object sender, ExecutedRoutedEventArgs e) { bool ret = false; try { ret = CheckAutoAddChange(e, 0); if (ret == true) { //一覧画面非表示の状態から実施する場合のためのコード if (autoAddView.IsVisible == false && CommonManager.Instance.DB.EpgAutoAddList.Count == 0) { CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.AutoAddEpgInfo); CommonManager.Instance.DB.ReloadEpgAutoAddInfo(); } List <uint> oldlist = CommonManager.Instance.DB.EpgAutoAddList.Keys.ToList(); ret = MenuUtil.AutoAddAdd(CommonUtil.ToList(this.GetAutoAddData())); if (ret == true) { //以降の処理をEpgTimerSrvからの更新通知後に実行すればReload減らせるが、トラブル増えそうなのでこのまま。 CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.AutoAddEpgInfo); CommonManager.Instance.DB.ReloadEpgAutoAddInfo(); List <uint> newlist = CommonManager.Instance.DB.EpgAutoAddList.Keys.ToList(); List <uint> diflist = newlist.Except(oldlist).ToList(); if (diflist.Count == 1) { ChangeAutoAddData(CommonManager.Instance.DB.EpgAutoAddList[diflist[0]], false); } } } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } CommonManager.Instance.StatusNotifySet(ret, "キーワード予約を追加", this); }
public EpgEventInfo SearchEventInfo(bool getSrv = false) { EpgEventInfo eventInfo = null; try { if (IsEpgReserve == true) { eventInfo = MenuUtil.SearchEventInfo(this.Create64PgKey()); if (eventInfo == null && getSrv == true) { eventInfo = new EpgEventInfo(); CommonManager.CreateSrvCtrl().SendGetPgInfo(Create64PgKey(), ref eventInfo); } } else { eventInfo = SearchEventInfoLikeThat(); } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } return(eventInfo); }
protected override void mc_ToAutoadd(object sender, ExecutedRoutedEventArgs e) { ReserveData resData = null; if (eventList.Count != 0) { resData = CtrlCmdDefEx.ConvertEpgToReserveData(eventList[0]); if (dataList.Count != 0) { resData.RecSetting = dataList[0].RecSetting.Clone(); } else { resData.RecSetting = Settings.Instance.RecPresetList[0].RecPresetData.Clone(); } } else if (dataList.Count != 0) { resData = dataList[0]; } MenuUtil.SendAutoAdd(resData, CmdExeUtil.IsKeyGesture(e)); IsCommandExecuted = true; }
private void CtxmGenerateChgAutoAddMenuItem(MenuItem menu, IAutoAddTargetData info, ICommand cmd, bool?IsAutoAddEnabled, bool ByFazy) { if (info != null) { var addList = new List <AutoAddData>(); addList.AddRange(info.SearchEpgAutoAddList(IsAutoAddEnabled, ByFazy)); addList.AddRange(info.SearchManualAutoAddList(IsAutoAddEnabled)); var chkList = new List <AutoAddData>(); chkList.AddRange(info.GetEpgAutoAddList(true)); chkList.AddRange(info.GetManualAutoAddList(true)); int idx = 0; addList.ForEach(autoAdd => { var menuItem = new MenuItem(); menuItem.IsChecked = chkList.Contains(autoAdd) && (info is ReserveData ? (info as ReserveData).IsAutoAdded : true); menuItem.Header = new InfoSearchItem(autoAdd).ViewItemName + " : " + ToMenuString(autoAdd); SetLimitLenHeader(menuItem, null, false, 42, 28); var header = menuItem.Header as Label; header.Content = MenuUtil.ToAccessKeyForm(header.Content as string).Insert(7, "(_" + ToAccessKey(idx++) + ")"); if (Settings.Instance.MenuSet.AutoAddSearchToolTip == true) { menuItem.ToolTip = AutoAddDataItemEx.CreateIncetance(autoAdd).ToolTipViewAlways; } menuItem.Command = cmd; menuItem.CommandParameter = new EpgCmdParam(menu.CommandParameter as EpgCmdParam); (menuItem.CommandParameter as EpgCmdParam).Data = autoAdd.GetType();//オブジェクト入れると残るので (menuItem.CommandParameter as EpgCmdParam).ID = (int)(autoAdd.DataID); menuItem.Tag = menuItem.Command; menu.Items.Add(menuItem); }); } }
public EpgEventInfo GetPgInfo(bool isSrv = true) { if (ID == 0) { return(null); } //まずは手持ちのデータを探す EpgEventInfo pg = MenuUtil.GetPgInfoUidAll(CurrentPgUID()); if (pg != null || isSrv == false) { return(pg); } //過去番組情報を探してみる if (PgStartTime >= CommonManager.Instance.DB.EventTimeMinArc) { var arcList = new List <EpgServiceEventInfo>(); CommonManager.Instance.DB.LoadEpgArcData(PgStartTime, PgStartTime.AddSeconds(1), ref arcList, Create64Key().IntoList()); if (arcList.Any()) { return(arcList[0].eventList.FirstOrDefault()); } } //現在番組情報も探してみる ※EPGデータ未読み込み時で、録画直後の場合 if (CommonManager.Instance.DB.IsEpgLoaded == false) { var list = new List <EpgEventInfo>(); try { CommonManager.CreateSrvCtrl().SendGetPgInfoList(Create64PgKey().IntoList(), ref list); } catch { } return(list.FirstOrDefault()); } return(null); }
protected override void mc_ToAutoadd(object sender, ExecutedRoutedEventArgs e) { ReserveData resData = dataList.Count != 0 ? dataList[0] : null; IBasicPgInfo eventRefData = eventList.Count != 0 ? eventList[0] : null; if (resData != null) { eventRefData = eventRefData ?? new ReserveItem(resData).EventInfo ?? (IBasicPgInfo)resData; } else if (eventRefData != null) { resData = ((EpgEventInfo)eventRefData).ToReserveData(); resData.RecSetting = GetRecSetting() ?? Settings.Instance.RecPresetList[0].Data.DeepClone(); } else if (recinfoList.Count != 0) { eventRefData = recinfoList[0]; } var key = MenuUtil.SendAutoAddKey(eventRefData, CmdExeUtil.IsKeyGesture(e), GetSearchKey()); MenuUtil.SendAutoAdd(resData ?? eventRefData, CmdExeUtil.IsKeyGesture(e), key); IsCommandExecuted = true; }
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)); }
private void reserve_del(object sender, ExecutedRoutedEventArgs e) { if (CheckReserveChange(e, 2) == false) { return; } bool ret = MenuUtil.ReserveDelete(CommonUtil.ToList(reserveInfo)); StatusManager.StatusNotifySet(ret, "録画予約を削除"); if (ret == false) { return; } if (KeepWin == false) { this.Close(); return; } SetAddMode(AddMode.Re_Add); SetReserveTabHeader(false); }
/// <summary> /// 予約情報の再描画 /// </summary> private void ReloadReserveViewItem() { try { tunerReserveView.ClearInfo(); tunerReserveTimeView.ClearInfo(); tunerReserveNameView.ClearInfo(); reserveList.Clear(); var tunerList = new List <PanelItem <TunerReserveInfo> >(); var timeSet = new HashSet <DateTime>(); List <TunerReserveInfo> tunerReserveList = CommonManager.Instance.DB.TunerReserveList.Values .OrderBy(info => info.tunerID).ToList();//多分大丈夫だけど一応ソートしておく if (Settings.Instance.TunerDisplayOffReserve == true) { var tuner_off = new TunerReserveInfo(); tuner_off.tunerID = 0xFFFFFFFF;//IDの表示判定に使っている tuner_off.tunerName = "無効予約"; tuner_off.reserveList = CommonManager.Instance.DB.ReserveList.Values .Where(info => info.IsEnabled == false).Select(info => info.ReserveID).ToList(); tunerReserveList.Add(tuner_off); } //チューナ不足と無効予約はアイテムがなければ非表示 tunerReserveList.RemoveAll(item => item.tunerID == 0xFFFFFFFF && item.reserveList.Count == 0); double singleWidth = Settings.Instance.TunerWidth; double leftPos = 0; var resDic = CommonManager.Instance.DB.ReserveList; tunerReserveList.ForEach(info => { var cols = new List <List <ReserveViewItem> >(); foreach (ReserveData resInfo in info.reserveList.Where(id => resDic.ContainsKey(id) == true).Select(id => resDic[id]).OrderBy(res => res.Create64Key()))//.ThenBy(res => res.StartTimeActual)) { var newItem = new TunerReserveViewItem(resInfo) { Width = singleWidth }; reserveList.Add(newItem); //横位置の設定・列を拡げて表示する処置 var addCol = cols.FindIndex(col => col.All(item => MenuUtil.CulcOverlapLength(resInfo.StartTime, resInfo.DurationSecond, item.Data.StartTime, item.Data.DurationSecond) <= 0)); if (addCol < 0) { addCol = cols.Count; cols.Add(new List <ReserveViewItem>()); } cols[addCol].Add(newItem); newItem.LeftPos = leftPos + addCol * singleWidth; //マージン込みの時間でリストを構築 ViewUtil.AddTimeList(timeSet, resInfo.StartTimeActual, resInfo.DurationActual); } double tunerWidth = singleWidth * Math.Max(1, cols.Count); tunerList.Add(new PanelItem <TunerReserveInfo>(info) { Width = tunerWidth }); leftPos += tunerWidth; }); //縦位置の設定 var timeList = new List <DateTime>(timeSet.OrderBy(time => time)); reserveList.ForEach(item => { ViewUtil.SetItemVerticalPos(timeList, item, item.Data.StartTimeActual, item.Data.DurationActual, Settings.Instance.TunerMinHeight, true); //ごく小さいマージンの表示を抑制する。 item.TopPos = Math.Round(item.TopPos); item.Height = Math.Round(item.Height); }); //最低表示行数を適用。また、最低表示高さを確保して、位置も調整する。 ViewUtil.ModifierMinimumLine(reserveList, Settings.Instance.TunerMinimumLine, Settings.Instance.TunerFontSizeService, Settings.Instance.TunerBorderTopSize); //必要時間リストの修正。最低表示行数の適用で下に溢れた分を追加する。 ViewUtil.AdjustTimeList(reserveList, timeList, Settings.Instance.TunerMinHeight); tunerReserveTimeView.SetTime(timeList, false, true); tunerReserveNameView.SetTunerInfo(tunerList); tunerReserveView.SetReserveList(reserveList, leftPos, timeList.Count * 60 * Settings.Instance.TunerMinHeight); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
protected override void mc_SearchTitle(object sender, ExecutedRoutedEventArgs e) { //番組情報優先 MenuUtil.SearchTextWeb((headDataEv ?? headDataRec).DataTitle, CmdExeUtil.IsKeyGesture(e)); IsCommandExecuted = true; }
protected override void mc_InfoSearchTitle(object sender, ExecutedRoutedEventArgs e) { //番組情報優先 IsCommandExecuted = true == MenuUtil.OpenInfoSearchDialog((headDataEv ?? headDataRec).DataTitle, CmdExeUtil.IsKeyGesture(e)); }
protected override void mc_CopyTitle(object sender, ExecutedRoutedEventArgs e) { //番組情報優先 MenuUtil.CopyTitle2Clipboard((headDataEv ?? headDataRec).DataTitle, CmdExeUtil.IsKeyGesture(e)); IsCommandExecuted = true; }