Exemple #1
0
        public void AdvanceSelect(Point pt, ShapeSelectorCallback callback)
        {
            AdvanceSelectInfo info = new AdvanceSelectInfo(callback);
            IList <IShape>    list = Source.Shapes;
            IShape            shape;
            ShapeData         data;

            for (int i = 0; i < list.Count; i++)
            {
                shape = list[i];
                data  = shape.Data;
                if (!data.Enable)
                {
                    continue;
                }
                if (data.Bounds.Contains(pt))
                {
                    info.List.Add(shape, i);
                }
            }
            if (info.List.Count > 0)
            {
                ContextMenuStrip  cms = new ContextMenuStrip();
                ToolStripMenuItem tsmi;
                foreach (IShape s in info.List.Keys)
                {
                    tsmi     = new ToolStripMenuItem(s.ToString());
                    tsmi.Tag = s;
                    cms.Items.Add(tsmi);
                }
                cms.Tag          = info;
                cms.ItemClicked += new ToolStripItemClickedEventHandler(cms_ItemClicked);
                cms.Show(Control.MousePosition);
            }
        }
Exemple #2
0
 public AdvanceSelectInfo(ShapeSelectorCallback callback)
 {
     _list     = new Dictionary <IShape, int>();
     _callback = callback;
 }