Пример #1
0
        public virtual object MoveNextRecinfo(int direction, UInt64 id = 0, bool move = true, JumpItemStyle style = JumpItemStyle.MoveTo)
        {
            if (DataListBox == null || DataListBox.Items.Count == 0)
            {
                return(null);
            }

            var list = DataListBox.Items.OfType <SearchItem>().ToList();
            var idx  = id == 0 ? -1 : list.FindIndex(d => d.EventInfo.CurrentPgUID() == id);

            idx = idx != -1 ? idx : DataListBox.SelectedIndex != -1 ? DataListBox.SelectedIndex : itemIdx;
            idx++;

            List <SearchItem> sList = list.Skip(idx).Concat(list.Take(idx)).ToList();

            if (direction < 0)
            {
                sList.Reverse(0, sList.Count - (idx == 0 ? 0 : 1));
            }
            object     hit  = null;
            SearchItem item = sList.FirstOrDefault(info => (hit = MenuUtil.GetRecFileInfo(info.EventInfo)) != null);

            if (move == true)
            {
                ItemIdx = ViewUtil.ScrollToFindItem(item, DataListBox, style);
            }
            return(hit);
        }
Пример #2
0
        private void CheckData(bool recSetChange = true)
        {
            List <ReserveData> list = GetReserveList();

            chgEnabled                     = list.Count != 0;
            label_Msg.Visibility           = list.Count <= 1 ? Visibility.Hidden : Visibility.Visible;
            button_add_reserve.Content     = list.Count == 0 ? "追加" : "重複追加";
            button_open_recinfo.Visibility = MenuUtil.GetRecFileInfo(eventInfo) != null ? Visibility.Visible : Visibility.Collapsed;

            if (chgEnabled == true && recSetChange == true)
            {
                recSettingView.SetDefSetting(list[0].RecSetting);
            }

            SetReserveTabHeader(recSetChange);
        }
Пример #3
0
        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();
        }
Пример #4
0
        public AddReserveEpgWindow(EpgEventInfo info = null, int epgInfoOpenMode = 0, RecSettingData setInfo = null)
        {
            InitializeComponent();

            base.SetParam(false, checkBox_windowPinned, checkBox_dataReplace);
            recSettingView.PresetResCompare = true;

            //コマンドの登録
            this.CommandBindings.Add(new CommandBinding(EpgCmds.Cancel, (sender, e) => this.Close()));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.AddInDialog, reserve_add, (sender, e) => e.CanExecute    = AddEnabled));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.ChangeInDialog, reserve_chg, (sender, e) => e.CanExecute = KeepWin == true && AddEnabled && chgEnabled));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.DeleteInDialog, reserve_del, (sender, e) => e.CanExecute = KeepWin == true && AddEnabled && chgEnabled));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.BackItem, (sender, e) => MoveViewNextItem(-1), (sender, e) => e.CanExecute = KeepWin == true && (DataView is EpgViewBase || DataViewSearch != null || DataRefList.Any())));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.NextItem, (sender, e) => MoveViewNextItem(1), (sender, e) => e.CanExecute  = KeepWin == true && (DataView is EpgViewBase || DataViewSearch != null || DataRefList.Any())));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.Search, (sender, e) => MoveViewEpgTarget(), (sender, e) => e.CanExecute    = KeepWin == true && DataView is EpgViewBase));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.ShowInDialog, (sender, e) => MenuUtil.OpenRecInfoDialog(MenuUtil.GetRecFileInfo(eventInfo)), (sender, e) => e.CanExecute = button_open_recinfo.Visibility == Visibility.Visible));

            //ボタンの設定
            mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);
            mBinds.SetCommandToButton(button_add_reserve, EpgCmds.AddInDialog);
            mBinds.SetCommandToButton(button_chg_reserve, EpgCmds.ChangeInDialog);
            mBinds.SetCommandToButton(button_del_reserve, EpgCmds.DeleteInDialog);
            mBinds.SetCommandToButton(button_up, EpgCmds.BackItem);
            mBinds.SetCommandToButton(button_down, EpgCmds.NextItem);
            mBinds.SetCommandToButton(button_chk, EpgCmds.Search);
            mBinds.SetCommandToButton(button_open_recinfo, EpgCmds.ShowInDialog);
            RefreshMenu();

            //録画設定タブ関係の設定
            recSettingView.SelectedPresetChanged += SetReserveTabHeader;
            reserveTabHeader.MouseRightButtonUp  += recSettingView.OpenPresetSelectMenuOnMouseEvent;
            recSettingView.SetDefSetting(setInfo);

            tabControl.SelectedIndex = epgInfoOpenMode == 1 ? 0 : 1;
            if (KeepWin == true)
            {
                button_cancel.Content = "閉じる";
                //ステータスバーの設定
                this.statusBar.Status.Visibility = Visibility.Collapsed;
                StatusManager.RegisterStatusbar(this.statusBar, this);
            }
            else
            {
                button_chg_reserve.Visibility = Visibility.Collapsed;
                button_del_reserve.Visibility = Visibility.Collapsed;
                button_up.Visibility          = Visibility.Collapsed;
                button_down.Visibility        = Visibility.Collapsed;
                button_chk.Visibility         = Visibility.Collapsed;
            }
            ChangeData(info);
        }