Пример #1
0
        public RecFileSetInfoView GetSetting()
        {
            var info      = new RecFileSetInfoView(new RecFileSetInfo());
            var recFolder = SettingPath.CheckFolder(textBox_recFolder.Text);

            info.Info.RecFolder     = recFolder == "" ? "!Default" : recFolder;
            info.Info.WritePlugIn   = comboBox_writePlugIn.SelectedItem as string ?? "";
            info.Info.RecNamePlugIn = comboBox_recNamePlugIn.SelectedIndex <= 0 ? "" : comboBox_recNamePlugIn.SelectedItem as string ?? "";
            if (info.Info.RecNamePlugIn != "" && textBox_recNameOption.Text.Trim() != "")
            {
                info.Info.RecNamePlugIn += '?' + textBox_recNameOption.Text.Trim();
            }
            info.PartialRec = chkbox_partial.IsChecked == true;
            return(info);
        }
Пример #2
0
        public void SetDefSetting(RecFileSetInfoView info)
        {
            button_ok.Content                 = "変更";
            chkbox_partial.IsChecked          = info.PartialRec;
            textBox_recFolder.Text            = info.Info.RecFolder.Equals("!Default", StringComparison.OrdinalIgnoreCase) == true ? "" : SettingPath.CheckFolder(info.Info.RecFolder);
            comboBox_writePlugIn.SelectedItem = comboBox_writePlugIn.Items.OfType <string>().FirstOrDefault(s => s.Equals(info.Info.WritePlugIn, StringComparison.OrdinalIgnoreCase) == true);
            string pluginName = info.Info.RecNamePlugIn.Substring(0, (info.Info.RecNamePlugIn + '?').IndexOf('?'));
            var    plugin     = comboBox_recNamePlugIn.Items.OfType <string>().FirstOrDefault(s => s.Equals(pluginName, StringComparison.OrdinalIgnoreCase) == true);

            if (plugin != null)
            {
                comboBox_recNamePlugIn.SelectedItem = plugin;
                textBox_recNameOption.Text          = info.Info.RecNamePlugIn.Length <= pluginName.Length + 1 ? "" : info.Info.RecNamePlugIn.Substring(pluginName.Length + 1);
            }
        }
Пример #3
0
        public SetBasicView()
        {
            InitializeComponent();

            if (CommonManager.Instance.NWMode == true)
            {
                ViewUtil.SetIsEnabledChildren(grid_folder, false);
                checkbox_OpenFolderWithFileDialog.IsEnabled = true;
                label1.IsEnabled          = true;
                textBox_setPath.IsEnabled = true;
                button_setPath.IsEnabled  = true;
                textBox_exe.SetReadOnlyWithEffect(true);
                button_exe.IsEnabled = true;
                textBox_cmdBon.SetReadOnlyWithEffect(true);
                label_recFolder.ToolTip     = "未設定の場合は(EpgTimerSrv側の)「設定関係保存フォルダ」がデフォルトになります";
                listBox_recFolder.IsEnabled = true;
                textBox_recFolder.SetReadOnlyWithEffect(true);
                button_rec_open.IsEnabled = true;
                textBox_recInfoFolder.SetReadOnlyWithEffect(true);
                button_recInfoFolder.IsEnabled = true;
                listBox_bon.IsEnabled          = true;

                ViewUtil.SetIsEnabledChildren(grid_epg, false);
                ServiceListHeader.IsEnabled = true;
                listView_service.IsEnabled  = true;
                listView_time.IsEnabled     = true;
                ViewUtil.SetIsEnabledChildren(grid_ServiceOptions, false);
                checkBox_showEpgCapServiceOnly.IsEnabled = true;
                checkBox_SortServiceList.IsEnabled       = true;

                tab_NW.Foreground = SystemColors.GrayTextBrush;
                ViewUtil.SetIsEnabledChildren(grid_tcpServer, false);
                ViewUtil.SetIsEnabledChildren(grid_tcpCtrl, false);
                textBox_tcpAcl.SetReadOnlyWithEffect(true);

                checkBox_httpServer.IsEnabled = false;
                ViewUtil.SetIsEnabledChildren(grid_httpCtrl, false);
                textBox_httpAcl.SetReadOnlyWithEffect(true);
                ViewUtil.SetIsEnabledChildren(grid_httpfolder, false);
                textBox_docrootPath.SetReadOnlyWithEffect(true);
                button_docrootPath.IsEnabled  = true;
                checkBox_httpLog.IsEnabled    = false;
                checkBox_dlnaServer.IsEnabled = false;
            }

            //エスケープキャンセルだけは常に有効にする。
            var bxr = new BoxExchangeEditor(null, this.listBox_recFolder, true);
            var bxb = new BoxExchangeEditor(null, this.listBox_bon, true);
            var bxt = new BoxExchangeEditor(null, this.listView_time, true);

            new BoxExchangeEditor(null, this.listView_service, true);

            bxr.TargetBox.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(bxr.TargetBox, textBox_recFolder);
            bxr.TargetBox.KeyDown          += ViewUtil.KeyDown_Enter(button_rec_open);
            bxr.targetBoxAllowDoubleClick(bxr.TargetBox, (sender, e) => button_rec_open.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));

            // バージョン文字列を表示
            textBlock_versionText.Text = App.VERSION_TEXT != "" ? "バージョン情報 : " + ((AssemblyInformationalVersionAttribute)Attribute.GetCustomAttribute(Assembly.GetEntryAssembly(), typeof(AssemblyInformationalVersionAttribute))).InformationalVersion : "";

            if (CommonManager.Instance.NWMode == false)
            {
                //録画設定関係
                bxr.AllowDragDrop();
                bxr.AllowKeyAction();
                button_rec_up.Click       += bxr.button_Up_Click;
                button_rec_down.Click     += bxr.button_Down_Click;
                button_rec_del.Click      += bxr.button_Delete_Click;
                button_rec_add.Click      += (sender, e) => textBox_recFolder.Text = SettingPath.CheckFolder(textBox_recFolder.Text);
                button_rec_add.Click      += ViewUtil.ListBox_TextCheckAdd(listBox_recFolder, textBox_recFolder);
                textBox_recFolder.KeyDown += ViewUtil.KeyDown_Enter(button_rec_add);

                //チューナ関係関係
                bxb.AllowDragDrop();
                button_bon_up.Click   += bxb.button_Up_Click;
                button_bon_down.Click += bxb.button_Down_Click;

                //EPG取得関係
                bxt.AllowDragDrop();
                bxt.AllowKeyAction();
                button_upTime.Click   += bxt.button_Up_Click;
                button_downTime.Click += bxt.button_Down_Click;
                button_delTime.Click  += bxt.button_Delete_Click;
                SelectableItem.Set_CheckBox_PreviewChanged(listView_time);
                SelectableItem.Set_CheckBox_PreviewChanged(listView_service);
            }

            //これは即時反映。DataContextとSettings.Instanceを両方書き換える。
            checkbox_OpenFolderWithFileDialog.Click += (sender, e) =>
                                                       Settings.Instance.OpenFolderWithFileDialog = checkbox_OpenFolderWithFileDialog.IsChecked == true;

            button_setPath.Click       += ViewUtil.OpenFolderNameDialog(textBox_setPath, "設定関係保存フォルダの選択");
            button_exe.Click           += ViewUtil.OpenFileNameDialog(textBox_exe, false, "", ".exe", true);
            button_recInfoFolder.Click += ViewUtil.OpenFolderNameDialog(textBox_recInfoFolder, "録画情報保存フォルダの選択", true);
            button_rec_open.Click      += ViewUtil.OpenFolderNameDialog(textBox_recFolder, "録画フォルダの選択", true);
            button_docrootPath.Click   += ViewUtil.OpenFolderNameDialog(textBox_docrootPath, "WebUI公開フォルダの選択");

            combo_bon_num.ItemsSource = Enumerable.Range(0, 100);
            combo_bon_epgnum.Items.Add("すべて");
            combo_bon_epgnum.Items.AddItems(Enumerable.Range(0, 100));

            comboBox_wday.ItemsSource   = new[] { "毎日" }.Concat(CommonManager.DayOfWeekArray);
            comboBox_wday.SelectedIndex = 0;
            comboBox_HH.ItemsSource     = Enumerable.Range(0, 24);
            comboBox_HH.SelectedIndex   = 0;
            comboBox_MM.ItemsSource     = Enumerable.Range(0, 60);
            comboBox_MM.SelectedIndex   = 0;
        }
Пример #4
0
        public void SaveSetting()
        {
            string org_setPath = SettingPath.SettingFolderPath;

            SettingPath.SettingFolderPath = textBox_setPath.Text;
            System.IO.Directory.CreateDirectory(SettingPath.SettingFolderPath);
            IsChangeSettingPath = org_setPath.Equals(SettingPath.SettingFolderPath, StringComparison.OrdinalIgnoreCase) == false;

            SettingPath.EdcbExePath = textBox_exe.Text;

            //同じ値の時は書き込まない
            if (IniFileHandler.GetPrivateProfileString("APP_CMD_OPT", "Bon", "-d", SettingPath.ViewAppIniPath) != textBox_cmdBon.Text)
            {
                IniFileHandler.WritePrivateProfileString("APP_CMD_OPT", "Bon", textBox_cmdBon.Text, SettingPath.ViewAppIniPath);
            }
            if (IniFileHandler.GetPrivateProfileString("APP_CMD_OPT", "Min", "-min", SettingPath.ViewAppIniPath) != textBox_cmdMin.Text)
            {
                IniFileHandler.WritePrivateProfileString("APP_CMD_OPT", "Min", textBox_cmdMin.Text, SettingPath.ViewAppIniPath);
            }
            if (IniFileHandler.GetPrivateProfileString("APP_CMD_OPT", "ViewOff", "-noview", SettingPath.ViewAppIniPath) != textBox_cmdViewOff.Text)
            {
                IniFileHandler.WritePrivateProfileString("APP_CMD_OPT", "ViewOff", textBox_cmdViewOff.Text, SettingPath.ViewAppIniPath);
            }

            settings.DefRecFolders = ViewUtil.GetFolderList(listBox_recFolder);
            IniFileHandler.WritePrivateProfileString("SET", "RecInfoFolder", SettingPath.CheckFolder(textBox_recInfoFolder.Text), "", SettingPath.CommonIniPath);

            for (int i = 0; i < listBox_bon.Items.Count; i++)
            {
                var info = listBox_bon.Items[i] as TunerInfo;
                IniFileHandler.WritePrivateProfileString(info.BonDriver, "Count", info.TunerNumInt, SettingPath.TimerSrvIniPath);
                IniFileHandler.WritePrivateProfileString(info.BonDriver, "GetEpg", info.EPGNum != "0", SettingPath.TimerSrvIniPath);
                IniFileHandler.WritePrivateProfileString(info.BonDriver, "EPGCount", info.EPGNumInt >= info.TunerNumInt ? 0 : info.EPGNumInt, SettingPath.TimerSrvIniPath);
                IniFileHandler.WritePrivateProfileString(info.BonDriver, "Priority", i, SettingPath.TimerSrvIniPath);
            }

            IniFileHandler.WritePrivateProfileString("SET", "BSBasicOnly", checkBox_bs.IsChecked, SettingPath.CommonIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "CS1BasicOnly", checkBox_cs1.IsChecked, SettingPath.CommonIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "CS2BasicOnly", checkBox_cs2.IsChecked, SettingPath.CommonIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "CS3BasicOnly", checkBox_sp.IsChecked, SettingPath.CommonIniPath);
            IniFileHandler.WritePrivateProfileString("EPGCAP", "EpgCapTimeOut", textBox_EpgCapTimeOut.Text, SettingPath.BonCtrlIniPath);
            IniFileHandler.WritePrivateProfileString("EPGCAP", "EpgCapSaveTimeOut", checkBox_EpgCapSaveTimeOut.IsChecked, SettingPath.BonCtrlIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "TimeSync", checkBox_timeSync.IsChecked, SettingPath.TimerSrvIniPath);

            foreach (ServiceViewItem info in listView_service.Items)
            {
                //変更中に更新される場合があるため
                ChSet5.ChItem(info.Key, true).EpgCapFlag = info.IsSelected;
            }

            IniFileHandler.WritePrivateProfileString("EPG_CAP", "Count", listView_time.Items.Count, SettingPath.TimerSrvIniPath);
            IniFileHandler.DeletePrivateProfileNumberKeys("EPG_CAP", SettingPath.TimerSrvIniPath);
            IniFileHandler.DeletePrivateProfileNumberKeys("EPG_CAP", SettingPath.TimerSrvIniPath, "", "Select");
            IniFileHandler.DeletePrivateProfileNumberKeys("EPG_CAP", SettingPath.TimerSrvIniPath, "", "BasicOnlyFlags");
            for (int i = 0; i < listView_time.Items.Count; i++)
            {
                var item = listView_time.Items[i] as EpgCaptime;
                IniFileHandler.WritePrivateProfileString("EPG_CAP", i.ToString(), item.Time, SettingPath.TimerSrvIniPath);
                IniFileHandler.WritePrivateProfileString("EPG_CAP", i.ToString() + "Select", item.IsSelected, SettingPath.TimerSrvIniPath);
                int flags = (item.BSBasicOnly ? 1 : 0) | (item.CS1BasicOnly ? 2 : 0) | (item.CS2BasicOnly ? 4 : 0) | (item.SPBasicOnly ? 8 : 0);
                IniFileHandler.WritePrivateProfileString("EPG_CAP", i.ToString() + "BasicOnlyFlags", flags, SettingPath.TimerSrvIniPath);
            }

            IniFileHandler.WritePrivateProfileString("SET", "NGEpgCapTime", textBox_ngCapMin.Text, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "NGEpgCapTunerTime", textBox_ngTunerMin.Text, SettingPath.TimerSrvIniPath);

            // ネットワーク
            IniFileHandler.WritePrivateProfileString("SET", "EnableTCPSrv", checkBox_tcpServer.IsChecked, false, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "TCPIPv6", checkBox_tcpIPv6.IsChecked, false, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "TCPPort", textBox_tcpPort.Text, "4510", SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "TCPAccessControlList", textBox_tcpAcl.Text, "+127.0.0.1,+192.168.0.0/16", SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "TCPResponseTimeoutSec", textBox_tcpResTo.Text, "120", SettingPath.TimerSrvIniPath);

            var enableHttpSrv = checkBox_httpServer.IsChecked != true ? null : checkBox_httpLog.IsChecked != true ? "1" : "2";

            IniFileHandler.WritePrivateProfileString("SET", "EnableHttpSrv", enableHttpSrv, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "HttpPort", textBox_httpPort.Text, "5510", SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "HttpAccessControlList", textBox_httpAcl.Text, "+127.0.0.1", SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "HttpRequestTimeoutSec", textBox_httpTimeout.Text, "120", SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "HttpNumThreads", textBox_httpThreads.Text, "5", SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "HttpPublicFolder", textBox_docrootPath.Text, SettingPath.DefHttpPublicPath, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "EnableDMS", checkBox_dlnaServer.IsChecked, false, SettingPath.TimerSrvIniPath);
        }
Пример #5
0
        public SetAppView()
        {
            InitializeComponent();

            if (CommonManager.Instance.NWMode == true)
            {
                tabItem1.Foreground      = SystemColors.GrayTextBrush;
                grid_AppRecEnd.IsEnabled = false;
                grid_AppRec.IsEnabled    = false;
                ViewUtil.SetIsEnabledChildren(grid_AppCancelMain, false);
                ViewUtil.SetIsEnabledChildren(grid_AppCancelMainInput, false);
                textBox_process.SetReadOnlyWithEffect(true);

                ViewUtil.SetIsEnabledChildren(grid_AppReserve1, false);
                ViewUtil.SetIsEnabledChildren(grid_AppReserve2, false);
                ViewUtil.SetIsEnabledChildren(grid_AppReserveIgnore, false);
                text_RecInfo2RegExp.SetReadOnlyWithEffect(true);
                checkBox_autoDel.IsEnabled = false;
                ViewUtil.SetIsEnabledChildren(grid_App2DelMain, false);
                listBox_ext.IsEnabled = true;
                textBox_ext.SetReadOnlyWithEffect(true);
                grid_App2DelChkFolderText.IsEnabled = true;
                listBox_chk_folder.IsEnabled        = true;
                textBox_chk_folder.SetReadOnlyWithEffect(true);
                button_chk_open.IsEnabled = true;

                grid_recname.IsEnabled      = false;
                checkBox_noChkYen.IsEnabled = false;
                grid_delReserve.IsEnabled   = false;

                checkBox_wakeReconnect.IsEnabled    = true;
                stackPanel_WoLWait.IsEnabled        = true;
                checkBox_suspendClose.IsEnabled     = true;
                checkBox_keepTCPConnect.IsEnabled   = true;
                grid_srvResident.IsEnabled          = false;
                button_srvSetting.IsEnabled         = false;
                label_shortCutSrv.IsEnabled         = false;
                button_shortCutSrv.IsEnabled        = false;
                checkBox_srvSaveNotifyLog.IsEnabled = false;
                checkBox_srvSaveDebugLog.IsEnabled  = false;
                grid_tsExt.IsEnabled = false;
            }

            //0 全般
            button_srvSetting.Click += (sender, e) => CommonManager.OpenSrvSetting();

            var SetScButton = new Action <Button, string, string>((btn, baseName, scLinkPath) =>
            {
                string scPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), baseName + ".lnk");
                btn.Content   = File.Exists(scPath) ? "削除" : "作成";
                btn.Click    += (sender, e) =>
                {
                    try
                    {
                        if (File.Exists(scPath))
                        {
                            File.Delete(scPath);
                        }
                        else
                        {
                            CommonUtil.CreateShortCut(scPath, scLinkPath, "");
                        }
                        btn.Content = File.Exists(scPath) ? "削除" : "作成";
                    }
                    catch (Exception ex) { MessageBox.Show(ex.ToString()); }
                };
            });

            SetScButton(button_shortCut, Path.GetFileNameWithoutExtension(SettingPath.ModuleName), Path.Combine(SettingPath.ModulePath, SettingPath.ModuleName));
            SetScButton(button_shortCutSrv, "EpgTimerSrv", Path.Combine(SettingPath.ModulePath, "EpgTimerSrv.exe"));

            //1 録画動作
            RadioButtonTagConverter.SetBindingButtons(CommonUtil.NameOf(() => settings.DefRecEndMode), panel_recEndMode);
            button_process_open.Click += ViewUtil.OpenFileNameDialog(textBox_process, true, "", ".exe");
            comboBox_process.Items.AddItems(new[] { "リアルタイム", "高", "通常以上", "通常", "通常以下", "低" });

            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 += bx.button_Delete_Click;
                button_process_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_process, textBox_process);
                textBox_process.KeyDown  += ViewUtil.KeyDown_Enter(button_process_add);
            }

            //2 予約管理情報
            button_chk_open.Click += ViewUtil.OpenFolderNameDialog(textBox_chk_folder, "自動削除対象フォルダの選択", true);

            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);
            bxc.TargetBox.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(bxc.TargetBox, textBox_chk_folder);
            bxc.TargetBox.KeyDown          += ViewUtil.KeyDown_Enter(button_chk_open);
            bxc.targetBoxAllowDoubleClick(bxc.TargetBox, (sender, e) => button_chk_open.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            if (CommonManager.Instance.NWMode == false)
            {
                bxe.AllowKeyAction();
                bxe.AllowDragDrop();
                button_ext_del.Click += bxe.button_Delete_Click;
                button_ext_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_ext, textBox_ext);
                bxc.AllowKeyAction();
                bxc.AllowDragDrop();
                button_chk_del.Click += bxc.button_Delete_Click;
                button_chk_add.Click += (sender, e) => textBox_chk_folder.Text = SettingPath.CheckFolder(textBox_chk_folder.Text);
                button_chk_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_chk_folder, textBox_chk_folder);

                textBox_ext.KeyDown        += ViewUtil.KeyDown_Enter(button_ext_add);
                textBox_chk_folder.KeyDown += ViewUtil.KeyDown_Enter(button_chk_add);
            }

            //3 ボタン表示 ボタン表示画面の上下ボタンのみ他と同じものを使用する。
            bxb = new BoxExchangeEditor(this.listBox_itemBtn, this.listBox_viewBtn, true);
            bxt = new BoxExchangeEditor(this.listBox_itemTask, this.listBox_viewTask, true);
            textblockTimer.Text = CommonManager.Instance.NWMode == true ?
                                  "EpgTimerNW側の設定です。" :
                                  "録画終了時にスタンバイ、休止する場合は必ず表示されます(ただし、サービス未使用時はこの設定は使用されず15秒固定)。";

            //上部表示ボタン関係
            bxb.AllowDuplication(StringItem.Items(Settings.ViewButtonSpacer), StringItem.Cloner, StringItem.Comparator);
            button_btnUp.Click   += bxb.button_Up_Click;
            button_btnDown.Click += bxb.button_Down_Click;
            button_btnAdd.Click  += (sender, e) => button_Add(bxb, buttonItem);
            button_btnIns.Click  += (sender, e) => button_Add(bxb, buttonItem, true);
            button_btnDel.Click  += (sender, e) => button_Dell(bxb, bxt, buttonItem);
            bxb.sourceBoxAllowKeyAction(listBox_itemBtn, (sender, e) => button_btnAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxb.targetBoxAllowKeyAction(listBox_viewBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxb.sourceBoxAllowDoubleClick(listBox_itemBtn, (sender, e) => button_btnAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxb.targetBoxAllowDoubleClick(listBox_viewBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxb.sourceBoxAllowDragDrop(listBox_itemBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxb.targetBoxAllowDragDrop(listBox_viewBtn, (sender, e) => drag_drop(sender, e, button_btnAdd, button_btnIns));

            //タスクアイコン関係
            bxt.AllowDuplication(StringItem.Items(Settings.TaskMenuSeparator), StringItem.Cloner, StringItem.Comparator);
            button_taskUp.Click   += bxt.button_Up_Click;
            button_taskDown.Click += bxt.button_Down_Click;
            button_taskAdd.Click  += (sender, e) => button_Add(bxt, taskItem);
            button_taskIns.Click  += (sender, e) => button_Add(bxt, taskItem, true);
            button_taskDel.Click  += (sender, e) => button_Dell(bxt, bxb, taskItem);
            bxt.sourceBoxAllowKeyAction(listBox_itemTask, (sender, e) => button_taskAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxt.targetBoxAllowKeyAction(listBox_viewTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxt.sourceBoxAllowDoubleClick(listBox_itemTask, (sender, e) => button_taskAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxt.targetBoxAllowDoubleClick(listBox_viewTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxt.sourceBoxAllowDragDrop(listBox_itemTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxt.targetBoxAllowDragDrop(listBox_viewTask, (sender, e) => drag_drop(sender, e, button_taskAdd, button_taskIns));

            //4 カスタムボタン
            button_exe1.Click += ViewUtil.OpenFileNameDialog(textBox_exe1, false, "", ".exe");
            button_exe2.Click += ViewUtil.OpenFileNameDialog(textBox_exe2, false, "", ".exe");
            button_exe3.Click += ViewUtil.OpenFileNameDialog(textBox_exe3, false, "", ".exe");

            //5 iEpg キャンセルアクションだけは付けておく
            new BoxExchangeEditor(null, this.listBox_service, true);
            var bxi = new BoxExchangeEditor(null, this.listBox_iEPG, true);

            bxi.targetBoxAllowKeyAction(this.listBox_iEPG, (sender, e) => button_del.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxi.TargetBox.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(bxi.TargetBox, textBox_station);
            textBox_station.KeyDown        += ViewUtil.KeyDown_Enter(button_add);
        }
Пример #6
0
 public static List <string> GetFolderList(ListBox box)
 {
     return(box.Items.OfType <string>().Select(s => SettingPath.CheckFolder(s)).Where(s => s != "").ToList());
 }