Exemple #1
0
        private void btnEdge_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem == null || listBox2.SelectedItem == null)
                return;

            if (listBox1.SelectedItem != listBox2.SelectedItem && !string.IsNullOrEmpty(txtEdge.Text.Trim()))
            {
                SampleEdge newEdge = new SampleEdge(txtEdge.Text, (SampleNode)listBox1.SelectedItem, (SampleNode)listBox2.SelectedItem);
                myGraph.AddEdge(newEdge);
            }
        }
Exemple #2
0
 public void AddEdge(SampleEdge edgeToAdd)
 {
     _MyEdges.Add(edgeToAdd);
 }
Exemple #3
0
 public void AddEdge(SampleEdge edgeToAdd)
 {
     _MyEdges.Add(edgeToAdd);
     edgeToAdd.Source.AddEdge(edgeToAdd);
 }