Exemplo n.º 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);
        }
Exemplo n.º 2
0
        protected override void MoveToReserveItem(ReserveData target, bool IsMarking)
        {
            uint       ID          = target.ReserveID;
            SearchItem target_item = lstCtrl.dataList.Find(item => item.ReserveInfo != null && item.ReserveInfo.ReserveID == ID);

            if (target_item != null)
            {
                ViewUtil.ScrollToFindItem(target_item, listView_event, IsMarking);
            }
            else
            {
                //プログラム予約だと見つからないので、それらしい番組を引っ張ってきて再度確認する。
                //でもリスト番組表で探すより、プログラム予約でも表示させられる標準モードへ投げてしまった方が良いのかも?
                EpgEventInfo target_like = target.SearchEventInfoLikeThat();
                if (target_like != null)
                {
                    MoveToProgramItem(target_like, IsMarking);
                }
                else
                {
                    //それでもダメなら諦める。EPG範囲外の予約などは標準モードでもまともには表示されていないので。
                    listView_event.SelectedIndex = listView_event.Items.Count - 1;
                    listView_event.ScrollIntoView(listView_event.SelectedItem);
                }
                return;
            }
        }
Exemplo n.º 3
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));
            }
        }
Exemplo n.º 4
0
        protected override void MoveToProgramItem(EpgEventInfo target, bool IsMarking)
        {
            ulong      PgKey       = target.Create64PgKey();
            SearchItem target_item = lstCtrl.dataList.Find(item => item.EventInfo.Create64PgKey() == PgKey);

            ViewUtil.ScrollToFindItem(target_item, listView_event, IsMarking);
        }
Exemplo n.º 5
0
        public RecFolderWindow()
        {
            InitializeComponent();

            if (CommonManager.Instance.NWMode == true)
            {
                button_write.IsEnabled   = false;
                button_recName.IsEnabled = false;
            }

            button_ok.Click     += (sender, e) => DialogResult = true;
            button_cancel.Click += (sender, e) => DialogResult = false;

            if (CommonManager.Instance.IsConnected == true)
            {
                ErrCode err = CommonManager.Instance.DB.ReloadPlugInFile();
                CommonManager.CmdErrMsgTypical(err, "PlugIn一覧の取得");
            }
            comboBox_writePlugIn.ItemsSource  = CommonManager.Instance.DB.WritePlugInList;
            comboBox_writePlugIn.SelectedItem = "Write_Default.dll";

            comboBox_recNamePlugIn.ItemsSource   = new[] { "なし" }.Concat(CommonManager.Instance.DB.RecNamePlugInList);
            comboBox_recNamePlugIn.SelectedIndex = 0;

            //フォルダ設定無しの場合の表示
            textBox_recFolderDef.Text      = Settings.Instance.DefRecFolders.FirstOrDefault() ?? SettingPath.GetSettingFolderPath(true);
            textBox_recFolder.TextChanged += textBox_recFolder_TextChanged;
            textBox_recFolder_TextChanged(null, null);//ツールチップを設定するため

            button_folder.Click += ViewUtil.OpenFolderNameDialog(textBox_recFolder, "録画フォルダの選択", true, textBox_recFolderDef.Text);
        }
Exemplo n.º 6
0
        //パネル系画面の移動用
        public static object MoveNextReserve(ref int itemIdx, PanelViewBase view, IEnumerable <ReserveViewItem> reslist, ref Point jmpPos,
                                             UInt64 id, int direction, bool move = true, JumpItemStyle style = JumpItemStyle.MoveTo)
        {
            Point pos = jmpPos;

            jmpPos = new Point(-1, -1);
            if (reslist.Any() == false)
            {
                return(null);
            }

            List <ReserveViewItem> list     = reslist.OrderBy(d => d.Data.StartTimeActual).ToList();
            ReserveViewItem        viewItem = null;
            int idx = id == 0 ? -1 : list.FindIndex(item => item.Data.ReserveID == id);

            if (idx == -1 && pos.X >= 0)
            {
                viewItem = list.GetNearDataList(pos).First();
                idx      = list.IndexOf(viewItem);
            }
            else
            {
                idx      = ViewUtil.GetNextIdx(itemIdx, idx, list.Count, direction);
                viewItem = list[idx];
            }
            if (move == true)
            {
                view.ScrollToFindItem(viewItem, style);
            }
            if (move == true)
            {
                itemIdx = idx;
            }
            return(viewItem == null ? null : viewItem.Data);
        }
Exemplo n.º 7
0
        public AddManualAutoAddWindow(ManualAutoAddData data = null, AutoAddMode mode = AutoAddMode.NewAdd)
            : base(data, mode)
        {
            InitializeComponent();

            try
            {
                base.SetParam(false, checkBox_windowPinned, checkBox_dataReplace);

                //コマンドの登録
                this.CommandBindings.Add(new CommandBinding(EpgCmds.Cancel, (sender, e) => this.Close()));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.AddInDialog, autoadd_add));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.ChangeInDialog, autoadd_chg, (sender, e) => e.CanExecute   = winMode == AutoAddMode.Change));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.DeleteInDialog, autoadd_del1, (sender, e) => e.CanExecute  = winMode == AutoAddMode.Change));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.Delete2InDialog, autoadd_del2, (sender, e) => e.CanExecute = winMode == AutoAddMode.Change));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.BackItem, (sender, e) => MoveViewNextItem(-1)));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.NextItem, (sender, e) => MoveViewNextItem(1)));

                //ボタンの設定
                mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);
                mBinds.SetCommandToButton(button_chg, EpgCmds.ChangeInDialog);
                mBinds.SetCommandToButton(button_add, EpgCmds.AddInDialog);
                mBinds.SetCommandToButton(button_del, EpgCmds.DeleteInDialog);
                mBinds.SetCommandToButton(button_del2, EpgCmds.Delete2InDialog);
                mBinds.SetCommandToButton(button_up, EpgCmds.BackItem);
                mBinds.SetCommandToButton(button_down, EpgCmds.NextItem);
                RefreshMenu();

                //ステータスバーの登録
                this.statusBar.Status.Visibility = Visibility.Collapsed;
                StatusManager.RegisterStatusbar(this.statusBar, this);

                //その他設定
                chbxList = CommonManager.DayOfWeekArray.Select(wd =>
                                                               new CheckBox {
                    Content = wd, Margin = new Thickness(0, 0, 6, 0)
                }).ToList();
                chbxList.ForEach(chbx => stackPanel_week.Children.Add(chbx));

                comboBox_startHH.ItemsSource   = CommonManager.CustomHourList;
                comboBox_startHH.SelectedIndex = 0;
                comboBox_startMM.ItemsSource   = Enumerable.Range(0, 60);
                comboBox_startMM.SelectedIndex = 0;
                comboBox_startSS.ItemsSource   = Enumerable.Range(0, 60);
                comboBox_startSS.SelectedIndex = 0;
                comboBox_endHH.ItemsSource     = CommonManager.CustomHourList;
                comboBox_endHH.SelectedIndex   = 0;
                comboBox_endMM.ItemsSource     = Enumerable.Range(0, 60);
                comboBox_endMM.SelectedIndex   = 0;
                comboBox_endSS.ItemsSource     = Enumerable.Range(0, 60);
                comboBox_endSS.SelectedIndex   = 0;
                ViewUtil.Set_ComboBox_LostFocus_SelectItemUInt(panel_times);

                comboBox_service.ItemsSource   = ChSet5.ChListSelected;
                comboBox_service.SelectedIndex = 0;

                recSettingView.SetViewMode(false);
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); }
        }
Exemplo n.º 8
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);
        }
Exemplo n.º 9
0
        public SetAppCancelWindow()
        {
            InitializeComponent();

            button_process_del.IsEnabled        = IniFileHandler.CanUpdateInifile;
            label2.IsEnabled                    = IniFileHandler.CanUpdateInifile;
            textBox_process.IsEnabled           = IniFileHandler.CanUpdateInifile;
            button_process_add.IsEnabled        = IniFileHandler.CanUpdateInifile;
            button_process_open.IsEnabled       = IniFileHandler.CanUpdateInifile;
            label3.IsEnabled                    = IniFileHandler.CanUpdateInifile;
            textBox_ng_min.IsEnabled            = IniFileHandler.CanUpdateInifile;
            label4.IsEnabled                    = IniFileHandler.CanUpdateInifile;
            checkBox_ng_fileStreaming.IsEnabled = IniFileHandler.CanUpdateInifile;
            checkBox_ng_shareFile.IsEnabled     = IniFileHandler.CanUpdateInifile;
            textBox_ng_usePC_min.IsEnabled      = IniFileHandler.CanUpdateInifile;
            label7.IsEnabled                    = IniFileHandler.CanUpdateInifile;
            checkBox_ng_usePC.IsEnabled         = IniFileHandler.CanUpdateInifile;
            button_OK.IsEnabled                 = IniFileHandler.CanUpdateInifile;

            var bx = new BoxExchangeEditor(null, listBox_process, true);

            listBox_process.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(listBox_process, textBox_process);
            if (CommonManager.Instance.NWMode == false)
            {
                bx.AllowKeyAction();
                bx.AllowDragDrop();
                button_process_del.Click += new RoutedEventHandler(bx.button_Delete_Click);
                button_process_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_process, textBox_process);
            }
        }
Exemplo n.º 10
0
        public SetApp2DelWindow()
        {
            InitializeComponent();

            button_add.IsEnabled         = IniFileHandler.CanUpdateInifile;
            textBox_ext.IsEnabled        = IniFileHandler.CanUpdateInifile;
            label2.IsEnabled             = IniFileHandler.CanUpdateInifile;
            button_del.IsEnabled         = IniFileHandler.CanUpdateInifile;
            button_chk_del.IsEnabled     = IniFileHandler.CanUpdateInifile;
            button_chk_add.IsEnabled     = IniFileHandler.CanUpdateInifile;
            button_chk_open.IsEnabled    = IniFileHandler.CanUpdateInifile;
            textBox_chk_folder.IsEnabled = IniFileHandler.CanUpdateInifile;
            button_OK.IsEnabled          = IniFileHandler.CanUpdateInifile;

            var bxe = new BoxExchangeEditor(null, listBox_ext, true);
            var bxc = new BoxExchangeEditor(null, listBox_chk_folder, true);

            listBox_ext.SelectionChanged        += ViewUtil.ListBox_TextBoxSyncSelectionChanged(listBox_ext, textBox_ext);
            listBox_chk_folder.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(listBox_chk_folder, textBox_chk_folder);
            if (CommonManager.Instance.NWMode == false)
            {
                bxe.AllowKeyAction();
                bxe.AllowDragDrop();
                button_del.Click += new RoutedEventHandler(bxe.button_Delete_Click);
                button_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_ext, textBox_ext);
                bxc.AllowKeyAction();
                bxc.AllowDragDrop();
                button_chk_del.Click += new RoutedEventHandler(bxc.button_Delete_Click);
                button_chk_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_chk_folder, textBox_chk_folder);
            }
        }
Exemplo n.º 11
0
        public void CtxmGenerateRestoreMenuItems(MenuItem menu)
        {
            //クリア
            object menuReset = menu.Items[menu.Items.Count - 1];

            menu.Items.Clear();

            for (int i = 0; i < CmdHistorys.Count; i++)
            {
                List <IRecWorkMainData> list = CmdHistorys.Historys[i].Items;
                var menuItem = new MenuItem();
                var s        = string.Format((CmdHistorys.Historys[i].Command == EpgCmds.Delete ? "削除した{0}を復元" : "変更前の{0}を新規追加") + "(_{1}) : {2}"
                                             , new InfoSearchItem(list[0]).ViewItemName, ToAccessKey(i, 16), MenuUtil.ToAccessKeyForm(ToMenuString(list[0])))
                               + (list.Count > 1 ? " ほか" + (list.Count - 1) : "");
                menuItem.Header = CommonUtil.LimitLenString(s, 45, 31); // 長すぎる場合は省略
                if (list.Count >= 2 || (menuItem.Header as string).Length != s.Length)
                {
                    s = string.Join("\r\n", list.Take(10).Select(item => ToMenuString(item)))
                        + (list.Count > 10 ? "\r\nほか" + (list.Count - 10) : "");
                    menuItem.ToolTip = ViewUtil.GetTooltipBlockStandard(s);
                }
                menuItem.Command          = EpgCmds.RestoreItem;
                menuItem.CommandParameter = new EpgCmdParam(menu.CommandParameter as EpgCmdParam);
                (menuItem.CommandParameter as EpgCmdParam).ID = i;
                menuItem.Tag = menuItem.Command;
                menu.Items.Add(menuItem);
            }
            menu.IsEnabled = menu.Items.Count > 0;
            menu.Items.Add(new Separator());
            menu.Items.Add(menuReset);
        }
Exemplo n.º 12
0
        protected void MoveToReserveItem(ReserveData target, bool IsMarking)
        {
            uint        ID   = target.ReserveID;
            ReserveItem item = lstCtrl.dataList.Find(data => data.ReserveInfo.ReserveID == ID);

            ViewUtil.ScrollToFindItem(item, listView_reserve, IsMarking);
        }
Exemplo n.º 13
0
        private void UpdateProgramView()
        {
            try
            {
                timeView.ClearInfo();
                weekDayView.ClearInfo();
                epgProgramView.ClearInfo();
                timeList.Clear();
                programList.Clear();
                NowLineDelete();
                dayList.Clear();

                UInt64 selectID = GetSelectID(true);
                if (selectID == 0)
                {
                    return;
                }

                //リストの作成
                int idx = serviceEventList.FindIndex(item => item.serviceInfo.Create64Key() == selectID);
                if (idx < 0)
                {
                    return;
                }

                serviceEventList[idx].eventList.ForEach(eventInfo =>
                {
                    //無いはずだが、ToDictionary()にせず、一応保険。
                    programList[eventInfo.CurrentPgUID()] = new ProgramViewItem(eventInfo);
                });

                //日付リスト構築
                dayList.AddRange(programList.Values.Select(d => GetViewDay(d.Data.start_time)).Distinct().OrderBy(day => day));

                //横位置の設定
                foreach (ProgramViewItem item in programList.Values)
                {
                    item.Width   = Settings.Instance.ServiceWidth;
                    item.LeftPos = item.Width * dayList.BinarySearch(GetViewDay(item.Data.start_time));
                }

                //縦位置の設定
                if (viewCustNeedTimeOnly == false)
                {
                    ViewUtil.AddTimeList(timeList, new DateTime(2001, 1, 1, viewInfo.StartTimeWeek, 0, 0), 86400);
                }
                SetProgramViewItemVertical();

                epgProgramView.SetProgramList(programList.Values.ToList(),
                                              dayList.Count * Settings.Instance.ServiceWidth,
                                              timeList.Count * 60 * Settings.Instance.MinHeight);

                timeView.SetTime(timeList, true);
                weekDayView.SetDay(dayList);

                ReDrawNowLine();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Exemplo n.º 14
0
 protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
 {
     base.OnPropertyChanged(e);
     if (e.Property == TextBox.IsReadOnlyProperty)
     {
         ViewUtil.SetDisabledEffect(this, IsReadOnly);
     }
 }
Exemplo n.º 15
0
 public void SetChangeMode(int chgMode)
 {
     ViewUtil.SetSpecificChgAppearance(listBox_content);
     listBox_content.Focus();
     if (listBox_content.Items.Count != 0)
     {
         listBox_content.SelectedIndex = 0;
     }
 }
Exemplo n.º 16
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);
        }
Exemplo n.º 17
0
 protected virtual void scrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
 {
     scroll.ScrollToHorizontalOffset(ViewUtil.SnapsToDevicePixelsX(scroll.HorizontalOffset));
     scroll.ScrollToVerticalOffset(ViewUtil.SnapsToDevicePixelsY(scroll.VerticalOffset));
     if (ScrollChanged != null)
     {
         ScrollChanged(this, e);
     }
 }
Exemplo n.º 18
0
 public PresetEditor()
 {
     comboBox_preSet.SelectionChanged += comboBox_preSet_SelectionChanged;
     comboBox_preSet.KeyDown          += ViewUtil.KeyDown_Enter(button_reload);
     button_add.Click    += (sender, e) => button_Click(PresetEdit.Add, sender, e);
     button_chg.Click    += (sender, e) => button_Click(PresetEdit.Change, sender, e);
     button_del.Click    += (sender, e) => button_Click(PresetEdit.Delete, sender, e);
     button_reload.Click += (sender, e) => comboBox_preSet_SelectionChanged(null, null);
     button_set.Click    += button_set_Click;
 }
Exemplo n.º 19
0
        protected override void UpdateStatusData(int mode = 0)
        {
            if (mode == 0)
            {
                this.status[1] = ViewUtil.ConvertAutoAddStatus(lstCtrl.dataList, "自動予約登録数");
            }
            List <S> sList = lstCtrl.GetSelectedItemsList();

            this.status[2] = sList.Count == 0 ? "" : ViewUtil.ConvertAutoAddStatus(sList, " 選択中");
        }
Exemplo n.º 20
0
        protected override void UpdateStatusData(int mode = 0)
        {
            if (mode == 0)
            {
                this.status[1] = ViewUtil.ConvertRecinfoStatus(lstCtrl.dataList, "録画結果");
            }
            List <RecInfoItem> sList = lstCtrl.GetSelectedItemsList();

            this.status[2] = sList.Count == 0 ? "" : ViewUtil.ConvertRecinfoStatus(sList, " 選択中");
        }
Exemplo n.º 21
0
        protected override void UpdateStatusData(int mode = 0)
        {
            if (mode == 0)
            {
                this.status[1] = ViewUtil.ConvertReserveStatus(lstCtrl.dataList, "予約数", 1);
            }
            List <ReserveItem> sList = lstCtrl.GetSelectedItemsList();

            this.status[2] = sList.Count == 0 ? "" : ViewUtil.ConvertReserveStatus(sList, " 選択中", 2);
        }
Exemplo n.º 22
0
        protected override bool ReloadInfoData()
        {
            if (ViewUtil.ReloadReserveData(this) == false)
            {
                return(false);
            }

            ReloadReserveViewItem();
            return(true);
        }
Exemplo n.º 23
0
        public void SetData(Control ow, ListBox listbox, LVDMHelper helper, MenuBinds mbinds = null)
        {
            try
            {
                Owner   = ow;
                listBox = listbox;
                hlp     = helper;
                MenuBinds mBinds = mbinds ?? new MenuBinds();

                //マウスイベント関係
                this.listBox.PreviewMouseLeftButtonUp   += new MouseButtonEventHandler(listBox_PreviewMouseLeftButtonUp);
                this.listBox.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(listBox_PreviewMouseLeftButtonDown);
                ViewUtil.ResetItemContainerStyle(listbox);
                listbox.ItemContainerStyle.Setters.Add(new EventSetter(Mouse.MouseEnterEvent, new MouseEventHandler(listBoxItem_MouseEnter)));

                //移動などのアクションはBoxExchangeEditorのものをそのまま使用する。
                bx = new BoxExchangeEditor {
                    TargetBox = listBox
                };

                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.TopItem, (sender, e) => ItemsAction(() => bx.button_Top_Click(null, null))));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.UpItem, (sender, e) => ItemsAction(() => bx.button_Up_Click(null, null))));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.DownItem, (sender, e) => ItemsAction(() => bx.button_Down_Click(null, null))));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.BottomItem, (sender, e) => ItemsAction(() => bx.button_Bottom_Click(null, null))));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.SaveOrder, SaveOrder_handler, (sender, e) => e.CanExecute = NotSaved == true));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.RestoreOrder, (sender, e) => hlp.RestoreOrder(), (sender, e) => e.CanExecute = NotSaved == true));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.DragCancel, (sender, e) => DragRelease()));

                mBinds.SetCommandToButton(button_top, EpgCmds.TopItem);
                mBinds.SetCommandToButton(button_up, EpgCmds.UpItem);
                mBinds.SetCommandToButton(button_down, EpgCmds.DownItem);
                mBinds.SetCommandToButton(button_bottom, EpgCmds.BottomItem);
                mBinds.SetCommandToButton(button_saveItemOrder, EpgCmds.SaveOrder);
                mBinds.SetCommandToButton(button_reloadItem, EpgCmds.RestoreOrder);
                mBinds.AddInputCommand(EpgCmds.DragCancel);//アイテムのドラッグキャンセル
                if (mbinds == null)
                {
                    mBinds.ResetInputBindings(this.Owner, this.listBox);
                }

                //コマンドだと、DragCancelしない場合に、CanExecuteを割り当てても、Handled=falseにしても、
                //Keygestureが先へ伝搬してくれないので、対処療法的だけど先に処理してしまうことにする。コマンドの意味無い‥。
                listBox.PreviewKeyDown += new KeyEventHandler((sender, e) =>
                {
                    if (e.Handled == false && e.Key == Key.Escape && e.IsRepeat == false && _onDrag == true)
                    {
                        EpgCmds.DragCancel.Execute(null, this);
                        //this.listBox.Items.Refresh();//壊したバインディングを修復する。モタツキ感があるので放置する。
                        e.Handled = true;
                    }
                });
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); }
        }
Exemplo n.º 24
0
        ContextMenu ctxm = new ContextMenu();//使用時に生成するとClearTabHeader()のタイミングが前後するので準備しておく。

        public EpgDataView()
        {
            InitializeComponent();

            //コンテキストメニューの設定
            ctxm.Unloaded += (s, e) => ClearTabHeader();
            tabControl.MouseRightButtonUp           += EpgTabContextMenuOpen;
            grid_viewMode.PreviewMouseRightButtonUp += EpgTabContextMenuOpen;

            //コマンドだと細かく設定しないといけないパターンなのでこの辺りで一括指定
            this.PreviewKeyDown += (sender, e) => ViewUtil.OnKyeMoveNextReserve(sender, e, ActiveView);
        }
Exemplo n.º 25
0
        public ConnectWindow()
        {
            InitializeComponent();

            var nowSet = new NWPresetItem(DefPresetStr, Settings.Instance.NWServerIP, Settings.Instance.NWServerPort, Settings.Instance.NWWaitPort, Settings.Instance.NWMacAdd);

            cmb_preset.Items.Add(nowSet);
            Settings.Instance.NWPreset.ForEach(item => cmb_preset.Items.Add(item.DeepClone()));
            cmb_preset.SelectedIndex = FindCmbPresetItem(nowSet, true);
            this.KeyDown            += ViewUtil.KeyDown_Escape_Close;
            cmb_preset.KeyDown      += ViewUtil.KeyDown_Enter(btn_reload);
            button_connect.Focus();//スペースキーも効く
        }
Exemplo n.º 26
0
 public void SetChangeMode(int chgMode)
 {
     switch (chgMode)
     {
     case 0:
         ViewUtil.SetSpecificChgAppearance(listBox_content);
         listBox_content.Focus();
         break;
     }
     stackPanel_PresetEdit.Visibility = chgMode == int.MaxValue ? Visibility.Collapsed : Visibility.Visible;
     Button_clearAndKey.ToolTip       = chgMode == int.MaxValue ? SearchKeyView.ClearButtonTooltip : null;
     Button_clearNotKey.ToolTip       = Button_clearAndKey.ToolTip;
 }
Exemplo n.º 27
0
 protected override void UserControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     //BlackoutWindow経由のジャンプ
     base.UserControl_IsVisibleChanged(sender, e);
     if (DataListBox != null && this.IsVisible == true)
     {
         if (BlackoutWindow.HasData == true)
         {
             ItemIdx = ViewUtil.JumpToListItem(BlackoutWindow.SelectedData, DataListBox, BlackoutWindow.NowJumpTable == true ? JumpItemStyle.JumpTo : JumpItemStyle.None);
         }
         BlackoutWindow.Clear();
     }
 }
Exemplo n.º 28
0
        public RecSettingView()
        {
            InitializeComponent();

            try
            {
                if (CommonManager.Instance.NWMode == true)
                {
                    preEdit.button_add.IsEnabled = false;
                    preEdit.button_chg.IsEnabled = false;
                    preEdit.button_del.IsEnabled = false;
                    preEdit.button_add.ToolTip   = "EpgTimerNWからは変更出来ません";
                    preEdit.button_chg.ToolTip   = preEdit.button_add.ToolTip;
                    preEdit.button_del.ToolTip   = preEdit.button_add.ToolTip;
                }

                recSetting = Settings.Instance.RecPresetList[0].Data.DeepClone();

                comboBox_recMode.ItemsSource  = CommonManager.RecModeList;
                comboBox_tuijyu.ItemsSource   = CommonManager.YesNoList;
                comboBox_pittari.ItemsSource  = CommonManager.YesNoList;
                comboBox_priority.ItemsSource = CommonManager.PriorityList;

                recEndModeRadioBtns = new RadioBtnSelect(radioButton_non, radioButton_standby, radioButton_suspend, radioButton_shutdown);

                tunerList.Add(new TunerSelectInfo("自動", 0));
                foreach (TunerReserveInfo info in CommonManager.Instance.DB.TunerReserveList.Values)
                {
                    if (info.tunerID != 0xFFFFFFFF)
                    {
                        tunerList.Add(new TunerSelectInfo(info.tunerName, info.tunerID));
                    }
                }
                comboBox_tuner.ItemsSource   = tunerList;
                comboBox_tuner.SelectedIndex = 0;

                stackPanel_PresetEdit.Children.Clear();
                stackPanel_PresetEdit.Children.Add(preEdit);
                preEdit.Set(this, PresetSelectChanged, PresetEdited, "録画プリセット", SetRecPresetWindow.SettingWithDialog);
                comboBox_preSet = preEdit.comboBox_preSet;

                var bx = new BoxExchangeEdit.BoxExchangeEditor(null, listView_recFolder, true, true, true);
                bx.TargetBox.KeyDown += ViewUtil.KeyDown_Enter(button_recFolderChg);
                bx.targetBoxAllowDoubleClick(bx.TargetBox, (sender, e) => button_recFolderChg.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
                button_recFolderDel.Click += new RoutedEventHandler(bx.button_Delete_Click);

                button_bat.Click += ViewUtil.OpenFileNameDialog(textBox_bat, false, "", ".bat", true);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Exemplo n.º 29
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);
        }
Exemplo n.º 30
0
        private bool reloadEventList(List <SearchItem> dataList)
        {
            //絞り込んだイベントリストを作成
            var eventList = new List <EpgEventInfo>();

            foreach (ServiceItem info in serviceList)
            {
                if (info.IsSelected == true)
                {
                    if (serviceEventList.ContainsKey(info.ID) == true)
                    {
                        foreach (EpgEventInfo eventInfo in serviceEventList[info.ID].eventList)
                        {
                            //ジャンル絞り込み
                            if (ViewUtil.ContainsContent(eventInfo, this.viewCustContentKindList) == false)
                            {
                                continue;
                            }
                            //イベントグループのチェック
                            if (eventInfo.EventGroupInfo != null)
                            {
                                bool spanFlag = false;
                                foreach (EpgEventData data in eventInfo.EventGroupInfo.eventDataList)
                                {
                                    if (info.ServiceInfo.Create64Key() == data.Create64Key())
                                    {
                                        spanFlag = true;
                                        break;
                                    }
                                }

                                if (spanFlag == false)
                                {
                                    //サービス2やサービス3の結合されるべきもの
                                    continue;
                                }
                            }
                            eventList.Add(eventInfo);
                        }
                    }
                }
            }

            //SearchItemリストを作成
            lstCtrl.dataList.AddFromEventList(eventList, true, setViewInfo.FilterEnded);

            return(true);
        }