Esempio n. 1
0
        private void GraphForm_KeyDown(object sender, KeyEventArgs e)
        {
            int k = e.KeyValue;
            //MessageBox.Show(k.ToString());

            if (k == 46) //Del button
            {
                graph.Stop();
                if (graph.SelectedFilters.Count > 0)
                {
                    foreach (Filter f in graph.SelectedFilters)
                        graph.RemoveFilter(f, false);
                    graph.ClearFiltersSelection();
                    graph.RecalcPaths();
                    Invalidate();
                }
                PinConnection con = graph.SelectedConnection;
                if (con != null)
                {
                    graph.SelectedConnection = null;
                    graph.RemoveConnection(con, true);                    
                    Invalidate();
                }
                e.Handled = true;
            }
        }
Esempio n. 2
0
 public void JoinGraph(Graph gr, bool disconnecting_from_ROT)
 {
     if (gr == null && graph != null && !disconnecting_from_ROT) //remove filter and it's not from ROT
     {
         foreach (Pin p in pins)
         {
             graph.RemoveConnection(p.Connection, false);
         }
     }
     graph = gr;
     if (gr != null)
     {
         ReloadName();
         ReloadPins();
     }
 }