Пример #1
0
        //SearchItem関係
        public virtual int MoveToReserveItem(ReserveData target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
        {
            if (DataListBox == null || DataListBox.Items.Count == 0)
            {
                return(-1);
            }

            var items = DataListBox.Items.OfType <SearchItem>();

            if (target != null && target.IsEpgReserve == true)
            {
                //重複予約には注意する。
                var item = items.FirstOrDefault(d => d.IsReserved == true && d.ReserveInfo.ReserveID == target.ReserveID);
                int idx  = ViewUtil.ScrollToFindItem(item, DataListBox, style, dryrun);
                if (dryrun == false)
                {
                    ItemIdx = idx;
                }
                return(idx);
            }
            else
            {
                //プログラム予約だと見つからないので、それらしい番組へジャンプする。
                return(MoveToProgramItem(target == null ? null : MenuUtil.GetPgInfoLikeThat(target, null, items.GetEventList()), style, dryrun));
            }
        }
Пример #2
0
        public override void MoveToItem(UInt64 id, JumpItemStyle style = JumpItemStyle.MoveTo)
        {
            ProgramViewItem target_item;

            programList.TryGetValue(id, out target_item);
            programView.ScrollToFindItem(target_item, style);
        }
Пример #3
0
 public override void MoveToReserveItem(ReserveData target, JumpItemStyle style = JumpItemStyle.MoveTo)
 {
     if (target != null)
     {
         ChangeViewService(target.Create64Key());
     }
     base.MoveToReserveItem(target, style);
 }
Пример #4
0
 public override void MoveToProgramItem(EpgEventInfo target, JumpItemStyle style = JumpItemStyle.MoveTo)
 {
     if (target != null)
     {
         ChangeViewService(target.Create64Key());
     }
     base.MoveToProgramItem(target, style);
 }
Пример #5
0
        public virtual void MoveToItem(UInt64 id, JumpItemStyle style = JumpItemStyle.MoveTo)
        {
            if (DataListBox == null || DataListBox.Items.Count == 0)
            {
                return;
            }

            ItemIdx = ViewUtil.JumpToListItem(id, DataListBox, style);
        }
Пример #6
0
        public virtual int MoveToProgramItem(EpgEventInfo target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
        {
            if (DataListBox == null || DataListBox.Items.Count == 0)
            {
                return(-1);
            }

            //過去番組表でイベントIDが重複している場合があるので開始時間も考慮する
            return(MoveToItem(target == null ? 0 : target.CurrentPgUID(), style, dryrun));
        }
        public override void MoveToItem(UInt64 id, JumpItemStyle style = JumpItemStyle.MoveTo)
        {
            int idx = reserveList.FindIndex(item => item.Data.ReserveID == id);

            if (idx != -1)
            {
                tunerReserveView.ScrollToFindItem(reserveList[idx], style);
            }
            ItemIdx = idx;
        }
Пример #8
0
        public virtual void MoveToProgramItem(EpgEventInfo target, JumpItemStyle style = JumpItemStyle.MoveTo)
        {
            if (DataListBox == null || DataListBox.Items.Count == 0)
            {
                return;
            }

            //過去番組表でイベントIDが重複している場合があるので開始時間も考慮する
            MoveToItem(target == null ? 0 : target.CurrentPgUID(), style);
        }
Пример #9
0
        public override int MoveToItem(UInt64 id, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
        {
            ProgramViewItem target_item;

            programList.TryGetValue(id, out target_item);
            if (dryrun == false)
            {
                programView.ScrollToFindItem(target_item, style);
            }
            return(target_item == null ? -1 : 0);
        }
Пример #10
0
 //指定アイテムまでマーキング付で移動する。
 public static int JumpToListItem(object target, ListBox listBox, JumpItemStyle style = JumpItemStyle.None)
 {
     if (target is IGridViewSorterItem)
     {
         return(JumpToListItem(((IGridViewSorterItem)target).KeyID, listBox, style));
     }
     else
     {
         return(ScrollToFindItem(target, listBox, style));
     }
 }
Пример #11
0
 public override int MoveToProgramItem(EpgEventInfo target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
 {
     if (dryrun == true)
     {
         return(target == null ? -1 : viewInfo.ViewServiceList.IndexOf(target.Create64Key()));
     }
     if (target != null)
     {
         ChangeViewService(target.Create64Key());
     }
     return(base.MoveToProgramItem(target, style));
 }
Пример #12
0
 public override int MoveToRecInfoItem(RecFileInfo target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
 {
     if (dryrun == true)
     {
         return(target == null ? -1 : viewData.HasKey(target.Create64Key()) ? 1 : -1);
     }
     if (target != null)
     {
         ChangeViewService(target.Create64Key());
     }
     return(base.MoveToRecInfoItem(target, style));
 }
Пример #13
0
 public override int MoveToReserveItem(ReserveData target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
 {
     //実際には切り替えないと分からない
     if (dryrun == true)
     {
         return(target == null ? -1 : viewInfo.ViewServiceList.IndexOf(target.Create64Key()));
     }
     if (target != null)
     {
         ChangeViewService(target.Create64Key());
     }
     return(base.MoveToReserveItem(target, style));
 }
Пример #14
0
        public override void MoveToReserveItem(ReserveData target, JumpItemStyle style = JumpItemStyle.MoveTo)
        {
            if (target == null)
            {
                return;
            }
            int idx = reserveList.FindIndex(item => item.Data.ReserveID == target.ReserveID);

            if (idx != -1)
            {
                programView.ScrollToFindItem(reserveList[idx], style);
            }
            ItemIdx = idx;
        }
Пример #15
0
        //実際には切り替えないと分からない
        public override int MoveToItem(UInt64 id, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
        {
            UInt64 key = CommonManager.Reverse64Key(id);

            if (dryrun == true)
            {
                return(viewData.HasKey(key) ? 1 : -1);
            }
            if (key != 0)
            {
                ChangeViewService(key);
            }
            return(base.MoveToItem(id, style, dryrun));
        }
Пример #16
0
        public override int MoveToItem(UInt64 id, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
        {
            int idx = reserveList.FindIndex(item => item.Data.ReserveID == id);

            if (idx != -1 && dryrun == false)
            {
                tunerReserveView.ScrollToFindItem(reserveList[idx], style);
            }
            if (dryrun == false)
            {
                ItemIdx = idx;
            }
            return(idx);
        }
Пример #17
0
        public static int ScrollToFindItem(object target, ListBox listBox, JumpItemStyle style = JumpItemStyle.None, bool dryrun = false)
        {
            int selIdx = -1;

            try
            {
                selIdx = listBox.Items.IndexOf(target);
                if (dryrun == false)
                {
                    listBox.SelectedIndex = -1;
                }
                if (dryrun == true || selIdx < 0)
                {
                    return(selIdx);
                }

                listBox.SelectedIndex = selIdx;
                listBox.ScrollIntoView(target);

                //パネルビューと比較して、こちらでは最後までゆっくり点滅させる。全表示時間は同じ。
                //ただ、結局スクロールさせる位置がうまく調整できてないので効果は限定的。
                if ((style & ~JumpItemStyle.PanelNoScroll) == JumpItemStyle.JumpTo && target is DataListItemBase)
                {
                    var target_item = target as DataListItemBase;
                    listBox.SelectedItem = null;

                    var notifyTimer = new DispatcherTimer();
                    notifyTimer.Interval = TimeSpan.FromSeconds(0.2);
                    var sw = System.Diagnostics.Stopwatch.StartNew();
                    notifyTimer.Tick += (sender, e) =>
                    {
                        if (sw.ElapsedMilliseconds > Settings.Instance.DisplayNotifyJumpTime * 1000)
                        {
                            notifyTimer.Stop();
                            target_item.NowJumpingTable = 0;
                            listBox.SelectedItem        = target_item;
                        }
                        else
                        {
                            target_item.NowJumpingTable = target_item.NowJumpingTable != 1 ? 1 : 2;
                        }
                        listBox.Items.Refresh();
                    };
                    notifyTimer.Start();
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            return(selIdx);
        }
Пример #18
0
        public virtual int MoveToItem(UInt64 id, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
        {
            if (DataListBox == null || DataListBox.Items.Count == 0)
            {
                return(-1);
            }

            int idx = ViewUtil.JumpToListItem(id, DataListBox, style, dryrun);

            if (dryrun == false)
            {
                ItemIdx = idx;
            }
            return(idx);
        }
Пример #19
0
        public override int MoveToReserveItem(ReserveData target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
        {
            if (target == null)
            {
                return(-1);
            }
            int idx = reserveList.FindIndex(item => item.Data.ReserveID == target.ReserveID);

            if (idx != -1 && dryrun == false)
            {
                programView.ScrollToFindItem(reserveList[idx], style);
            }
            if (dryrun == false)
            {
                ItemIdx = idx;
            }
            return(idx);
        }
Пример #20
0
        //SearchItem関係
        public virtual void MoveToReserveItem(ReserveData target, JumpItemStyle style = JumpItemStyle.MoveTo)
        {
            if (DataListBox == null || DataListBox.Items.Count == 0)
            {
                return;
            }

            if (target != null && target.IsEpgReserve == true)
            {
                //重複予約が無ければ、target.CurrentPgUID()でMoveToItem()に投げられる。
                var item = DataListBox.Items.OfType <SearchItem>().FirstOrDefault(d => d.IsReserved == true && d.ReserveInfo.ReserveID == target.ReserveID);
                ItemIdx = ViewUtil.ScrollToFindItem(item, DataListBox, style);
            }
            else
            {
                //プログラム予約だと見つからないので、それらしい番組へジャンプする。
                MoveToProgramItem(target == null ? null : target.SearchEventInfoLikeThat(), style);
            }
        }
Пример #21
0
        public override int MoveToRecInfoItem(RecFileInfo target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
        {
            if (target == null)
            {
                return(-1);
            }
            UInt64 id  = target.CurrentPgUID();
            int    idx = recinfoList.FindIndex(item => item.Data.CurrentPgUID() == id);

            if (idx != -1 && dryrun == false)
            {
                programView.ScrollToFindItem(recinfoList[idx], style);
            }
            if (dryrun == false)
            {
                ItemIdx = idx;
            }
            return(idx);
        }
Пример #22
0
 public bool MoveToItem(SearchItem target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
 {
     if (target == null)
     {
         return(false);
     }
     if (target.ReserveInfo != null)
     {
         ReloadReserveInfo();
         if (target.ReserveInfo is ReserveDataEnd)
         {
             return(MoveToRecInfoItem(MenuUtil.GetRecFileInfo(target.ReserveInfo), style, dryrun) >= 0);
         }
         else
         {
             return(MoveToReserveItem(target.ReserveInfo, style, dryrun) >= 0);
         }
     }
     return(MoveToProgramItem(target.EventInfo, style, dryrun) >= 0);
 }
Пример #23
0
 public bool MoveToItem(SearchItem target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
 {
     if (target == null)
     {
         return(false);
     }
     if (target.ReserveInfo != null)
     {
         ReloadReserveInfo();
         return(MoveToReserveItem(target.ReserveInfo, style, dryrun) >= 0);
     }
     else if (target.EventInfo != null)
     {
         EpgEventInfo info = target.EventInfo;
         //録画結果でevent_idを持っていないもの(未放送時間帯を録画など)は結局番組を見つけられないので、過去番組は探さない。
         info = info.event_id != 0xFFFF ? info : MenuUtil.SearchEventInfoLikeThat(info);
         return(MoveToProgramItem(info, style, dryrun) >= 0);
     }
     return(false);
 }
Пример #24
0
 public override object MoveNextRecinfo(int direction, UInt64 id = 0, bool move = true, JumpItemStyle style = JumpItemStyle.MoveTo)
 {
     return(MenuUtil.GetRecFileInfo(ViewUtil.MoveNextReserve(ref recIdx, programView, recinfoList, ref clickPos, id, direction, move, style) as ReserveDataEnd));
 }
Пример #25
0
 public override int MoveToProgramItem(EpgEventInfo target, JumpItemStyle style = JumpItemStyle.MoveTo, bool dryrun = false)
 {
     target = target == null ? null : target.GetGroupMainEvent(viewData.EventUIDList);
     return(MoveToItem(target == null ? 0 : target.CurrentPgUID(), style, dryrun));
 }
Пример #26
0
        public override object MoveNextItem(int direction, UInt64 id = 0, bool move = true, JumpItemStyle style = JumpItemStyle.MoveTo)
        {
            if (programList.Count == 0)
            {
                return(null);
            }

            var list = programList.Values.OrderBy(item => (int)(item.LeftPos / this.EpgStyle().ServiceWidth) * 1e6 + item.TopPos + item.Width / this.EpgStyle().ServiceWidth / 100).ToList();
            int idx  = list.FindIndex(item => item.Data.CurrentPgUID() == id);

            idx = ViewUtil.GetNextIdx(ItemIdx, idx, list.Count, direction);
            if (move == true)
            {
                programView.ScrollToFindItem(list[idx], style);
            }
            if (move == true)
            {
                ItemIdx = idx;
            }
            return(list[idx] == null ? null : list[idx].Data);
        }
Пример #27
0
 public override object MoveNextItem(int direction, UInt64 id = 0, bool move = true, JumpItemStyle style = JumpItemStyle.MoveTo)
 {
     return(ViewUtil.MoveNextReserve(ref itemIdx, tunerReserveView, reserveList, ref clickPos, id, direction, move, style));
 }
Пример #28
0
        //予約データの移動関係、SearchWindowとEpgListMainView
        public virtual object MoveNextReserve(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.IsReserved == true && d.ReserveInfo.ReserveID == 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));
            }
            SearchItem item = sList.FirstOrDefault(info => info.IsReserved == true);

            if (move == true)
            {
                ItemIdx = ViewUtil.ScrollToFindItem(item, DataListBox, style);
            }
            return(item == null ? null : item.ReserveInfo);
        }
Пример #29
0
 public override object MoveNextReserve(int direction, UInt64 id = 0, bool move = true, JumpItemStyle style = JumpItemStyle.MoveTo)
 {
     return(MoveNextItem(direction, id, move, style));
 }
Пример #30
0
        public virtual object MoveNextItem(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 <IGridViewSorterItem>().ToList();
            var selected = DataListBox.SelectedIndex == -1 ? list.FindIndex(d => d.KeyID == id) : DataListBox.SelectedIndex;
            var item     = list[ViewUtil.GetNextIdx(itemIdx, selected, list.Count, direction)];

            if (move == true)
            {
                ItemIdx = ViewUtil.ScrollToFindItem(item, DataListBox, style);
            }
            return(UnPack(item));
        }