예제 #1
0
 public SaveProgressDialog(Control owner)
     : base(owner,
            PdnResources.GetString("SaveProgressDialog.Title"),
            PdnResources.GetString("SaveProgressDialog.Description"))
 {
     this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.MenuFileSaveIcon.png").Reference, Utility.TransparentKey);
 }
예제 #2
0
        public CanvasSizeDialog()
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.MenuImageCanvasSizeIcon.png").Reference, Utility.TransparentKey);

            this.Text = PdnResources.GetString("CanvasSizeDialog.Text");                             // "Canvas Size";
            this.anchorHeader.Text  = PdnResources.GetString("CanvasSizeDialog.AnchorHeader.Text");  //"Anchor";
            this.newSpaceLabel.Text = PdnResources.GetString("CanvasSizeDialog.NewSpaceLabel.Text"); //"The new space will be filled with the currently selected background color.";

            foreach (string name in Enum.GetNames(typeof(AnchorEdge)))
            {
                AnchorEdge value    = (AnchorEdge)Enum.Parse(typeof(AnchorEdge), name, true);
                string     itemName = this.anchorEdgeNames.EnumValueToLocalizedName(value);
                this.anchorEdgeCB.Items.Add(itemName);

                if (value == this.AnchorEdge)
                {
                    this.anchorEdgeCB.SelectedItem = itemName;
                }
            }

            anchorChooserControl_AnchorEdgeChanged(anchorChooserControl, EventArgs.Empty);
        }
예제 #3
0
        public AnchorChooserControl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            this.ResizeRedraw = true;

            this.centerImage    = PdnResources.GetImageResource("Images.AnchorChooserControl.AnchorImage.png").Reference;
            this.xyToAnchorEdge = new AnchorEdge[][] {
                new AnchorEdge[] { AnchorEdge.TopLeft, AnchorEdge.Top, AnchorEdge.TopRight },
                new AnchorEdge[] { AnchorEdge.Left, AnchorEdge.Middle, AnchorEdge.Right },
                new AnchorEdge[] { AnchorEdge.BottomLeft, AnchorEdge.Bottom, AnchorEdge.BottomRight }
            };

            this.anchorEdgeToXy = new Hashtable();
            this.anchorEdgeToXy.Add(AnchorEdge.TopLeft, new Point(0, 0));
            this.anchorEdgeToXy.Add(AnchorEdge.Top, new Point(1, 0));
            this.anchorEdgeToXy.Add(AnchorEdge.TopRight, new Point(2, 0));
            this.anchorEdgeToXy.Add(AnchorEdge.Left, new Point(0, 1));
            this.anchorEdgeToXy.Add(AnchorEdge.Middle, new Point(1, 1));
            this.anchorEdgeToXy.Add(AnchorEdge.Right, new Point(2, 1));
            this.anchorEdgeToXy.Add(AnchorEdge.BottomLeft, new Point(0, 2));
            this.anchorEdgeToXy.Add(AnchorEdge.Bottom, new Point(1, 2));
            this.anchorEdgeToXy.Add(AnchorEdge.BottomRight, new Point(2, 2));

            this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint |
                          ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);
        }
예제 #4
0
        protected void SetStatus(ImageResource statusIcon, string statusText)
        {
            if (statusIcon == null && statusText != null)
            {
                statusIcon = PdnResources.GetImageResource("Icons.MenuHelpHelpTopicsIcon.png");
            }

            DocumentWorkspace.SetStatus(statusText, statusIcon);
        }
예제 #5
0
        public ViewConfigStrip()
        {
            this.SuspendLayout();
            InitializeComponent();

            this.windowText       = EnumLocalizer.EnumValueToLocalizedName(typeof(ZoomBasis), ZoomBasis.FitToWindow);
            this.percentageFormat = PdnResources.GetString("ZoomConfigWidget.Percentage.Format");

            double[] zoomValues = ScaleFactor.PresetValues;

            this.zoomComboBox.ComboBox.SuspendLayout();

            string percent100 = null; // ScaleFactor.PresetValues guarantees that 1.0, or "100%" is in the list, but the compiler can't be shown this so we must assign a value here

            for (int i = zoomValues.Length - 1; i >= 0; --i)
            {
                string zoomValueString = (zoomValues[i] * 100.0).ToString();
                string zoomItemString  = string.Format(this.percentageFormat, zoomValueString);

                if (zoomValues[i] == 1.0)
                {
                    percent100 = zoomItemString;
                }

                this.zoomComboBox.Items.Add(zoomItemString);
            }

            this.zoomComboBox.Items.Add(this.windowText);
            this.zoomComboBox.ComboBox.ResumeLayout(false);
            this.zoomComboBox.Size = new Size(UI.ScaleWidth(this.zoomComboBox.Width), zoomComboBox.Height);

            this.unitsLabel.Text = PdnResources.GetString("WorkspaceOptionsConfigWidget.UnitsLabel.Text");

            this.zoomComboBox.Text = percent100;
            this.ScaleFactor       = ScaleFactor.OneToOne;

            this.zoomOutButton.Image = PdnResources.GetImageResource("Icons.MenuViewZoomOutIcon.png").Reference;
            this.zoomInButton.Image  = PdnResources.GetImageResource("Icons.MenuViewZoomInIcon.png").Reference;
            this.gridButton.Image    = PdnResources.GetImageResource("Icons.MenuViewGridIcon.png").Reference;

            this.zoomOutButton.ToolTipText = PdnResources.GetString("ZoomConfigWidget.ZoomOutButton.ToolTipText");
            this.zoomInButton.ToolTipText  = PdnResources.GetString("ZoomConfigWidget.ZoomInButton.ToolTipText");
            this.gridButton.ToolTipText    = PdnResources.GetString("WorkspaceOptionsConfigWidget.DrawGridToggleButton.ToolTipText");

            this.zoomBasis = ZoomBasis.ScaleFactor;
            ScaleFactor    = ScaleFactor.OneToOne;

            this.ResumeLayout(false);
        }
예제 #6
0
        public override void LoadResources()
        {
            this.Text = PdnResources.GetString("ChooseToolDefaultsDialog.Text");
            this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.MenuLayersLayerPropertiesIcon.png").Reference);

            this.introText.Text       = PdnResources.GetString("ChooseToolDefaultsDialog.IntroText.Text");
            this.defaultToolText.Text = PdnResources.GetString("ChooseToolDefaultsDialog.DefaultToolText.Text");

            this.loadFromToolBarButton.Text = PdnResources.GetString("ChooseToolDefaultsDialog.LoadFromToolBarButton.Text");
            this.cancelButton.Text          = PdnResources.GetString("Form.CancelButton.Text");
            this.saveButton.Text            = PdnResources.GetString("Form.SaveButton.Text");
            this.resetButton.Text           = PdnResources.GetString("Form.ResetButton.Text");

            base.LoadResources();
        }
예제 #7
0
        public ColorDisplayWidget()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            this.swapIconBox.Icon          = new Bitmap(PdnResources.GetImageResource("Icons.SwapIcon.png").Reference);
            this.blackAndWhiteIconBox.Icon = new Bitmap(PdnResources.GetImageResource("Icons.BlackAndWhiteIcon.png").Reference);

            if (!DesignMode)
            {
                this.toolTip.SetToolTip(swapIconBox, PdnResources.GetString("ColorDisplayWidget.SwapIconBox.ToolTipText"));
                this.toolTip.SetToolTip(blackAndWhiteIconBox, PdnResources.GetString("ColorDisplayWidget.BlackAndWhiteIconBox.ToolTipText"));
                this.toolTip.SetToolTip(primaryColorRectangle, PdnResources.GetString("ColorDisplayWidget.ForeColorRectangle.ToolTipText"));
                this.toolTip.SetToolTip(secondaryColorRectangle, PdnResources.GetString("ColorDisplayWidget.BackColorRectangle.ToolTipText"));
            }
        }
예제 #8
0
        public PdnStatusBar()
        {
            InitializeComponent();

            this.cursorInfoStatusLabel.Image = PdnResources.GetImageResource("Icons.CursorXYIcon.png").Reference;
            this.cursorInfoStatusLabel.Text  = string.Empty;

            // imageInfo (width,height info)
            this.imageInfoStatusLabel.Image = PdnResources.GetImageResource("Icons.ImageSizeIcon.png").Reference;

            // progress
            this.progressStatusBar.Visible           = false;
            this.progressStatusSeparator.Visible     = false;
            this.progressStatusBar.Height           -= 4;
            this.progressStatusBar.ProgressBar.Style = ProgressBarStyle.Continuous;
        }
예제 #9
0
        public ResizeDialog()
        {
            this.SuspendLayout(); // ResumeLayout() called in OnLoad(). This helps with layout w.r.t. visual inheritance (CanvasSizeDialog and NewFileDialog)
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.Text = PdnResources.GetString("ResizeDialog.Text");
            this.asteriskLabel.Text     = PdnResources.GetString("ResizeDialog.AsteriskLabel.Text");
            this.percentSignLabel.Text  = PdnResources.GetString("ResizeDialog.PercentSignLabel.Text");
            this.pixelSizeHeader.Text   = PdnResources.GetString("ResizeDialog.PixelSizeHeader.Text");
            this.printSizeHeader.Text   = PdnResources.GetString("ResizeDialog.PrintSizeHeader.Text");
            this.pixelsLabel1.Text      = PdnResources.GetString("ResizeDialog.PixelsLabel1.Text");
            this.pixelsLabel2.Text      = PdnResources.GetString("ResizeDialog.PixelsLabel2.Text");
            this.percentRB.Text         = PdnResources.GetString("ResizeDialog.PercentRB.Text");
            this.absoluteRB.Text        = PdnResources.GetString("ResizeDialog.AbsoluteRB.Text");
            this.resamplingLabel.Text   = PdnResources.GetString("ResizeDialog.ResamplingLabel.Text");
            this.cancelButton.Text      = PdnResources.GetString("Form.CancelButton.Text");
            this.okButton.Text          = PdnResources.GetString("Form.OkButton.Text");
            this.newWidthLabel1.Text    = PdnResources.GetString("ResizeDialog.NewWidthLabel1.Text");
            this.newHeightLabel1.Text   = PdnResources.GetString("ResizeDialog.NewHeightLabel1.Text");
            this.newWidthLabel2.Text    = PdnResources.GetString("ResizeDialog.NewWidthLabel1.Text");
            this.newHeightLabel2.Text   = PdnResources.GetString("ResizeDialog.NewHeightLabel1.Text");
            this.constrainCheckBox.Text = PdnResources.GetString("ResizeDialog.ConstrainCheckBox.Text");

            upDownValueChangedDelegate = new EventHandler(upDown_ValueChanged);

            this.constrainer = new ResizeConstrainer(new Size((int)this.pixelWidthUpDown.Value, (int)this.pixelHeightUpDown.Value));
            SetupConstrainerEvents();

            resamplingAlgorithmComboBox.Items.Clear();
            resamplingAlgorithmComboBox.Items.Add(new ResampleMethod(ResamplingAlgorithm.Bicubic));
            resamplingAlgorithmComboBox.Items.Add(new ResampleMethod(ResamplingAlgorithm.Bilinear));
            resamplingAlgorithmComboBox.Items.Add(new ResampleMethod(ResamplingAlgorithm.NearestNeighbor));
            resamplingAlgorithmComboBox.Items.Add(new ResampleMethod(ResamplingAlgorithm.SuperSampling));
            resamplingAlgorithmComboBox.SelectedItem = new ResampleMethod(ResamplingAlgorithm.SuperSampling);

            layers = 1;

            this.percentUpDown.Enabled = false;

            this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.MenuImageResizeIcon.png").Reference, Utility.TransparentKey);
            PopulateAsteriskLabels();
            OnRadioButtonCheckedChanged(this, EventArgs.Empty);
        }
예제 #10
0
        public ControlShadow()
        {
            this.SetStyle(ControlStyles.Opaque, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            this.Dock           = DockStyle.Fill;
            this.DoubleBuffered = true;
            this.ResizeRedraw   = true;

            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            BackColor = Color.FromArgb(0xc0, 0xc0, 0xc0);

            this.roundedEdgeUL = PdnResources.GetImageResource("Images.RoundedEdgeUL.png").Reference;
            this.roundedEdgeUR = PdnResources.GetImageResource("Images.RoundedEdgeUR.png").Reference;
            this.roundedEdgeLL = PdnResources.GetImageResource("Images.RoundedEdgeLL.png").Reference;
            this.roundedEdgeLR = PdnResources.GetImageResource("Images.RoundedEdgeLR.png").Reference;
        }
예제 #11
0
        public LayerForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            imageList.TransparentColor = Utility.TransparentKey;

            toolStrip.ImageList = this.imageList;

            int addNewLayerIndex    = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersAddNewLayerIcon.png").Reference, imageList.TransparentColor);
            int deleteLayerIndex    = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersDeleteLayerIcon.png").Reference, imageList.TransparentColor);
            int moveLayerUpIndex    = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersMoveLayerUpIcon.png").Reference, imageList.TransparentColor);
            int moveLayerDownIndex  = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersMoveLayerDownIcon.png").Reference, imageList.TransparentColor);
            int duplicateLayerIndex = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuEditCopyIcon.png").Reference, imageList.TransparentColor);
            int mergeLayerDownIndex = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersMergeLayerDownIcon.png").Reference, imageList.TransparentColor);
            int propertiesIndex     = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersLayerPropertiesIcon.png").Reference, imageList.TransparentColor);

            addNewLayerButton.ImageIndex    = addNewLayerIndex;
            deleteLayerButton.ImageIndex    = deleteLayerIndex;
            moveLayerUpButton.ImageIndex    = moveLayerUpIndex;
            moveLayerDownButton.ImageIndex  = moveLayerDownIndex;
            duplicateLayerButton.ImageIndex = duplicateLayerIndex;
            mergeLayerDownButton.ImageIndex = mergeLayerDownIndex;
            propertiesButton.ImageIndex     = propertiesIndex;

            layerControl.KeyUp += new KeyEventHandler(LayerControl_KeyUp);

            this.Text = PdnResources.GetString("LayerForm.Text");
            this.addNewLayerButton.ToolTipText    = PdnResources.GetString("LayerForm.AddNewLayerButton.ToolTipText");
            this.deleteLayerButton.ToolTipText    = PdnResources.GetString("LayerForm.DeleteLayerButton.ToolTipText");
            this.duplicateLayerButton.ToolTipText = PdnResources.GetString("LayerForm.DuplicateLayerButton.ToolTipText");
            this.mergeLayerDownButton.ToolTipText = PdnResources.GetString("LayerForm.MergeLayerDownButton.ToolTipText");
            this.moveLayerUpButton.ToolTipText    = PdnResources.GetString("LayerForm.MoveLayerUpButton.ToolTipText");
            this.moveLayerDownButton.ToolTipText  = PdnResources.GetString("LayerForm.MoveLayerDownButton.ToolTipText");
            this.propertiesButton.ToolTipText     = PdnResources.GetString("LayerForm.PropertiesButton.ToolTipText");

            this.MinimumSize = this.Size;
        }
예제 #12
0
        public SaveConfigDialog()
        {
            this.fileSizeTimer = new System.Threading.Timer(new System.Threading.TimerCallback(FileSizeTimerCallback),
                                                            null, 1000, System.Threading.Timeout.Infinite);

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.Text = PdnResources.GetString("SaveConfigDialog.Text");
            this.fileSizeTextFormat  = PdnResources.GetString("SaveConfigDialog.PreviewHeader.Text.Format");
            this.settingsHeader.Text = PdnResources.GetString("SaveConfigDialog.SettingsHeader.Text");
            this.defaultsButton.Text = PdnResources.GetString("SaveConfigDialog.DefaultsButton.Text");
            this.previewHeader.Text  = PdnResources.GetString("SaveConfigDialog.PreviewHeader.Text");

            this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.MenuFileSaveIcon.png").Reference);

            this.documentView.Cursor = handIcon;

            //this.MinimumSize = this.Size;
        }
예제 #13
0
        public override void LoadResources()
        {
            this.Text = PdnResources.GetString("UnsavedChangesDialog.Text");
            this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.WarningIcon.png").Reference, false);

            this.infoLabel.Text          = PdnResources.GetString("UnsavedChangesDialog.InfoLabel.Text");
            this.documentListHeader.Text = PdnResources.GetString("UnsavedChangesDialog.DocumentListHeader.Text");

            this.saveButton.ActionText      = PdnResources.GetString("UnsavedChangesDialog.SaveButton.ActionText");
            this.saveButton.ExplanationText = PdnResources.GetString("UnsavedChangesDialog.SaveButton.ExplanationText");
            this.saveButton.ActionImage     = PdnResources.GetImageResource("Icons.UnsavedChangesDialog.SaveButton.png").Reference;

            this.dontSaveButton.ActionText      = PdnResources.GetString("UnsavedChangesDialog.DontSaveButton.ActionText");
            this.dontSaveButton.ExplanationText = PdnResources.GetString("UnsavedChangesDialog.DontSaveButton.ExplanationText");
            this.dontSaveButton.ActionImage     = PdnResources.GetImageResource("Icons.MenuFileCloseIcon.png").Reference;

            this.cancelButton.ActionText      = PdnResources.GetString("UnsavedChangesDialog.CancelButton.ActionText");
            this.cancelButton.ExplanationText = PdnResources.GetString("UnsavedChangesDialog.CancelButton.ExplanationText");
            this.cancelButton.ActionImage     = PdnResources.GetImageResource("Icons.CancelIcon.png").Reference;

            base.LoadResources();
        }
예제 #14
0
        protected virtual void DrawItemCloseButton(
            Graphics g,
            Item item,
            Rectangle itemRect,
            Rectangle closeButtonRect)
        {
            if (item.Checked && item.Selected)
            {
                const string resourceNamePrefix = "Images.ImageStrip.CloseButton.";
                const string resourceNameSuffix = ".png";
                string       resourceNameInfix  = item.CloseRenderState.ToString();

                string resourceName = resourceNamePrefix + resourceNameInfix + resourceNameSuffix;

                ImageResource imageResource = PdnResources.GetImageResource(resourceName);
                Image         image         = imageResource.Reference;

                g.SmoothingMode     = SmoothingMode.AntiAlias;
                g.InterpolationMode = InterpolationMode.HighQualityBicubic;

                g.DrawImage(image, closeButtonRect, new Rectangle(0, 0, image.Width, image.Width), GraphicsUnit.Pixel);
            }
        }
예제 #15
0
        private void ChooseToolButton_DropDownOpening(object sender, EventArgs e)
        {
            this.chooseToolButton.DropDownItems.Clear();

            if (this.showChooseDefaults)
            {
                string        chooseToolText = PdnResources.GetString("ToolChooserStrip.ChooseToolDefaults.Text");
                ImageResource chooseToolIcon = PdnResources.GetImageResource("Icons.MenuLayersLayerPropertiesIcon.png");

                ToolStripMenuItem tsmi = new ToolStripMenuItem(
                    chooseToolText,
                    chooseToolIcon.Reference,
                    ChooseTool_Click);

                this.chooseToolButton.DropDownItems.Add(tsmi);
                this.chooseToolButton.DropDownItems.Add(new ToolStripSeparator());
            }

            for (int i = 0; i < this.toolInfos.Length; ++i)
            {
                ToolStripMenuItem toolMI = new ToolStripMenuItem();
                toolMI.Image = this.toolInfos[i].Image.Reference;
                toolMI.Text  = this.toolInfos[i].Name;
                toolMI.Tag   = this.toolInfos[i];

                if (this.toolInfos[i].ToolType == this.activeTool)
                {
                    toolMI.Checked = true;
                }
                else
                {
                    toolMI.Checked = false;
                }

                this.chooseToolButton.DropDownItems.Add(toolMI);
            }
        }
예제 #16
0
        public CommonActionsStrip()
        {
            InitializeComponent();

            this.newButton.Image      = PdnResources.GetImageResource("Icons.MenuFileNewIcon.png").Reference;
            this.openButton.Image     = PdnResources.GetImageResource("Icons.MenuFileOpenIcon.png").Reference;
            this.saveButton.Image     = PdnResources.GetImageResource("Icons.MenuFileSaveIcon.png").Reference;
            this.cutButton.Image      = PdnResources.GetImageResource("Icons.MenuEditCutIcon.png").Reference;
            this.copyButton.Image     = PdnResources.GetImageResource("Icons.MenuEditCopyIcon.png").Reference;
            this.pasteButton.Image    = PdnResources.GetImageResource("Icons.MenuEditPasteIcon.png").Reference;
            this.cropButton.Image     = PdnResources.GetImageResource("Icons.MenuImageCropIcon.png").Reference;
            this.deselectButton.Image = PdnResources.GetImageResource("Icons.MenuEditDeselectIcon.png").Reference;
            this.undoButton.Image     = PdnResources.GetImageResource("Icons.MenuEditUndoIcon.png").Reference;
            this.redoButton.Image     = PdnResources.GetImageResource("Icons.MenuEditRedoIcon.png").Reference;

            this.newButton.ToolTipText      = PdnResources.GetString("CommonAction.New");
            this.openButton.ToolTipText     = PdnResources.GetString("CommonAction.Open");
            this.saveButton.ToolTipText     = PdnResources.GetString("CommonAction.Save");
            this.cutButton.ToolTipText      = PdnResources.GetString("CommonAction.Cut");
            this.copyButton.ToolTipText     = PdnResources.GetString("CommonAction.Copy");
            this.pasteButton.ToolTipText    = PdnResources.GetString("CommonAction.Paste");
            this.cropButton.ToolTipText     = PdnResources.GetString("CommonAction.CropToSelection");
            this.deselectButton.ToolTipText = PdnResources.GetString("CommonAction.Deselect");
            this.undoButton.ToolTipText     = PdnResources.GetString("CommonAction.Undo");
            this.redoButton.ToolTipText     = PdnResources.GetString("CommonAction.Redo");

            this.newButton.Tag      = CommonAction.New;
            this.openButton.Tag     = CommonAction.Open;
            this.saveButton.Tag     = CommonAction.Save;
            this.cutButton.Tag      = CommonAction.Cut;
            this.copyButton.Tag     = CommonAction.Copy;
            this.pasteButton.Tag    = CommonAction.Paste;
            this.cropButton.Tag     = CommonAction.CropToSelection;
            this.deselectButton.Tag = CommonAction.Deselect;
            this.undoButton.Tag     = CommonAction.Undo;
            this.redoButton.Tag     = CommonAction.Redo;
        }
예제 #17
0
 public NewFileDialog()
 {
     InitializeComponent();
     this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.MenuFileNewIcon.png").Reference, Utility.TransparentKey);
     this.Text = PdnResources.GetString("NewFileDialog.Text"); // "New";
 }
예제 #18
0
 public void SetIcon(string imageName)
 {
     this.ImageTransparentColor = Utility.TransparentKey;
     this.Image = PdnResources.GetImageResource(imageName).Reference;
 }
예제 #19
0
        protected override void OnDragDrop(DragEventArgs drgevent)
        {
            Activate();

            if (!IsCurrentModalForm || !Enabled)
            {
                // do nothing
            }
            else if (drgevent.Data.GetDataPresent(DataFormats.FileDrop))
            {
                string[] allFiles = (string[])drgevent.Data.GetData(DataFormats.FileDrop);

                if (allFiles == null)
                {
                    return;
                }

                string[] files = PruneDirectories(allFiles);

                bool importAsLayers = true;

                if (files.Length == 0)
                {
                    return;
                }
                else
                {
                    Icon   formIcon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.DragDrop.OpenOrImport.FormIcon.png").Reference);
                    string title    = PdnResources.GetString("DragDrop.OpenOrImport.Title");
                    string infoText = PdnResources.GetString("DragDrop.OpenOrImport.InfoText");

                    TaskButton openTB = new TaskButton(
                        PdnResources.GetImageResource("Icons.MenuFileOpenIcon.png").Reference,
                        PdnResources.GetString("DragDrop.OpenOrImport.OpenButton.ActionText"),
                        PdnResources.GetString("DragDrop.OpenOrImport.OpenButton.ExplanationText"));

                    string importLayersExplanation;
                    if (this.appWorkspace.DocumentWorkspaces.Length == 0)
                    {
                        importLayersExplanation = PdnResources.GetString("DragDrop.OpenOrImport.ImportLayers.ExplanationText.NoImagesYet");
                    }
                    else
                    {
                        importLayersExplanation = PdnResources.GetString("DragDrop.OpenOrImport.ImportLayers.ExplanationText");
                    }

                    TaskButton importLayersTB = new TaskButton(
                        PdnResources.GetImageResource("Icons.MenuLayersImportFromFileIcon.png").Reference,
                        PdnResources.GetString("DragDrop.OpenOrImport.ImportLayers.ActionText"),
                        importLayersExplanation);

                    TaskButton clickedTB = TaskDialog.Show(
                        this,
                        formIcon,
                        title,
                        null,
                        false,
                        infoText,
                        new TaskButton[] { openTB, importLayersTB, TaskButton.Cancel },
                        null,
                        TaskButton.Cancel);

                    if (clickedTB == openTB)
                    {
                        importAsLayers = false;
                    }
                    else if (clickedTB == importLayersTB)
                    {
                        importAsLayers = true;
                    }
                    else
                    {
                        return;
                    }
                }

                if (!importAsLayers)
                {
                    // open files into new tabs
                    this.appWorkspace.OpenFilesInNewWorkspace(files);
                }
                else
                {
                    // no image open? we will have to create one
                    if (this.appWorkspace.ActiveDocumentWorkspace == null)
                    {
                        Size newSize = this.appWorkspace.GetNewDocumentSize();

                        this.appWorkspace.CreateBlankDocumentInNewWorkspace(newSize, false);
                    }

                    ImportFromFileAction action = new ImportFromFileAction();
                    HistoryMemento       ha     = action.ImportMultipleFiles(this.appWorkspace.ActiveDocumentWorkspace, files);

                    if (ha != null)
                    {
                        this.appWorkspace.ActiveDocumentWorkspace.History.PushNewMemento(ha);
                    }
                }
            }

            base.OnDragDrop(drgevent);
        }