コード例 #1
0
        private async void ShowingFile_Click(object sender, RoutedEventArgs e)
        {
            if (await ConnectionAvailable() == true)
            {
                var selectItem = TableFilesFromDirectory.SelectedItem;
                FilesFromDirectory currentFile = (FilesFromDirectory)selectItem;

                ShowingDataFile window = new ShowingDataFile(currentFile.DirectLink);

                window.Show();
            }
        }
コード例 #2
0
        private async void RenameFile_Click(object sender, RoutedEventArgs e)
        {
            if (await ConnectionAvailable() == true)
            {
                var selectItem = TableFilesFromDirectory.SelectedItem;
                FilesFromDirectory currentFile = (FilesFromDirectory)selectItem;

                if (currentFile == null)
                {
                    MessageBox.Show("Выберите файл!");
                    return;
                }

                NameForDirectory window = new NameForDirectory();
                if (window.ShowDialog() == true)
                {
                    var resultRename = api.RenameFile(window.NameDirectory.Text, Convert.ToInt32(currentFile.Id));

                    UpdateListFiles();
                }
            }
        }