public static DownloadController Create(DownloadControllerOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } if (options.DownloadPath == null) { throw new ArgumentNullException(nameof(options.DownloadPath)); } options.DownloadingPath ??= options.DownloadPath + options.DownloadingExtension; options.DownloadingInfoPath ??= options.DownloadPath + options.DownloadingInfoExtension; var downloadData = Load(options); options.Uri ??= downloadData.Uri ?? throw new ArgumentNullException(nameof(options.Uri)); var ret = new DownloadController(options, downloadData); if (!options.IsStopped) { ret.Init().GetAwaiter(); } return(ret); }
public DownloadStateChangedEventArgs(DownloadController sender) { DownloadController = sender; }