private void listView_recinfo_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (listView_recinfo.SelectedItem != null) { if (Settings.Instance.PlayDClick == false) { RecInfoItem info = listView_recinfo.SelectedItem as RecInfoItem; RecInfoDescWindow dlg = new RecInfoDescWindow(); dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual; dlg.SetRecInfo(info.RecInfo); dlg.ShowDialog(); } else { RecInfoItem info = listView_recinfo.SelectedItem as RecInfoItem; if (info.RecInfo.RecFilePath.Length > 0) { try { CommonManager.Instance.FilePlay(info.RecInfo.RecFilePath); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } } }
private void openFolder_Click(object sender, RoutedEventArgs e) { if (listView_recinfo.SelectedItem != null && CommonManager.Instance.NWMode == false) { RecInfoItem info = listView_recinfo.SelectedItem as RecInfoItem; if (info.RecFilePath.Length > 0) { try { if (System.IO.File.Exists(info.RecFilePath)) { using (System.Diagnostics.Process.Start("EXPLORER.EXE", "/select,\"" + info.RecFilePath + "\"")) { } return; } string folderPath = System.IO.Path.GetDirectoryName(info.RecFilePath); if (System.IO.Directory.Exists(folderPath)) { using (System.Diagnostics.Process.Start("EXPLORER.EXE", "\"" + folderPath + "\"")) { } return; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); return; } } MessageBox.Show("録画フォルダが存在しません"); } }
private void openFolder_Click(object sender, RoutedEventArgs e) { if (listView_recinfo.SelectedItem != null && CommonManager.Instance.NWMode == false) { RecInfoItem info = listView_recinfo.SelectedItem as RecInfoItem; if (info.RecFilePath.Length == 0) { MessageBox.Show("録画ファイルが存在しません"); } else { if (System.IO.File.Exists(info.RecFilePath) == true) { String cmd = "/select,"; cmd += "\"" + info.RecFilePath + "\""; System.Diagnostics.Process.Start("EXPLORER.EXE", cmd); } else { String folderPath = System.IO.Path.GetDirectoryName(info.RecFilePath); System.Diagnostics.Process.Start("EXPLORER.EXE", folderPath); } } } }
private void listView_recinfo_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (listView_recinfo.SelectedItem != null) { if (Settings.Instance.PlayDClick == false) { RecInfoItem info = listView_recinfo.SelectedItem as RecInfoItem; RecInfoDescWindow dlg = new RecInfoDescWindow(); dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual; RecFileInfo extraRecInfo = new RecFileInfo(); if (CommonManager.CreateSrvCtrl().SendGetRecInfo(info.RecInfo.ID, ref extraRecInfo) == ErrCode.CMD_SUCCESS) { info.RecInfo.ProgramInfo = extraRecInfo.ProgramInfo; info.RecInfo.ErrInfo = extraRecInfo.ErrInfo; } dlg.SetRecInfo(info.RecInfo); dlg.ShowDialog(); } else { RecInfoItem info = listView_recinfo.SelectedItem as RecInfoItem; if (info.RecInfo.RecFilePath.Length > 0) { try { CommonManager.Instance.FilePlay(info.RecInfo.RecFilePath); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } } }
//リストのカギマークからの呼び出し public void ChgProtectRecInfoFromCheckbox(RecInfoItem hitItem) { if (listView_recinfo.SelectedItems.Contains(hitItem) == false) { listView_recinfo.SelectedItem = hitItem; } EpgCmds.ProtectChange.Execute(listView_recinfo, this); }
private void button_recInfo_Click(object sender, RoutedEventArgs e) { if (listView_recinfo.SelectedItem != null) { RecInfoItem info = listView_recinfo.SelectedItem as RecInfoItem; RecInfoDescWindow dlg = new RecInfoDescWindow(); dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual; dlg.SetRecInfo(info.RecInfo); dlg.ShowDialog(); } }
private void button_recInfo_Click(object sender, RoutedEventArgs e) { if (listView_recinfo.SelectedItem != null) { RecInfoItem info = listView_recinfo.SelectedItem as RecInfoItem; RecInfoDescWindow dlg = new RecInfoDescWindow(); dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual; RecFileInfo extraRecInfo = new RecFileInfo(); if (CommonManager.CreateSrvCtrl().SendGetRecInfo(info.RecInfo.ID, ref extraRecInfo) == ErrCode.CMD_SUCCESS) { info.RecInfo.ProgramInfo = extraRecInfo.ProgramInfo; info.RecInfo.ErrInfo = extraRecInfo.ErrInfo; } dlg.SetRecInfo(info.RecInfo); dlg.ShowDialog(); } }
private void openFolder_Click(object sender, RoutedEventArgs e) { if (listView_recinfo.SelectedItem != null) { RecInfoItem info = listView_recinfo.SelectedItem as RecInfoItem; if (info.RecFilePath.Length == 0) { MessageBox.Show("録画ファイルが存在しません"); } else { if (CommonManager.Instance.NWMode == false) { if (System.IO.File.Exists(info.RecFilePath) == true) { String cmd = "/select,"; cmd += "\"" + info.RecFilePath + "\""; System.Diagnostics.Process.Start("EXPLORER.EXE", cmd); } else { String folderPath = System.IO.Path.GetDirectoryName(info.RecFilePath); System.Diagnostics.Process.Start("EXPLORER.EXE", folderPath); } } else { CtrlCmdUtil cmd = CommonManager.Instance.CtrlCmd; String nPath = ""; UInt32 err = cmd.SendGetRecFileNetworkPath(info.RecFilePath, ref nPath); if (err == 1) { String cmdline = "/select,"; cmdline += "\"" + nPath + "\""; System.Diagnostics.Process.Start("EXPLORER.EXE", cmdline); } else { MessageBox.Show("フォルダが開けません。録画フォルダが共有されているか確認してください。"); } } } } }
public static string GetValuePropertyName(string key) { var obj = new RecInfoItem(); if (key == CommonUtil.GetMemberName(() => obj.StartTime)) { return(CommonUtil.GetMemberName(() => obj.StartTimeValue)); } else if (key == CommonUtil.GetMemberName(() => obj.ProgramDuration)) { return(CommonUtil.GetMemberName(() => obj.ProgramDurationValue)); } else { return(key); } }
private void button_play_Click(object sender, RoutedEventArgs e) { if (listView_recinfo.SelectedItem != null) { RecInfoItem info = listView_recinfo.SelectedItem as RecInfoItem; if (info.RecInfo.RecFilePath.Length > 0) { try { CommonManager.Instance.FilePlay(info.RecInfo.RecFilePath); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }
private void autoadd_Click(object sender, RoutedEventArgs e) { if (listView_recinfo.SelectedItem != null) { SearchWindow dlg = new SearchWindow(); dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual; EpgSearchKeyInfo key = new EpgSearchKeyInfo(); RecInfoItem item = listView_recinfo.SelectedItem as RecInfoItem; key.andKey = item.RecInfo.Title; key.serviceList.Add((long)CommonManager.Create64Key(item.RecInfo.OriginalNetworkID, item.RecInfo.TransportStreamID, item.RecInfo.ServiceID)); dlg.SetSearchDefKey(key); dlg.ShowDialog(); } }
public override void ChangeData(object data) { var info = data as RecFileInfo ?? new RecFileInfo();//nullデータを受け付ける DataContext = new RecInfoItem(info); //Appendデータが無くなる場合を考慮し、テキストはrecInfoと連動させない if (recInfo != data) { recInfo = info; this.Title = ViewUtil.WindowTitleText(recInfo.Title, "録画情報"); if (recInfo.ID != 0 && recInfo.ProgramInfo == null)//.program.txtがない { recInfo.ProgramInfo = CommonManager.ConvertProgramText(recInfo.GetPgInfo(), EventInfoTextMode.All); } textBox_pgInfo.Text = recInfo.ProgramInfo; textBox_errLog.Text = recInfo.ErrInfo; } UpdateViewSelection(0); }
private void autoadd_Click(object sender, RoutedEventArgs e) { if (listView_recinfo.SelectedItem != null) { SearchWindow dlg = new SearchWindow(); dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual; dlg.SetViewMode(1); EpgSearchKeyInfo key = new EpgSearchKeyInfo(); RecInfoItem item = listView_recinfo.SelectedItem as RecInfoItem; key.andKey = item.RecInfo.Title; Int64 sidKey = ((Int64)item.RecInfo.OriginalNetworkID) << 32 | ((Int64)item.RecInfo.TransportStreamID) << 16 | ((Int64)item.RecInfo.ServiceID); key.serviceList.Add(sidKey); dlg.SetSearchDefKey(key); dlg.ShowDialog(); } }
public override void ChangeData(object data) { var info = data as RecFileInfo ?? new RecFileInfo();//nullデータを受け付ける DataContext = new RecInfoItem(info); //Appendデータが無くなる場合を考慮し、テキストはrecInfoと連動させない if (recInfo != data) { recInfo = info; recInfo.ProgramInfoSet(); this.Title = ViewUtil.WindowTitleText(recInfo.Title, "録画情報"); // 詳細情報を分離して表示に送る string[] parts = recInfo.GetProgramInfoParts(); textBox_pgInfo.Document = CommonManager.ConvertDisplayText(parts[0], parts[1], parts[2]); textBox_errLog.Text = recInfo.ErrInfo; textBox_recFilePath.Text = recInfo.RecFilePath; button_rename.IsEnabled = false; } UpdateViewSelection(0); }
public bool ReloadInfoData() { try { ICollectionView dataView = CollectionViewSource.GetDefaultView(listView_recinfo.DataContext); if (dataView != null) { dataView.SortDescriptions.Clear(); dataView.Refresh(); } listView_recinfo.DataContext = null; resultList.Clear(); ErrCode err = CommonManager.Instance.DB.ReloadrecFileInfo(); if (err == ErrCode.CMD_ERR_CONNECT) { this.Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show("サーバー または EpgTimerSrv に接続できませんでした。"); }), null); return false; } if (err == ErrCode.CMD_ERR_TIMEOUT) { this.Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show("EpgTimerSrvとの接続にタイムアウトしました。"); }), null); return false; } if (err != ErrCode.CMD_SUCCESS) { this.Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show("情報の取得でエラーが発生しました。"); }), null); return false; } foreach (RecFileInfo info in CommonManager.Instance.DB.RecFileInfo.Values) { RecInfoItem item = new RecInfoItem(info); resultList.Add(item); } listView_recinfo.DataContext = resultList; if (_lastHeaderClicked != null) { //GridViewColumnHeader columnHeader = _lastHeaderClicked.Header as GridViewColumnHeader; //string header = columnHeader.Tag as string; Sort(_lastHeaderClicked, _lastDirection); } else { bool sort = false; foreach (GridViewColumn info in gridView_recinfo.Columns) { GridViewColumnHeader columnHeader = info.Header as GridViewColumnHeader; string header = columnHeader.Tag as string; if (String.Compare(header, Settings.Instance.RecInfoColumnHead, true) == 0) { Sort(header, Settings.Instance.RecInfoSortDirection); _lastHeaderClicked = header; _lastDirection = Settings.Instance.RecInfoSortDirection; sort = true; break; } } if (gridView_recinfo.Columns.Count > 0 && sort == false) { GridViewColumnHeader columnHeader = gridView_recinfo.Columns[1].Header as GridViewColumnHeader; string header = columnHeader.Tag as string; Sort(header, _lastDirection); _lastHeaderClicked = header; } } } catch (Exception ex) { this.Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }), null); return false; } return true; }
public static string GetValuePropertyName(string key) { var obj = new RecInfoItem(); if (key == CommonUtil.GetMemberName(() => obj.StartTime)) { return CommonUtil.GetMemberName(() => obj.StartTimeValue); } else if (key == CommonUtil.GetMemberName(() => obj.ProgramDuration)) { return CommonUtil.GetMemberName(() => obj.ProgramDurationValue); } else { return key; } }
public bool ReloadInfoData() { try { ICollectionView dataView = CollectionViewSource.GetDefaultView(listView_recinfo.DataContext); if (dataView != null) { dataView.SortDescriptions.Clear(); dataView.Refresh(); } listView_recinfo.DataContext = null; resultList.Clear(); ErrCode err = CommonManager.Instance.DB.ReloadrecFileInfo(); if (err == ErrCode.CMD_ERR_CONNECT) { this.Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show("サーバー または EpgTimerSrv に接続できませんでした。"); }), null); return(false); } if (err == ErrCode.CMD_ERR_TIMEOUT) { this.Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show("EpgTimerSrvとの接続にタイムアウトしました。"); }), null); return(false); } if (err != ErrCode.CMD_SUCCESS) { this.Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show("情報の取得でエラーが発生しました。"); }), null); return(false); } foreach (RecFileInfo info in CommonManager.Instance.DB.RecFileInfo.Values) { RecInfoItem item = new RecInfoItem(info); resultList.Add(item); } listView_recinfo.DataContext = resultList; if (_lastHeaderClicked != null) { //GridViewColumnHeader columnHeader = _lastHeaderClicked.Header as GridViewColumnHeader; //string header = columnHeader.Tag as string; Sort(_lastHeaderClicked, _lastDirection); } else { bool sort = false; foreach (GridViewColumn info in gridView_recinfo.Columns) { GridViewColumnHeader columnHeader = info.Header as GridViewColumnHeader; string header = columnHeader.Tag as string; if (String.Compare(header, Settings.Instance.RecInfoColumnHead, true) == 0) { Sort(header, Settings.Instance.RecInfoSortDirection); _lastHeaderClicked = header; _lastDirection = Settings.Instance.RecInfoSortDirection; sort = true; break; } } if (gridView_recinfo.Columns.Count > 0 && sort == false) { GridViewColumnHeader columnHeader = gridView_recinfo.Columns[1].Header as GridViewColumnHeader; string header = columnHeader.Tag as string; Sort(header, _lastDirection); _lastHeaderClicked = header; } } } catch (Exception ex) { this.Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }), null); return(false); } return(true); }