private void FillChannelList() { Channels channels = Channels.Get(); List <GrpInfo> groups = channels.GetGroups(); var groupsNodeWhite = new List <TreeNode>(); var groupsNodeBlack = new List <TreeNode>(); foreach (var group in groups) { var grpNode = new TreeNode(group.Title); grpNode.Tag = group; var grpNodeBlack = new TreeNode(group.Title); grpNodeBlack.Tag = group; foreach (var ch in channels.GetChannelsByGroup(group)) { var chNode = new TreeNode(ch.Title); chNode.Tag = ch; if (ParentalControl.Get().IsChBlock(ch)) { grpNodeBlack.Nodes.Add(chNode); } else { grpNode.Nodes.Add(chNode); } } if (grpNode.Nodes.Count > 0) { groupsNodeWhite.Add(grpNode); } if (grpNodeBlack.Nodes.Count > 0) { groupsNodeBlack.Add(grpNodeBlack); } } treeList.Nodes.AddRange(groupsNodeWhite.ToArray()); treeBlock.Nodes.AddRange(groupsNodeBlack.ToArray()); }