private void UpdateUIFromResultScanPages(Dictionary <string /* innerTextHash */, List <Tuple <string, string> > /* Page Id List */> duplicatesGroups, List <string> sectionPathList) { ResetUIResultScanPages(); int duplicatesGroupIndex = 0; foreach (KeyValuePair <string, List <Tuple <string, string> > > groupInfo in duplicatesGroups) { if (groupInfo.Value.Count > 1) { duplicatesGroupIndex++; TreeNode groupTreeNode = treeViewHierarchy.Nodes.Add(groupInfo.Key, string.Format("Duplicated Page Group {0} - {1}", duplicatesGroupIndex, groupInfo.Key == "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855" ? "Empty Page" : groupInfo.Key)); TreeViewHelper.HideCheckBox(treeViewHierarchy, groupTreeNode); for (int i = 0; i < groupInfo.Value.Count; ++i) { string pageId = groupInfo.Value[i].Item1; if (accessor.TryGetSectionPath(pageId, out string sectionPath)) { groupTreeNode.Nodes.Add(pageId, sectionPath + " - " + groupInfo.Value[i].Item2).Tag = sectionPath; } } } } treeViewHierarchy.ExpandAll(); foreach (string sectionPath in sectionPathList) { listBoxPathPreference.Items.Add(sectionPath); } }
private void UpdateDuplicatedGroupsToUI(Dictionary <string /* innerTextHash */, List <Tuple <string, string> > /* Page Id List */> duplicatedGroups, List <string> sectionPathList) { int duplicatedGroupIndex = 0; foreach (KeyValuePair <string, List <Tuple <string, string> > > groupInfo in duplicatedGroups) { if (groupInfo.Value.Count > 1) { duplicatedGroupIndex++; TreeNode groupNode = this.treeViewHierarchy.Nodes.Add(groupInfo.Key, string.Format("Duplicated Page Group {0} - {1}", duplicatedGroupIndex, groupInfo.Key == "D41D8CD98F00B204E9800998ECF8427E" ? "Empty Page" : groupInfo.Key)); TreeViewHelper.HideCheckBox(treeViewHierarchy, groupNode); for (int i = 0; i < groupInfo.Value.Count; ++i) { string pageId = groupInfo.Value[i].Item1; string sectionPath = null; bool success = _accessor.TryGetSectionPath(pageId, out sectionPath); if (success) { // public virtual TreeNode Add(string key, string text); groupNode.Nodes.Add(pageId, sectionPath + " - " + groupInfo.Value[i].Item2).Tag = sectionPath; sectionPathList.Add(System.IO.Path.GetDirectoryName(sectionPath)); } } } } treeViewHierarchy.ExpandAll(); }