/// <summary> /// PlugInFileの再読み込み指定があればする /// </summary> /// <returns></returns> public ErrCode ReloadPlugInFile() { ErrCode ret = ErrCode.CMD_SUCCESS; try { if (updatePlugInFile == true) { if (cmd == null) { ret = ErrCode.CMD_ERR; } else { writePlugInList.Clear(); writePlugInList = null; writePlugInList = new Dictionary <int, string>(); recNamePlugInList.Clear(); recNamePlugInList = null; recNamePlugInList = new Dictionary <int, string>(); List <String> writeList = new List <string>(); List <String> recNameList = new List <string>(); ret = (ErrCode)cmd.SendEnumPlugIn(2, ref writeList); if (ret == ErrCode.CMD_SUCCESS) { ret = (ErrCode)cmd.SendEnumPlugIn(1, ref recNameList); if (ret == ErrCode.CMD_SUCCESS) { foreach (String info in writeList) { writePlugInList.Add(writePlugInList.Count, info); } foreach (String info in recNameList) { recNamePlugInList.Add(recNamePlugInList.Count, info); } updatePlugInFile = false; } } writeList.Clear(); recNameList.Clear(); writeList = null; recNameList = null; } } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } return(ret); }
/// <summary> /// PlugInFileの再読み込み指定があればする /// </summary> /// <returns></returns> public ErrCode ReloadPlugInFile() { ErrCode ret = ErrCode.CMD_SUCCESS; try { if (updatePlugInFile == true) { if (cmd == null) { return(ErrCode.CMD_ERR); } writePlugInList = new Dictionary <int, string>(); recNamePlugInList = new Dictionary <int, string>(); var writeList = new List <string>(); var recNameList = new List <string>(); ret = (ErrCode)cmd.SendEnumPlugIn(2, ref writeList); if (ret != ErrCode.CMD_SUCCESS) { return(ret); } ret = (ErrCode)cmd.SendEnumPlugIn(1, ref recNameList); if (ret != ErrCode.CMD_SUCCESS) { return(ret); } //dictionary使ってる意味無い‥ writeList.ForEach(info => writePlugInList.Add(writePlugInList.Count, info)); recNameList.ForEach(info => recNamePlugInList.Add(recNamePlugInList.Count, info)); updatePlugInFile = false; } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } return(ret); }
public RecSettingView() { InitializeComponent(); try { Settings.GetDefRecSetting(0, ref recSetting); comboBox_recMode.DataContext = CommonManager.Instance.RecModeDictionary.Values; comboBox_tuijyu.DataContext = CommonManager.Instance.YesNoDictionary.Values; comboBox_pittari.DataContext = CommonManager.Instance.YesNoDictionary.Values; comboBox_priority.DataContext = CommonManager.Instance.PriorityDictionary.Values; String plugInFile = "Write_Default.dll"; String recNamePlugInFile = ""; List <String> fileList = new List <string>(); ErrCode err = (ErrCode)cmd.SendEnumPlugIn(2, ref fileList); if (err == ErrCode.CMD_ERR_CONNECT) { MessageBox.Show("サーバー または EpgTimerSrv に接続できませんでした。"); } if (err == ErrCode.CMD_ERR_TIMEOUT) { MessageBox.Show("EpgTimerSrvとの接続にタイムアウトしました。"); } if (err != ErrCode.CMD_SUCCESS) { MessageBox.Show("PlugIn一覧の取得でエラーが発生しました。"); } int select = 0; foreach (string info in fileList) { int index = comboBox_writePlugIn.Items.Add(info); if (String.Compare(info, plugInFile, true) == 0) { select = index; } } if (comboBox_writePlugIn.Items.Count != 0) { comboBox_writePlugIn.SelectedIndex = select; } fileList.Clear(); if (err == ErrCode.CMD_SUCCESS) { err = (ErrCode)cmd.SendEnumPlugIn(1, ref fileList); if (err == ErrCode.CMD_ERR_CONNECT) { MessageBox.Show("サーバー または EpgTimerSrv に接続できませんでした。"); } if (err == ErrCode.CMD_ERR_TIMEOUT) { MessageBox.Show("EpgTimerSrvとの接続にタイムアウトしました。"); } if (err != ErrCode.CMD_SUCCESS) { MessageBox.Show("PlugIn一覧の取得でエラーが発生しました。"); } select = 0; comboBox_recNamePlugIn.Items.Add("なし"); foreach (string info in fileList) { int index = comboBox_recNamePlugIn.Items.Add(info); if (String.Compare(info, recNamePlugInFile, true) == 0) { select = index; } } if (comboBox_recNamePlugIn.Items.Count != 0) { comboBox_recNamePlugIn.SelectedIndex = select; } } if (err == ErrCode.CMD_SUCCESS) { List <CtrlCmdCLI.Def.TunerReserveInfo> tunerReserveList = new List <CtrlCmdCLI.Def.TunerReserveInfo>(); err = (ErrCode)cmd.SendEnumTunerReserve(ref tunerReserveList); if (err == ErrCode.CMD_ERR_CONNECT) { MessageBox.Show("サーバー または EpgTimerSrv に接続できませんでした。"); } if (err == ErrCode.CMD_ERR_TIMEOUT) { MessageBox.Show("EpgTimerSrvとの接続にタイムアウトしました。"); } if (err != ErrCode.CMD_SUCCESS) { MessageBox.Show("チューナー一覧の取得でエラーが発生しました。"); } tunerList.Add(new TunerSelectInfo("自動", 0)); foreach (TunerReserveInfo info in tunerReserveList) { if (info.tunerID != 0xFFFFFFFF) { tunerList.Add(new TunerSelectInfo(info.tunerName, info.tunerID)); } } comboBox_tuner.ItemsSource = tunerList; comboBox_tuner.SelectedIndex = 0; } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }