public void ReloadData(Func <string, StructDef> structMatcher) { DataViewState viewState = DataViewState.Save(this); _structTreeView.BeginUpdate(); try { _structTreeView.Nodes.Clear(); _nodeMap.Clear(); _searchResultsRoot = null; foreach (DataFile f in _dataFiles) { f.RootStructDef = structMatcher.Invoke(f.Name); LoadDataFile(f); } if (viewState != null) { viewState.Restore(this); } } finally { _structTreeView.EndUpdate(); } }
public static DataViewState Save(DataView view) { DataViewState result = new DataViewState(); TreeNode node = view.StructTreeView.SelectedNode; while(node != null) { result._selectedIndices.Insert(0, node.Index); node = node.Parent; } return result; }
public static DataViewState Save(DataView view) { DataViewState result = new DataViewState(); TreeNode node = view.StructTreeView.SelectedNode; while (node != null) { result._selectedIndices.Insert(0, node.Index); node = node.Parent; } return(result); }