// 資料夾拖曳進 Image Viewer / Main Folder private void Grid_Drop(object sender, DragEventArgs e) { preview_mode.IsChecked = false; if (e.Data.GetDataPresent(DataFormats.FileDrop)) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); if (files.Length == 1) { string file = files[0]; string filename = System.IO.Path.GetFileName(file); string file_ex = System.IO.Path.GetExtension(filename); if (file_ex != string.Empty) { GloableObject.change_src(file); folder_info.Text = "..."; targetFolder_path.Text = System.IO.Path.GetFileName(file); targetFolder_path.ToolTip = file; GloableObject.logger($"✔🔽 [Load File] - Loaded:[{filename}] Path:[{file}]"); } else { GloableObject.curPath = file; GloableObject.random_image(file + '\\'); targetFolder_path.Text = file; GloableObject.logger($"✔🔽 [Load Folder] - Loaded:[{filename}] Path:[{file}]"); GloableObject.logger($"✔⚙ [Set Main Directory] - Path: [ {file} ]", "HighLight"); GloableObject.folderInfo(); } } else { MessageBox.Show("Only Can Drop One File / Folder."); return; } } }