private void AddCurve(ReducedBezierCurve curve)
        {
            ReducedBezierCurvesViewItem item = new ReducedBezierCurvesViewItem();

            item.Curve  = curve;
            item.Click += item_Click;
            panel.Controls.Add(item);
            RearrangeItems(panel.Controls.Count - 1);
        }
        void item_Click(object sender, EventArgs e)
        {
            ReducedBezierCurvesViewItem newSelectedItem
                = sender as ReducedBezierCurvesViewItem;

            if (SelectedItem != newSelectedItem)
            {
                SelectedItem = newSelectedItem;
            }
            else
            {
                SelectedItem = null;
            }
        }