/// <summary> /// The fill target vertex id combo box. /// </summary> private void FillTargetVertexIdComboBox() { var sourceVertex = (GraphNode)this.comboBoxSourceVertexId.SelectedItem; var graphNodeList = new GraphNodeList(); foreach (var node in this.provider.NetworkFlowGraph.Nodes) { if (node.VertexId.Equals(sourceVertex.VertexId)) { continue; } graphNodeList.Add(node); } foreach (var neighbour in sourceVertex.Neighbours) { GraphNode gnode = neighbour.NodeTo; if (graphNodeList.Contains(gnode)) { graphNodeList.Remove(gnode); } } this.comboBoxTargetVertexId.Items.Clear(); foreach (var node in graphNodeList) { this.comboBoxTargetVertexId.Items.Add(node); this.comboBoxTargetVertexId.DisplayMember = "VertexId"; } }