Exemple #1
0
        protected override void OnDragDrop(DragEventArgs e)
        {
            base.OnDragDrop(e);
            DataObject data         = e.Data as DataObject;
            var        dragObjQuery = new ConvertOperation(data, ConvertOperation.Operation.All).Perform <Pixmap>();

            if (dragObjQuery != null)
            {
                Pixmap pixmap = dragObjQuery.FirstOrDefault();
                if (_pixmap != pixmap && pixmap.Atlas != null && pixmap.Atlas.Count > 0 && pixmap.MainLayer != null && pixmap.Width > 0 && pixmap.Height > 0)
                {
                    _pixmap          = pixmap;
                    virtScroll.Value = 0;
                    RefreshScrollBar();
                    RefreshDisplay(pixmap);
                }
                e.Effect = e.AllowedEffect;
            }
        }
        protected override void OnDragDrop(DragEventArgs e)
        {
            base.OnDragDrop(e);

            DataObject data = e.Data as DataObject;
            var dragObjQuery = new ConvertOperation(data, ConvertOperation.Operation.All).Perform<Tileset>();
            if (dragObjQuery != null)
            {
                Tileset dragObj = dragObjQuery.FirstOrDefault();

                // Open up the Tilemap setup dialog
                TilemapSetupDialog setupDialog = new TilemapSetupDialog();
                setupDialog.Tileset = dragObj;
                setupDialog.ShowCentered(DualityEditorApp.MainForm);

                e.Effect = e.AllowedEffect;
            }
        }