Understand 'Preferred DropEffect' and 'FileDrop' OLE formats

This commit is contained in:
Michael Becker 2015-10-04 22:34:41 -04:00
parent 85d22676bc
commit 4fde30ce32

View File

@ -2034,6 +2034,15 @@ namespace UniversalEditor.Engines.WindowsForms
{
e.Effect = DragDropEffects.Link;
}
if (e.Data.GetDataPresent("Preferred DropEffect"))
{
System.IO.MemoryStream ms = (e.Data.GetData("Preferred DropEffect") as System.IO.MemoryStream);
System.IO.BinaryReader br = new System.IO.BinaryReader(ms);
int value = br.ReadInt32();
DragDropEffects effect = (DragDropEffects)value;
e.Effect = effect;
}
}
private void MainWindow_DragDrop(object sender, DragEventArgs e)
@ -2057,6 +2066,17 @@ namespace UniversalEditor.Engines.WindowsForms
{
string rtf = (e.Data.GetData("Text") as string);
}
else if (e.Data.GetDataPresent("FileDrop"))
{
object data = e.Data.GetData("FileDrop");
string[] filenames = (e.Data.GetData("FileDrop") as string[]);
Document[] documents = new Document[filenames.Length];
for (int i = 0; i < documents.Length; i++)
{
documents[i] = new Document(null, null, new FileAccessor(filenames[i]));
}
OpenFile(documents);
}
else if (e.Data.GetDataPresent("FileNameW"))
{
string[] filenames = (e.Data.GetData("FileNameW") as string[]);