示例#1
0
 private void UpdateServiceBtn()
 {
     if (ServiceCtrlClass.ServiceIsInstalled("EpgTimer Service") == false)
     {
         button_inst.IsEnabled   = true;
         button_uninst.IsEnabled = false;
         button_start.IsEnabled  = false;
         button_stop.IsEnabled   = false;
     }
     else
     {
         button_inst.IsEnabled   = false;
         button_uninst.IsEnabled = true;
         if (ServiceCtrlClass.IsStarted("EpgTimer Service") == true)
         {
             button_start.IsEnabled = false;
             button_stop.IsEnabled  = true;
         }
         else
         {
             button_start.IsEnabled = true;
             button_stop.IsEnabled  = false;
         }
     }
     if (ServiceStop)
     {
         labelServiceInfo.Content = "※ 設定を閉じ、接続しなおしてください。";
     }
 }
示例#2
0
 private void button_start_Click(object sender, RoutedEventArgs e)
 {
     if (CommonManager.Instance.NWMode == false && CommonManager.Instance.IsConnected == true)
     {
         int count = Process.GetProcessesByName("EpgTimerSrv").Count();
         if (count > 0)
         {
             int residentMode = IniFileHandler.GetPrivateProfileInt("SET", "ResidentMode", 0, SettingPath.TimerSrvIniPath);
             if (residentMode > 0)
             {
                 MessageBox.Show("[動作設定]-[その他]-[EpgTimerSrvを常駐させる] をオフにしてください。");
             }
             else if (MessageBox.Show("EpgTimerSrv を一度終了する必要があります。終了させますか?", "確認", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
             {
                 if (CommonManager.Instance.CtrlCmd.SendClose() == ErrCode.CMD_SUCCESS)
                 {
                     count = WaitToExit() ? 0 : 1;
                 }
             }
         }
         if (count == 0)
         {
             if (ServiceCtrlClass.StartService("EpgTimer Service") == false)
             {
                 MessageBox.Show("サービスの開始に失敗しました。");
             }
             ServiceStop = true; // 接続しなおす必要がある。
         }
     }
     UpdateServiceBtn();
 }
示例#3
0
        private void button_inst_Click(object sender, RoutedEventArgs e)
        {
            String exePath = SettingPath.ModulePath + "\\EpgTimerSrv.exe";

            if (ServiceCtrlClass.Install("EpgTimer Service", "EpgTimer Service", exePath) == false)
            {
                MessageBox.Show("インストールに失敗しました。\r\nVista以降のOSでは、管理者権限で起動されている必要があります。");
            }
            UpdateServiceBtn();
        }
示例#4
0
 private void button_stop_Click(object sender, RoutedEventArgs e)
 {
     if (ServiceCtrlClass.StopService("EpgTimer Service") == false)
     {
         MessageBox.Show("サービスの停止に失敗しました。\r\nVista以降のOSでは、管理者権限で起動されている必要があります。");
     }
     else
     {
         ServiceStop = true;
     }
     UpdateServiceBtn();
 }
示例#5
0
        private void button_uninst_Click(object sender, RoutedEventArgs e)
        {
            bool started = ServiceCtrlClass.IsStarted("EpgTimer Service");

            if (ServiceCtrlClass.Uninstall("EpgTimer Service") == false)
            {
                MessageBox.Show("アンインストールに失敗しました。");
            }
            else if (started && WaitToExit())
            {
                ServiceStop |= started;
            }
            UpdateServiceBtn();
        }
示例#6
0
 private void UpdateServiceBtn()
 {
     if (ServiceCtrlClass.ServiceIsInstalled("EpgTimer Service") == false)
     {
         button_inst.IsEnabled   = true;
         button_uninst.IsEnabled = false;
         button_stop.IsEnabled   = false;
     }
     else
     {
         button_inst.IsEnabled   = false;
         button_uninst.IsEnabled = true;
         if (ServiceCtrlClass.IsStarted("EpgTimer Service") == true)
         {
             button_stop.IsEnabled = true;
         }
         else
         {
             button_stop.IsEnabled = false;
         }
     }
 }
示例#7
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();
        }