1) I have confirmed that this issue also occurs in a normal TextBox control drag/drop so I will submit the question to another forum.
2) I don't believe that this is a WinRAR issue because I can successfully implement a standard TextBox control DragDrop and it works. I think this is an issue with the PastDragDrop event not firing with e.Source == PasteDragDropSource.DragDrop.
Place a SyntaxEdeditor control "editor" on a form with the AllowDrop property enabled and the following code associated with the control PasteDragDrop event.
private void editor_PasteDragDrop(object sender, ActiproSoftware.SyntaxEditor.PasteDragDropEventArgs e)
{
System.Diagnostics.Debug.WriteLine(e.Source.ToString());
if (e.Source == PasteDragDropSource.DragEnter)
{
if (e.DataObject.GetDataPresent(DataFormats.FileDrop))
e.DragEventArgs.Effect = DragDropEffects.All;
}
else if (e.Source == PasteDragDropSource.DragDrop)
{
object files = e.DataObject.GetData(DataFormats.FileDrop);
if (files != null && (files is string[]) && (((string[])files).Length > 0))
{
string filename = ((string[])files)[0];
editor.Text = filename;
}
}
}
The "else if" statement never fires even though, on the DragEnter, the code reaches the line to set the "Effect".
However if you place a standard TextBox control "textBox1" on a form with the AllowDrop property enabled and the DragEnter and DragDrop events configured with the following
private void textBox1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All;
}
private void textBox1_DragDrop(object sender, DragEventArgs e)
{
object files = e.Data.GetData(DataFormats.FileDrop);
if (files != null && (files is string[]) && (((string[])files).Length > 0))
{
string filename = ((string[])files)[0];
textBox1.Text = filename;
}
}
The text of the editor is successfully updated to the temporary file name produced in the unzip from WinRAR on drop of the file.
Thanks
-Paul
[Modified at 12/04/2009 05:04 PM]