Beispiel #1
0
        /////////////////////////////////////////////////////////////////////////////////
        //
        //
        /////////////////////////////////////////////////////////////////////////////////
        async void ShowThumbnail_Click(object sender, RoutedEventArgs e)
        {
            if (!(SelectedItem.Tag is ObjectDetails))
            {
                return;
            }

            var objectDetails = SelectedItem.Tag as ObjectDetails;

            var thumbnailResponse = await _viewDataClient.GetThumbnailAsync(
                objectDetails.FileId);

            if (!thumbnailResponse.IsOk())
            {
                _logger.LogError("Thumbnail request for " +
                                 objectDetails.ObjectKey + " failed: " +
                                 thumbnailResponse.Error.StatusCode.ToString());

                return;
            }

            _logger.LogMessage("Thumbnail request for " +
                               objectDetails.ObjectKey + " : Success");

            ThumbnailDlg thumbnailDlg = new ThumbnailDlg(
                objectDetails.ObjectKey,
                thumbnailResponse.Image);

            thumbnailDlg.Owner = this.Parent as Window;

            thumbnailDlg.Show();
        }
        /////////////////////////////////////////////////////////////////////////////////
        //
        //
        /////////////////////////////////////////////////////////////////////////////////
        async void ShowThumbnail_Click(object sender, RoutedEventArgs e)
        {
            if (!(SelectedItem.Tag is ObjectDetails))
                return;

            var objectDetails = SelectedItem.Tag as ObjectDetails;

            var thumbnailResponse = await _viewDataClient.GetThumbnailAsync(
                objectDetails.FileId);

            if (!thumbnailResponse.IsOk())
            {
                _logger.LogError("Thumbnail request for " +
                    objectDetails.ObjectKey + " failed: " +
                    thumbnailResponse.Error.StatusCode.ToString());

                return;
            }

            _logger.LogMessage("Thumbnail request for " +
               objectDetails.ObjectKey + " : Success");

            ThumbnailDlg thumbnailDlg = new ThumbnailDlg(
                objectDetails.ObjectKey,
                thumbnailResponse.Image);

            thumbnailDlg.Owner = this.Parent as Window;

            thumbnailDlg.Show();
        }