예제 #1
0
파일: GraphForm.cs 프로젝트: x2v0/gep
        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;
            }
        }