internal SymbolNode2(SymbolNode2 node) { this.symbolText = node.symbolText; this.symbolPrefix = node.symbolPrefix; this.fName = node.fName; this.lineNumber = node.lineNumber; this.columnNumber = node.columnNumber; this.nodeListType = node.nodeListType; node.children.ForEach(c => AddChild(c)); }
public void RemoveChild(SymbolNode2 child) { children.Remove(child); updateCount++; }
public void AddChild(SymbolNode2 child) { children.Add(child); updateCount++; }
internal IVsObjectList2 FilterView(LibraryNodeType filterType, VSOBSEARCHCRITERIA2[] pobSrch) { SymbolNode2 filtered = null, temp = null; if (!filteredView.TryGetValue(filterType, out temp)) { // Filling filtered view filtered = this.Clone(); for (int i = 0; i < filtered.children.Count;) { if (0 == (filtered.children[i].nodeListType & filterType)) { filtered.children.RemoveAt(i); } else { i += 1; } } filteredView.Add(filterType, filtered.Clone()); } else { filtered = temp.Clone(); // making sure we filter a new node } // Checking if we need to perform search if (pobSrch != null) { Regex reg; switch (pobSrch[0].eSrchType) { case VSOBSEARCHTYPE.SO_ENTIREWORD: reg = new Regex(string.Format("^{0}$", pobSrch[0].szName.ToLower())); break; case VSOBSEARCHTYPE.SO_PRESTRING: reg = new Regex(string.Format("^{0}.*", pobSrch[0].szName.ToLower())); break; case VSOBSEARCHTYPE.SO_SUBSTRING: reg = new Regex(string.Format(".*{0}.*", pobSrch[0].szName.ToLower())); break; default: throw new NotImplementedException(); } for (int i = 0; i < filtered.children.Count;) { if (!reg.Match(filtered.children[i].UniqueName.ToLower()).Success) { filtered.children.RemoveAt(i); } else { i += 1; } } } return(filtered as IVsObjectList2); }