Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        void ElementSharingWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            ItemInformation sharedItem = (ItemInformation)e.Result;
            MyInputDialog   dialog     = new MyInputDialog("Ссылка на " + sharedItem.Name, false, sharedItem.Share_url);

            dialog.ShowDialog();
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            MyInputDialog dialog = new MyInputDialog("Введите поисковый запрос", true);

            dialog.ShowDialog();
            if (!dialog.cancelled)
            {
                SearchAsunc(dialog.folderName);
            }
        }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
        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);
            }
        }