internal void AddNode(LibraryNode node) { lock (this) { root.AddNode(node); } }
protected IVsSimpleObjectList2 FilterView(LibraryNodeType filterType) { return(ThreadHelper.JoinableTaskFactory.Run(async delegate { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); LibraryNode filtered = null; if (filteredView.TryGetValue(filterType, out filtered)) { return filtered as IVsSimpleObjectList2; } filtered = this.Clone(); for (int i = 0; i < filtered.children.Count;) { if (0 == (filtered.children[i].type & filterType)) { filtered.children.RemoveAt(i); } else { i += 1; } } filteredView.Add(filterType, filtered); return filtered as IVsSimpleObjectList2; })); }
internal void RemoveNode(LibraryNode node) { lock (this) { //root = new LibraryNode(root); root.RemoveNode(node); } }
internal void RemoveNode(LibraryNode node) { lock (children) { children.Remove(node); } filteredView = new Dictionary <LibraryNodeType, LibraryNode>(); updateCount += 1; }
/// <summary> /// Search the Childrens of the currentRoot, to see if some are containing strSearchCriteria. /// If the Children has some childrens..., then call FillRoot recursively. /// </summary> /// <param name="tmpRoot">The current upper level, where corresponding Childrens must be added</param> /// <param name="elementTypes">What kind of Children are we looking for</param> /// <param name="strSearchCriteria">What are we looking for</param> /// <param name="currentRoot">The node to look after</param> private void FillRoot(LibraryNode tmpRoot, List <LibraryNode.LibraryNodeType> elementTypes, string strSearchCriteria, LibraryNode currentRoot) { foreach (LibraryNode node in currentRoot.children) { if (elementTypes.Contains(node.NodeType) && node.Name.ToLower().Contains(strSearchCriteria.ToLower())) { tmpRoot.children.Add(node.Clone()); } if (node.children.Count > 0) { FillRoot(tmpRoot, elementTypes, strSearchCriteria, node); } } }
public LibraryNode(LibraryNode node) { this.capabilities = node.capabilities; this.contextMenuID = node.contextMenuID; this.displayData = node.displayData; this.name = node.name; this.tooltip = node.tooltip; this.type = node.type; this.children = new List <LibraryNode>(); foreach (LibraryNode child in node.children) { children.Add(child); } this.clipboardFormats = new List <VSOBJCLIPFORMAT>(); foreach (VSOBJCLIPFORMAT format in node.clipboardFormats) { clipboardFormats.Add(format); } this.filteredView = new Dictionary <LibraryNodeType, LibraryNode>(); this.updateCount = node.updateCount; }
internal LibraryNode SearchHierarchy(IVsHierarchy hierarchy) { LibraryNode found = null; lock (this) { foreach (LibraryNode nd in root.children) { if (nd is XSharpLibraryNode) { XSharpLibraryNode vln = (XSharpLibraryNode)nd; if (hierarchy.Equals(vln.ownerHierarchy)) { found = nd; break; } } } } return(found); }
private LibraryNode SearchNodes(uint elementType, string strSearchCriteria) { List <LibraryNode.LibraryNodeType> nType = new List <LibraryNode.LibraryNodeType>(); if (elementType == (uint)_LIB_LISTTYPE.LLT_HIERARCHY) { nType.Add(LibraryNode.LibraryNodeType.Hierarchy); } else if (elementType == (uint)_LIB_LISTTYPE.LLT_NAMESPACES) { nType.Add(LibraryNode.LibraryNodeType.Namespaces); } else if (elementType == (uint)_LIB_LISTTYPE.LLT_MEMBERS) { nType.Add(LibraryNode.LibraryNodeType.Classes); nType.Add(LibraryNode.LibraryNodeType.Members); } LibraryNode tmpRoot = new LibraryNode("", LibraryNode.LibraryNodeType.Package); // FillRoot(tmpRoot, nType, strSearchCriteria, root); // return(tmpRoot); }
bool MatchesName(LibraryNode node, string name) { return(String.Compare(node.Name, name, true) == 0 && (node.NodeType & LibraryNodeType.Classes) != LibraryNodeType.None); }
bool findbyName(LibraryNode node, string name) { return(String.Compare(node.Name, name, true) == 0 && (node.NodeType & LibraryNodeType.Namespaces) != LibraryNodeType.None); }
public Library(Guid libraryGuid) { this.guid = libraryGuid; root = new LibraryNode("", LibraryNode.LibraryNodeType.Package); }