public void SelectFile(string fileName, int rowNum) { if (_currentViewer != null && _currentViewer.Resource.FileName == fileName) { _currentViewer.FocusRow(rowNum); return; } foreach (TreeNode tn in tv.Nodes) { foreach (TreeNode tnFile in tn.Nodes) { if (tnFile.Text.Equals(fileName)) { if (tv.SelectedNode == tnFile) { _currentViewer.FocusRow(rowNum); } else { SelectRow = rowNum; tv.SelectedNode = tnFile; } return; } } } }
private void ShowResource(Resource res, bool translated) { var info = res.GetInfo(); tsslResourceInfo.Text = String.Format("{0} {1} ({2:X8}h) {3}", res.Type, res.Volumes[0].FileName, res.Volumes[0].Offset, info); _currentViewer = GetViewer(res); _currentViewer.Activate(res, translated); if (SelectRow.HasValue) { _currentViewer.FocusRow(SelectRow.Value); SelectRow = null; } _currentViewer.BringToFront(); }