AcManager.Tools.Helpers.Loaders.AcClubLoader.PrepareAsync C# (CSharp) Метод

PrepareAsync() публичный Метод

public PrepareAsync ( WebClient client, CancellationToken cancellation ) : Task
client System.Net.WebClient
cancellation System.Threading.CancellationToken
Результат Task
        public override async Task<bool> PrepareAsync(WebClient client, CancellationToken cancellation) {
            var downloadPage = await client.DownloadStringTaskAsync(Url);
            if (cancellation.IsCancellationRequested) return false;

            var match = Regex.Match(downloadPage, @"<p class=""download""><a href=""([^""]+)");
            if (!match.Success) {
                NonfatalError.Notify(ToolsStrings.Common_CannotDownloadFile, ToolsStrings.DirectLoader_AcClubChanged);
                return false;
            }

            Url = HttpUtility.HtmlDecode(match.Groups[1].Value);
            Logging.Write("AssettoCorsa.club download link: " + Url);

            _innerLoader = FlexibleLoader.CreateLoader(Url);
            if (_innerLoader is AcClubLoader) throw new Exception(ToolsStrings.DirectLoader_RecursionDetected);
            return await _innerLoader.PrepareAsync(client, cancellation);
        }