private void ScrollViewer_Drop(object sender, DragEventArgs e) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); string files_string = ""; foreach (string str in files) { files_string += str + "\n"; } string question = ""; if (currentDir != "") { question = "Загрузить эти файлы в " + currentDir + "?"; } else { question = "Загрузить эти файлы в корень?"; } MyInputDialog dialog = new MyInputDialog(question, false, files_string, 1000, 700); dialog.ShowDialog(); if (!dialog.cancelled) { progressBar.Maximum = files.Length; progressBar.Value = 0; UploadFilesAsunc(files); } }
void ElementSharingWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ItemInformation sharedItem = (ItemInformation)e.Result; MyInputDialog dialog = new MyInputDialog("Ссылка на " + sharedItem.Name, false, sharedItem.Share_url); dialog.ShowDialog(); }
void SharedListLoadWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ItemInformation[] array = (ItemInformation[])e.Result; string result_string = "тип объекта".PadRight(12) + "|" + "путь на диске".PadLeft(23).PadRight(31) + "|" + "ссылка".PadLeft(43).PadRight(85) + "|\n"; result_string += "".PadRight(106, '-') + "\n"; string cut_name = ""; string obj_type = ""; for (int i = 0; i < array.Length; i++) { if (array[i].Name.Length >= 20) { cut_name = array[i].Name.Substring(0, 20) + "..."; } else { cut_name = array[i].Name; } if (array[i].Type == ElementType.dir) { obj_type = "папка"; } else { obj_type = "файл"; } result_string += obj_type.PadRight(15) + " | " + cut_name.PadRight(30) + " | " + array[i].Share_url + "\n"; result_string += "".PadRight(106, '-') + "\n"; } MyInputDialog dialog = new MyInputDialog("Список расшареных объектов", false, result_string, 1000, 700); dialog.ShowDialog(); }
private void Button_Click_1(object sender, RoutedEventArgs e) { MyInputDialog dialog = new MyInputDialog("Введите поисковый запрос", true); dialog.ShowDialog(); if (!dialog.cancelled) { SearchAsunc(dialog.folderName); } }
void DeleteElementAsunc(string path, string itemname) { MyInputDialog dialog = new MyInputDialog("Действительно удалить " + itemname + "?", editable: false, inputText: path); dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen; dialog.ShowDialog(); if (!dialog.cancelled) { directoryDeleteWorker.RunWorkerAsync(path); } }
void CreateFolderAsunc() { MyInputDialog dialog = new MyInputDialog("Введите имя папки", editable: true); dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen; dialog.ShowDialog(); if (!dialog.cancelled && dialog.folderName.Length > 0) { directoryCreaterWorker.RunWorkerAsync(currentDir + "/" + dialog.folderName); } }