public MediaResourceView(GrabbedMediaViewModel viewModel)
        {
            DataContext = viewModel;
            InitializeComponent();

            var channels = GrabbedMedia.Media.Channels;
            DrawingPresenter icon;

            if (viewModel.IsComposition)
            {
                icon = iconCreate;
                btnCopyLink.IsVisible = false;
                ((TextBlock)btnDownload.Content).Text = "Download & convert";
            }
            else
            {
                switch (channels)
                {
                case MediaChannels.Both:
                    icon = iconCheck;
                    break;

                case MediaChannels.Audio:
                    icon = iconAudio;
                    break;

                case MediaChannels.Video:
                    icon = iconVideo;
                    break;

                default:
                    throw new NotSupportedException($"Media channel of {channels} is not supported.");
                }
            }
            icon.IsVisible = true;
        }
Esempio n. 2
0
 public MediaDownloader(GrabbedMediaViewModel grabbedViewModel, string targetPath, GrabResult grabResult)
 {
     _grabResult = grabResult;
     _viewModel  = grabbedViewModel;
     _targetPath = targetPath;
 }
Esempio n. 3
0
 public Downloader(GrabbedMediaViewModel grabbedViewModel, string targetPath)
 {
     _viewModel  = grabbedViewModel;
     _targetPath = targetPath;
 }