Ejemplo n.º 1
0
 private string CreateDragDropPKM(PictureBox pb, bool encrypt, out bool external)
 {
     byte[] dragdata = SAV.DecryptPKM(DragInfo.Source.OriginalData);
     Array.Resize(ref dragdata, SAV.SIZE_STORED);
     PKM    pkx      = SAV.GetPKM(dragdata);
     string fn       = pkx.FileName; fn = fn.Substring(0, fn.LastIndexOf('.'));
     string filename = $"{fn}{(encrypt ? $".ek{pkx.Format}" : $".{pkx.Extension}")}";
Ejemplo n.º 2
0
        private string CreateDragDropPKM(PictureBox pb, bool encrypt, out bool external)
        {
            byte[] dragdata = SAV.DecryptPKM(DragInfo.Source.OriginalData);
            Array.Resize(ref dragdata, SAV.SIZE_STORED);

            // Make File
            PKM    pk      = SAV.GetPKM(dragdata);
            string newfile = FileUtil.GetPKMTempFileName(pk, encrypt);

            try
            {
                TryMakeDragDropPKM(pb, encrypt, pk, newfile, out external);
            }
            catch (Exception x)
            {
                WinFormsUtil.Error("Drag & Drop Error", x);
                external = false;
            }

            return(newfile);
        }
Ejemplo n.º 3
0
        private string CreateDragDropPKM(PictureBox pb, bool encrypt, out bool external)
        {
            byte[] dragdata = SAV.DecryptPKM(DragInfo.Source.OriginalData);
            Array.Resize(ref dragdata, SAV.SIZE_STORED);
            PKM    pkx      = SAV.GetPKM(dragdata);
            string fn       = pkx.FileName; fn = fn.Substring(0, fn.LastIndexOf('.'));
            string filename = fn + (encrypt ? $".ek{pkx.Format}" : $".{pkx.Extension}");

            // Make File
            string newfile = Path.Combine(Path.GetTempPath(), Util.CleanFileName(filename));

            try
            {
                TryMakeDragDropPKM(pb, encrypt, pkx, newfile, out external);
            }
            catch (Exception x)
            {
                WinFormsUtil.Error("Drag & Drop Error", x);
                external = false;
            }

            return(newfile);
        }