/// <remarks> /// Support scheme: http, https, ftp, file, embedded. /// </remarks> protected virtual async Task <IXRefContainer> DownloadBySchemeAsync(Uri uri) { IXRefContainer result = null; if (uri.IsFile) { result = DownloadFromLocal(uri); } else if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps || uri.Scheme == Uri.UriSchemeFtp) { result = await DownloadFromWebAsync(uri); } else if (uri.Scheme == "embedded") { result = DownloadFromAssembly(uri); } else { throw new ArgumentException($"Unsupported scheme {uri.Scheme}, expected: http, https, ftp, file, embedded.", nameof(uri)); } if (result == null) { throw new InvalidDataException($"Invalid yaml file from {uri}."); } return(result); }
private void AddRedirections(string uid, Stack <string> checkList, IXRefContainer current) { foreach (var r in current.GetRedirections().Reverse()) { if (r.UidPrefix == null || uid.StartsWith(r.UidPrefix)) { if (r.Href != null) { checkList.Push(r.Href); } } } }
private void AddRedirections(string uid, Stack<string> checkList, IXRefContainer current) { foreach (var r in current.GetRedirections().Reverse()) { if (r.UidPrefix == null || uid.StartsWith(r.UidPrefix)) { if (r.Href != null) { checkList.Push(r.Href); } } } }