Esempio n. 1
0
        private void DoDelete()
        {
            var file = slackFiles.SelectedItem as ResponseFile;
            MessageBoxResult dialogResult = MessageBox.Show($"Are you sure you wish to delete the file: {file.name}", "Are you sure?", MessageBoxButton.YesNo);

            if (dialogResult == MessageBoxResult.Yes)
            {
                client.DeleteFile((response) => {
                    if (response.ok)
                    {
                        file.is_deleted = true;
                        SlackFilesRefresh();
                        SetStatus($"Deleted file  {file.name}");
                        Debug.WriteLine($"Deleted {file.name}: {response.ok}");
                    }
                    else
                    {
                        Debug.WriteLine($"Error deleting file {file.name}: {response.ok}");
                    }
                }, file.id);
            }
            else if (dialogResult == MessageBoxResult.No)
            {
                return;
            }
        }