Пример #1
0
        private void PnlPlanDragDrop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(typeof(ListItem)))
            {
                Point local = _pnlPlan.PointToClient(new Point(e.X, e.Y));

                int x = local.X - 16;
                int y = local.Y - 16;

                var li    = ((ListItem)e.Data.GetData(typeof(ListItem)));
                var fpobj = new objectsFloorplanObjectsEntry {
                    type = li.Type, id = li.Id, x = x, y = y, angle = 135, fov = 120, radius = 80
                };

                _floorPlanEntries.Add(fpobj);
                Fpc.Fpobject.objects.@object = _floorPlanEntries.ToArray();

                _pnlPlan.Invalidate();
                ShowObjects();
            }

            Fpc.NeedsRefresh = true;
        }