コード例 #1
0
        private void SetAppView_tabItem4()
        {
            if (CommonManager.Instance.NWMode == true)
            {
                checkBox_tcpServer.IsEnabled = false;       // ネットワーク接続を許可する

                checkBox_timeSync.IsEnabled        = false; // EPG取得時に放送波時間でPC時計を同期する
                checkBox_srvResident.IsEnabled     = false; // EpgTimerSrvを常駐させる
                checkBox_srvShowTray.IsEnabled     = false; // タスクトレイアイコンを表示する
                checkBox_srvNoBalloonTip.IsEnabled = false; // バルーンチップでの動作通知を抑制する

                checkBox_wakeReconnect.IsEnabled  = true;   // 起動時に前回接続サーバーに接続する
                group_WoLWait.IsEnabled           = true;   // WoL設定
                checkBox_suspendClose.IsEnabled   = true;   // 休止/スタンバイ移行時にEpgTimerNWを終了する
                checkBox_ngAutoEpgLoad.IsEnabled  = true;   // EPGデータを自動的に読み込まない
                checkBox_keepTCPConnect.IsEnabled = true;   // EpgTimerSrvとの接続維持を試みる
            }
            if (ServiceCtrlClass.IsStarted("EpgTimer Service") == true)
            {
                checkBox_srvResident.IsEnabled = false;
            }

            checkBox_autoDelRecInfo.IsEnabled   = IniFileHandler.CanUpdateInifile; // 録画結果を自動的に削除する
            checkBox_srvSaveNotifyLog.IsEnabled = IniFileHandler.CanUpdateInifile; // 情報通知ログをファイルに保存する
            checkBox_srvSaveDebugLog.IsEnabled  = IniFileHandler.CanUpdateInifile; // デバッグ出力をファイルに保存する
            if (IniFileHandler.CanUpdateInifile == false)
            {
                button_recDef.Content = "録画プリセットを確認";
            }

            // 読める設定のみ項目に反映させる
            if (IniFileHandler.CanReadInifile)
            {
                if (IniFileHandler.GetPrivateProfileInt("SET", "AutoDelRecInfo", 0, SettingPath.TimerSrvIniPath) == 1)
                {
                    checkBox_autoDelRecInfo.IsChecked = true;
                }
                if (IniFileHandler.GetPrivateProfileInt("SET", "RecInfoDelFile", 0, SettingPath.CommonIniPath) == 1)
                {
                    checkBox_autoDelRecFile.IsChecked = true;
                }
                textBox_autoDelRecInfo.Text = IniFileHandler.GetPrivateProfileInt("SET", "AutoDelRecInfoNum", 100, SettingPath.TimerSrvIniPath).ToString();

                if (IniFileHandler.GetPrivateProfileInt("SET", "TimeSync", 0, SettingPath.TimerSrvIniPath) == 1)
                {
                    checkBox_timeSync.IsChecked = true;
                }

                int residentMode = IniFileHandler.GetPrivateProfileInt("SET", "ResidentMode", 0, SettingPath.TimerSrvIniPath);
                checkBox_srvResident.IsChecked     = residentMode >= 1;
                checkBox_srvShowTray.IsChecked     = residentMode >= 2;
                checkBox_srvNoBalloonTip.IsChecked = IniFileHandler.GetPrivateProfileInt("SET", "NoBalloonTip", 0, SettingPath.TimerSrvIniPath) == 1;

                if (IniFileHandler.GetPrivateProfileInt("SET", "EnableTCPSrv", 0, SettingPath.TimerSrvIniPath) == 1)
                {
                    checkBox_tcpServer.IsChecked = true;
                }
                textBox_tcpPort.Text = IniFileHandler.GetPrivateProfileInt("SET", "TCPPort", 4510, SettingPath.TimerSrvIniPath).ToString();
                textBox_tcpAcl.Text  = IniFileHandler.GetPrivateProfileString("SET", "TCPAccessControlList", "+127.0.0.1,+192.168.0.0/16", SettingPath.TimerSrvIniPath);
                string base64string = IniFileHandler.GetPrivateProfileString("SET", "TCPAccessPassword", "", SettingPath.TimerSrvIniPath);
                password = new SerializableSecureString(base64string);
                if (password.Length > 0 && password.Length == base64string.Length)
                {
                    // decrypt 出来なかったので disable にする
                    passwordBox_tcpPassword.IsEnabled = false;
                }
                else
                {
                    // セキュアなコピーではないが PasswordBox.SecurePassword の setter がないため...
                    passwordBox_tcpPassword.Password = new System.Net.NetworkCredential(string.Empty, password.SecureString).Password;
                }

                textBox_tcpResTo.Text = IniFileHandler.GetPrivateProfileInt("SET", "TCPResponseTimeoutSec", 120, SettingPath.TimerSrvIniPath).ToString();

                checkBox_srvSaveNotifyLog.IsChecked = IniFileHandler.GetPrivateProfileInt("SET", "SaveNotifyLog", 0, SettingPath.TimerSrvIniPath) == 1;
                checkBox_srvSaveDebugLog.IsChecked  = IniFileHandler.GetPrivateProfileInt("SET", "SaveDebugLog", 0, SettingPath.TimerSrvIniPath) == 1;
            }

            checkBox_closeMin.IsChecked          = Settings.Instance.CloseMin;
            checkBox_minWake.IsChecked           = Settings.Instance.WakeMin;
            checkBox_applyMulti.IsChecked        = Settings.Instance.ApplyMultiInstance;
            checkBox_noToolTips.IsChecked        = Settings.Instance.NoToolTip;
            checkBox_noBallonTips.IsChecked      = Settings.Instance.NoBallonTips;
            textBox_ForceHideBalloonTipSec.Text  = Settings.Instance.ForceHideBalloonTipSec.ToString();
            checkBox_AutoSaveNotifyLog.IsChecked = Settings.Instance.AutoSaveNotifyLog == 1;
            checkBox_showTray.IsChecked          = Settings.Instance.ShowTray;
            checkBox_minHide.IsChecked           = Settings.Instance.MinHide;
            checkBox_cautionManyChange.IsChecked = Settings.Instance.CautionManyChange;
            textBox_cautionManyChange.Text       = Settings.Instance.CautionManyNum.ToString();
            checkBox_saveSearchKeyword.IsChecked = Settings.Instance.SaveSearchKeyword;
            checkBox_keepTCPConnect.IsChecked    = Settings.Instance.ChkSrvRegistTCP;
            checkBox_upDateTaskText.IsChecked    = Settings.Instance.UpdateTaskText;
            textBox_chkTimerInterval.Text        = Settings.Instance.ChkSrvRegistInterval.ToString();

            checkBox_wakeReconnect.IsChecked    = Settings.Instance.WakeReconnectNW;
            checkBox_WoLWait.IsChecked          = Settings.Instance.WoLWait;
            checkBox_WoLWaitRecconect.IsChecked = Settings.Instance.WoLWaitRecconect;
            textBox_WoLWaitSecond.Text          = Settings.Instance.WoLWaitSecond.ToString();
            checkBox_suspendClose.IsChecked     = Settings.Instance.SuspendCloseNW;
            checkBox_ngAutoEpgLoad.IsChecked    = Settings.Instance.NgAutoEpgLoadNW;

            defSearchKey = Settings.Instance.DefSearchKey.Clone();
        }
コード例 #2
0
ファイル: EpgViewBase.cs プロジェクト: nekopanda/EDCB
        protected bool ReloadEpgData()
        {
            try
            {
                if (setViewInfo == null)
                {
                    return(true);
                }
                if (CommonManager.Instance.IsConnected == false)
                {
                    return(false);
                }

                if (setViewInfo.SearchMode == false)
                {
                    ErrCode err = CommonManager.Instance.DB.ReloadEpgData();
                    if (CommonManager.CmdErrMsgTypical(err, "EPGデータの取得") == false)
                    {
                        return(false);
                    }
                    serviceEventList = new Dictionary <UInt64, EpgServiceEventInfo>(CommonManager.Instance.DB.ServiceEventList);
                }
                else
                {
                    //番組情報の検索
                    var list = new List <EpgEventInfo>();
                    EpgSearchKeyInfo setKey = setViewInfo.SearchKey.Clone();
                    if (setViewInfo.SearchServiceFromView == true)
                    {
                        setKey.serviceList = setViewInfo.ViewServiceList.Select(sv => (long)sv).ToList();
                    }
                    ErrCode err = cmd.SendSearchPg(CommonUtil.ToList(setKey), ref list);
                    if (CommonManager.CmdErrMsgTypical(err, "EPGデータの取得") == false)
                    {
                        return(false);
                    }

                    //サービス毎のリストに変換
                    serviceEventList = new Dictionary <UInt64, EpgServiceEventInfo>();
                    foreach (EpgEventInfo eventInfo in list)
                    {
                        UInt64 id = eventInfo.Create64Key();
                        EpgServiceEventInfo serviceInfo;
                        if (serviceEventList.TryGetValue(id, out serviceInfo) == false)
                        {
                            if (ChSet5.ChList.ContainsKey(id) == false)
                            {
                                //サービス情報ないので無効
                                continue;
                            }
                            serviceInfo             = new EpgServiceEventInfo();
                            serviceInfo.serviceInfo = CommonManager.ConvertChSet5To(ChSet5.ChList[id]);

                            serviceEventList.Add(id, serviceInfo);
                        }
                        serviceInfo.eventList.Add(eventInfo);
                    }
                }

                return(true);
            }
            catch (Exception ex) { CommonUtil.DispatcherMsgBoxShow(ex.Message + "\r\n" + ex.StackTrace); }
            return(false);
        }
コード例 #3
0
ファイル: SetAppView.xaml.cs プロジェクト: nekopanda/EDCB
        private void button_searchDef_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new SetDefSearchSettingWindow();
            dlg.Owner = CommonUtil.GetTopWindow(this);
            dlg.SetDefSetting(defSearchKey);

            if (dlg.ShowDialog() == true)
            {
                defSearchKey = dlg.GetSetting();
            }
        }
コード例 #4
0
ファイル: SetAppView.xaml.cs プロジェクト: nekopanda/EDCB
        private void SetAppView_tabItem4()
        {
            if (CommonManager.Instance.NWMode == true)
            {
                checkBox_tcpServer.IsEnabled = false; // ネットワーク接続を許可する

                checkBox_timeSync.IsEnabled = false; // EPG取得時に放送波時間でPC時計を同期する
                checkBox_srvResident.IsEnabled = false; // EpgTimerSrvを常駐させる
                checkBox_srvShowTray.IsEnabled = false; // タスクトレイアイコンを表示する
                checkBox_srvNoBalloonTip.IsEnabled = false; // バルーンチップでの動作通知を抑制する

                checkBox_wakeReconnect.IsEnabled = true; // 起動時に前回接続サーバーに接続する
                group_WoLWait.IsEnabled = true; // WoL設定
                checkBox_suspendClose.IsEnabled = true; // 休止/スタンバイ移行時にEpgTimerNWを終了する
                checkBox_ngAutoEpgLoad.IsEnabled = true; // EPGデータを自動的に読み込まない
                checkBox_keepTCPConnect.IsEnabled = true; // EpgTimerSrvとの接続維持を試みる
            }
            if (ServiceCtrlClass.IsStarted("EpgTimer Service") == true)
            {
                checkBox_srvResident.IsEnabled = false;
            }

            checkBox_autoDelRecInfo.IsEnabled = IniFileHandler.CanUpdateInifile; // 録画結果を自動的に削除する
            checkBox_srvSaveNotifyLog.IsEnabled = IniFileHandler.CanUpdateInifile; // 情報通知ログをファイルに保存する
            checkBox_srvSaveDebugLog.IsEnabled = IniFileHandler.CanUpdateInifile; // デバッグ出力をファイルに保存する
            if (IniFileHandler.CanUpdateInifile == false)
            {
                button_recDef.Content = "録画プリセットを確認";
            }

            // 読める設定のみ項目に反映させる
            if (IniFileHandler.CanReadInifile)
            {
                if (IniFileHandler.GetPrivateProfileInt("SET", "AutoDelRecInfo", 0, SettingPath.TimerSrvIniPath) == 1)
                {
                    checkBox_autoDelRecInfo.IsChecked = true;
                }
                if (IniFileHandler.GetPrivateProfileInt("SET", "RecInfoDelFile", 0, SettingPath.CommonIniPath) == 1)
                {
                    checkBox_autoDelRecFile.IsChecked = true;
                }
                textBox_autoDelRecInfo.Text = IniFileHandler.GetPrivateProfileInt("SET", "AutoDelRecInfoNum", 100, SettingPath.TimerSrvIniPath).ToString();

                if (IniFileHandler.GetPrivateProfileInt("SET", "TimeSync", 0, SettingPath.TimerSrvIniPath) == 1)
                {
                    checkBox_timeSync.IsChecked = true;
                }

                int residentMode = IniFileHandler.GetPrivateProfileInt("SET", "ResidentMode", 0, SettingPath.TimerSrvIniPath);
                checkBox_srvResident.IsChecked = residentMode >= 1;
                checkBox_srvShowTray.IsChecked = residentMode >= 2;
                checkBox_srvNoBalloonTip.IsChecked = IniFileHandler.GetPrivateProfileInt("SET", "NoBalloonTip", 0, SettingPath.TimerSrvIniPath) == 1;

                if (IniFileHandler.GetPrivateProfileInt("SET", "EnableTCPSrv", 0, SettingPath.TimerSrvIniPath) == 1)
                {
                    checkBox_tcpServer.IsChecked = true;
                }
                textBox_tcpPort.Text = IniFileHandler.GetPrivateProfileInt("SET", "TCPPort", 4510, SettingPath.TimerSrvIniPath).ToString();
                textBox_tcpAcl.Text = IniFileHandler.GetPrivateProfileString("SET", "TCPAccessControlList", "+127.0.0.1,+192.168.0.0/16", SettingPath.TimerSrvIniPath);
                string base64string = IniFileHandler.GetPrivateProfileString("SET", "TCPAccessPassword", "", SettingPath.TimerSrvIniPath);
                password = new SerializableSecureString(base64string);
                if (password.Length > 0 && password.Length == base64string.Length)
                {
                    // decrypt 出来なかったので disable にする
                    passwordBox_tcpPassword.IsEnabled = false;
                }
                else
                {
                    // セキュアなコピーではないが PasswordBox.SecurePassword の setter がないため...
                    passwordBox_tcpPassword.Password = new System.Net.NetworkCredential(string.Empty, password.SecureString).Password;
                }

                textBox_tcpResTo.Text = IniFileHandler.GetPrivateProfileInt("SET", "TCPResponseTimeoutSec", 120, SettingPath.TimerSrvIniPath).ToString();

                checkBox_srvSaveNotifyLog.IsChecked = IniFileHandler.GetPrivateProfileInt("SET", "SaveNotifyLog", 0, SettingPath.TimerSrvIniPath) == 1;
                checkBox_srvSaveDebugLog.IsChecked = IniFileHandler.GetPrivateProfileInt("SET", "SaveDebugLog", 0, SettingPath.TimerSrvIniPath) == 1;
            }

            checkBox_closeMin.IsChecked = Settings.Instance.CloseMin;
            checkBox_minWake.IsChecked = Settings.Instance.WakeMin;
            checkBox_applyMulti.IsChecked = Settings.Instance.ApplyMultiInstance;
            checkBox_noToolTips.IsChecked = Settings.Instance.NoToolTip;
            checkBox_noBallonTips.IsChecked = Settings.Instance.NoBallonTips;
            textBox_ForceHideBalloonTipSec.Text = Settings.Instance.ForceHideBalloonTipSec.ToString();
            checkBox_AutoSaveNotifyLog.IsChecked = Settings.Instance.AutoSaveNotifyLog == 1;
            checkBox_showTray.IsChecked = Settings.Instance.ShowTray;
            checkBox_minHide.IsChecked = Settings.Instance.MinHide;
            checkBox_cautionManyChange.IsChecked = Settings.Instance.CautionManyChange;
            textBox_cautionManyChange.Text = Settings.Instance.CautionManyNum.ToString();
            checkBox_saveSearchKeyword.IsChecked = Settings.Instance.SaveSearchKeyword;
            checkBox_keepTCPConnect.IsChecked = Settings.Instance.ChkSrvRegistTCP;
            checkBox_upDateTaskText.IsChecked = Settings.Instance.UpdateTaskText;
            textBox_chkTimerInterval.Text = Settings.Instance.ChkSrvRegistInterval.ToString();

            checkBox_wakeReconnect.IsChecked = Settings.Instance.WakeReconnectNW;
            checkBox_WoLWait.IsChecked = Settings.Instance.WoLWait;
            checkBox_WoLWaitRecconect.IsChecked = Settings.Instance.WoLWaitRecconect;
            textBox_WoLWaitSecond.Text = Settings.Instance.WoLWaitSecond.ToString();
            checkBox_suspendClose.IsChecked = Settings.Instance.SuspendCloseNW;
            checkBox_ngAutoEpgLoad.IsChecked = Settings.Instance.NgAutoEpgLoadNW;

            defSearchKey = Settings.Instance.DefSearchKey.Clone();
        }
コード例 #5
0
ファイル: SetAppView.xaml.cs プロジェクト: xceza7/EDCB
        private void button_searchDef_Click(object sender, RoutedEventArgs e)
        {
            SetDefSearchSettingWindow dlg = new SetDefSearchSettingWindow();
            dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual;
            dlg.SetDefSetting(defSearchKey);

            if (dlg.ShowDialog() == true)
            {
                defSearchKey = dlg.GetSetting();
            }
        }