private void UpdateNetGraph() { listViewNetGraph.BeginUpdate(); foreach (ListViewItem item in listViewNetGraph.Items) { BasePipelineNode node = (BasePipelineNode)item.Tag; item.SubItems[0].Text = node.ToString(); item.SubItems[1].Text = node.Enabled.ToString(); item.SubItems[2].Text = node.IsShutdown.ToString(); item.SubItems[3].Text = node.InputPacketCount.ToString(); item.SubItems[4].Text = node.OutputPacketCount.ToString(); item.SubItems[5].Text = node.ByteCount.ToString(); } listViewNetGraph.EndUpdate(); }
private void AddGraphToList(List <ListViewItem> items, NetGraph graph) { foreach (var pair in graph.Nodes) { BasePipelineNode node = pair.Value; if (_showHidden || !node.Hidden) { NetGraphContainerNode container = node as NetGraphContainerNode; if (node is NetGraphContainerNode) { AddGraphToList(items, ((NetGraphContainerNode)node).ContainedGraph); } else if (node is LayerSectionNode) { LayerSectionNode layerNode = (LayerSectionNode)node; if (layerNode.IsMaster) { foreach (NetGraph subGraph in layerNode.Graphs) { AddGraphToList(items, subGraph); } } } else { ListViewItem item = new ListViewItem(node.ToString()); item.SubItems.Add(node.Enabled.ToString()); item.SubItems.Add(node.IsShutdown.ToString()); item.SubItems.Add(node.InputPacketCount.ToString()); item.SubItems.Add(node.OutputPacketCount.ToString()); item.SubItems.Add(node.ByteCount.ToString()); item.Tag = node; items.Add(item); } } } }