|
23 | 23 | using System.Text;
|
24 | 24 | using DataObject = System.Windows.DataObject;
|
25 | 25 | using System.Diagnostics;
|
| 26 | +using Microsoft.AspNetCore.Http; |
| 27 | +using System.IO; |
26 | 28 |
|
27 | 29 | namespace Flow.Launcher
|
28 | 30 | {
|
@@ -412,22 +414,19 @@ private void FileView_MouseMove(object sender, System.Windows.Input.MouseEventAr
|
412 | 414 | var d = (DependencyObject)e.OriginalSource;
|
413 | 415 | var item = ItemsControl.ContainerFromElement(r, d) as ListBoxItem;
|
414 | 416 | var result = (ResultViewModel)item?.DataContext;
|
415 |
| - Console.WriteLine("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); |
416 |
| - Console.WriteLine("result"); |
417 | 417 |
|
418 |
| - // right about here you get the file urls of the selected items. |
419 |
| - // should be quite easy, if not, ask. |
420 |
| - //string[] files = "asdf.txt"; |
421 | 418 |
|
422 |
| - string path = @"D:\test.png"; |
| 419 | + string copyText = string.IsNullOrEmpty(result.Result.CopyText) ? result.Result.SubTitle : result.Result.CopyText; |
| 420 | + var isFile = File.Exists(copyText); |
| 421 | + var isFolder = Directory.Exists(copyText); |
| 422 | + |
| 423 | + //string path = @"D:\test.png"; |
| 424 | + string path = Convert.ToString(copyText); |
423 | 425 | string[] files = { path };
|
424 | 426 | var data = new DataObject(System.Windows.DataFormats.FileDrop, files);
|
425 |
| - data.SetData(System.Windows.DataFormats.Text, files[0]); |
426 |
| - DragDrop.DoDragDrop(this, data, System.Windows.DragDropEffects.Copy); |
| 427 | + //data.SetData(System.Windows.DataFormats.FileDrop, files[0]); |
| 428 | + DragDrop.DoDragDrop(this.ResultListBox, data, System.Windows.DragDropEffects.Copy); |
427 | 429 | e.Handled = true;
|
428 |
| - // string dataFormat = System.Windows.DataFormats.FileDrop; |
429 |
| - //System.Windows.DataObject dataObject = new System.Windows.DataObject(dataFormat, files); |
430 |
| - //DragDrop.DoDragDrop(this.ResultListBox, dataObject, System.Windows.DragDropEffects.Copy); |
431 | 430 | }
|
432 | 431 | }
|
433 | 432 |
|
|
0 commit comments