private Dictionary <GroupHeader, Dictionary <GroupedCheckBoxTreeItem, List <GroupedCheckBoxTreeItem> > > BuildTree() { Dictionary <string, GroupedCheckBoxTreeItem> hash = this.BuildDictionary(this.results.Output); Dictionary <GroupHeader, Dictionary <GroupedCheckBoxTreeItem, List <GroupedCheckBoxTreeItem> > > dictionary = new Dictionary <GroupHeader, Dictionary <GroupedCheckBoxTreeItem, List <GroupedCheckBoxTreeItem> > >(); foreach (GroupedCheckBoxTreeItem groupedCheckBoxTreeItem in this.results.Output) { if (string.IsNullOrEmpty(groupedCheckBoxTreeItem.Parent)) { GroupHeader headerFor = this.GetHeaderFor(groupedCheckBoxTreeItem); if (!dictionary.ContainsKey(headerFor)) { dictionary[headerFor] = new Dictionary <GroupedCheckBoxTreeItem, List <GroupedCheckBoxTreeItem> >(); } if (!dictionary[headerFor].ContainsKey(groupedCheckBoxTreeItem)) { dictionary[headerFor].Add(groupedCheckBoxTreeItem, new List <GroupedCheckBoxTreeItem>()); } } } foreach (GroupedCheckBoxTreeItem groupedCheckBoxTreeItem2 in this.results.Output) { if (!string.IsNullOrEmpty(groupedCheckBoxTreeItem2.Parent)) { GroupedCheckBoxTreeItem rootFor = this.GetRootFor(groupedCheckBoxTreeItem2, hash); dictionary[this.GetHeaderFor(groupedCheckBoxTreeItem2)][rootFor].Add(groupedCheckBoxTreeItem2); } } return(dictionary); }
private void AddItemToGroup(GroupedCheckBoxListItem item, GroupHeader group, Dictionary <GroupHeader, List <GroupedCheckBoxListItem> > groupings) { if (!groupings.ContainsKey(group)) { groupings[group] = new List <GroupedCheckBoxListItem>(); } groupings[group].Add(item); }
private void CreateGroupHeaderControl(GroupHeader header, Panel groupPanel) { Panel child = GroupedCheckBoxList.CreateSimplePanel("GroupedCheckBoxGroupCaption", header.Text); groupPanel.Controls.Add(child); }