mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
30 lines
877 B
C#
30 lines
877 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using VideoLinkDownloader.Core;
|
|
|
|
namespace VideoLinkDownloader.Pages.Main
|
|
{
|
|
class MainPageViewModel : NotificationObject
|
|
{
|
|
public MainPageViewModel()
|
|
{
|
|
if (Clipboard.ContainsText())
|
|
{
|
|
var text = Clipboard.GetText();
|
|
var (success, videos) = Video.Parse(text);
|
|
if (success)
|
|
{
|
|
videos.ForEach(video => VideoTasks.Add(new VideoTask(video)));
|
|
}
|
|
}
|
|
VideoTasks.ForEach(async it => await it.Download());
|
|
}
|
|
public ObservableCollection<VideoTask> VideoTasks { get; } = new ObservableCollection<VideoTask>();
|
|
}
|
|
}
|