PKHeX.Form1.dragout_MouseDown C# (CSharp) Method

dragout_MouseDown() private method

private dragout_MouseDown ( object sender, MouseEventArgs e ) : void
sender object
e MouseEventArgs
return void
        private void dragout_MouseDown(object sender, MouseEventArgs e)
        {
            if (!verifiedPKX()) { return; }
            {
                // Create Temp File to Drag
                string basepath = Application.StartupPath;
                Cursor.Current = Cursors.Hand;

                // Make a new file name
                byte[] dragdata = preparepkx();
                PKX pkx = new PKX(dragdata, "Tabs");
                string filename = pkx.Nickname;
                if (filename != pkx.Species)
                    filename += " (" + pkx.Species + ")";
                filename += " - " + pkx.PID;

                filename += (e.Button == MouseButtons.Right) ? ".ek6" : ".pk6";
                dragdata = (e.Button == MouseButtons.Right) ? PKX.encryptArray(preparepkx()) : preparepkx();
                // Strip out party stats (if they are there)
                Array.Resize(ref dragdata, 232);
                // Make file
                string newfile = Path.Combine(basepath, Util.CleanFileName(filename));
                try
                {
                    File.WriteAllBytes(newfile, dragdata);

                    string[] filesToDrag = { newfile };
                    dragout.DoDragDrop(new DataObject(DataFormats.FileDrop, filesToDrag), DragDropEffects.Move);
                    File.Delete(newfile);
                }
                catch (Exception x)
                { Util.Error("Drag & Drop Error", x.ToString()); }
                File.Delete(newfile);
            }
        }
        private void dragout_DragOver(object sender, DragEventArgs e)
Form1