/// <summary> /// Update interface when label changes /// </summary> /// <param name="file"></param> /// <param name="op"></param> void _TagCache_CacheUpdated(CacheUpdatedArgs e) { // 删除结点 TreeNode root = tvClassView.Nodes[e.ProjectIndex]; /* * ClassViewIndex index = root.Tag as ClassViewIndex; * if (index.FileName2TreeNode_Index.ContainsKey(e.File)) * { * List<TreeNode> nodeList = index.FileName2TreeNode_Index[e.File]; * nodeList.Reverse(); * foreach (TreeNode node in nodeList) * { * ITag tag = node.Tag as ITag; * index.TagFullName2TreeNode_Index.Remove(tag.FullName); * } * index.FileName2TreeNode_Index.Remove(e.File); * foreach (TreeNode node in nodeList) * { * if (node.Nodes.Count == 0) // 没有子结点的情况下才删除。像命名空间往往有很多子结点 * node.Remove(); // throw new exception? * } * }*/ // 如果是Update操作,添加结点 if (e.Operator == Operator.Update) { _InsertTags(root, TagCache.GetTags(e.File)); } }
/// <summary> /// 加载标签视图 /// </summary> void _LoadClassView() { foreach (Project project in ProjectManager.Projects) { List <ITag> tags = TagCache.GetTags(project.Root.SubFiles2.ToArray()); TreeNode node = new TreeNode(project.Root.Name, Resource.ClassViewIcon_Project, Resource.ClassViewIcon_Project); tvClassView.Nodes.Add(node); _Bind(node, tags); } }
void _UpdateView(String File) { m_CurrFile = File; if (tvClassView.Nodes.Count == 0) { return; } TreeNode root = tvClassView.Nodes[0]; //TODO _InsertTags(root, TagCache.GetTags(File)); }