public CreateMinor ( |
||
map | ||
names | IEnumerable |
|
return | string |
private async Task <string> DownloadCoreAsync(Uri uri, XRefArchive xa, bool isMajor) { XRefMap map; map = await DownloadBySchemeAsync(uri); if (map.Redirections?.Count > 0) { await RewriteRedirections(uri, xa, map); } if (map.References?.Count > 0 && map.HrefUpdated != true) { if (string.IsNullOrEmpty(map.BaseUrl)) { UpdateHref(map, uri); } } lock (_syncRoot) { if (isMajor) { return(xa.CreateMajor(map)); } else { return(xa.CreateMinor(map, GetNames(uri, map))); } } }
private async Task <string> DownloadCoreAsync(Uri uri, XRefArchive xa, bool isMajor) { IXRefContainer container; container = await _downloader.DownloadAsync(uri); if (!(container is XRefMap map)) { // not support download an xref archive, or reference to an xref archive return(null); } if (map.Redirections?.Count > 0) { await RewriteRedirections(uri, xa, map); } if (map.References?.Count > 0 && map.HrefUpdated != true) { if (string.IsNullOrEmpty(map.BaseUrl)) { XRefMapDownloader.UpdateHref(map, uri); } } lock (_syncRoot) { if (isMajor) { return(xa.CreateMajor(map)); } else { return(xa.CreateMinor(map, GetNames(uri, map))); } } }
private async Task<string> DownloadCoreAsync(Uri uri, XRefArchive xa, bool isMajor) { IXRefContainer container; container = await _downloader.DownloadAsync(uri); var map = container as XRefMap; if (map == null) { // not support download an xref archive, or reference to an xref archive return null; } if (map.Redirections?.Count > 0) { await RewriteRedirections(uri, xa, map); } if (map.References?.Count > 0 && map.HrefUpdated != true) { if (string.IsNullOrEmpty(map.BaseUrl)) { XRefMapDownloader.UpdateHref(map, uri); } } lock (_syncRoot) { if (isMajor) { return xa.CreateMajor(map); } else { return xa.CreateMinor(map, GetNames(uri, map)); } } }
private async Task PackOneReferenceAsync(string file, XRefArchive writer) { var currentPackage = Path.GetFileName(file); lock (_currentPackages) { _currentPackages[Array.IndexOf(_currentPackages, null)] = currentPackage; } var entries = new List<XRefMapRedirection>(); await GetItems(file).ForEachAsync(pair => { lock (writer) { entries.Add( new XRefMapRedirection { UidPrefix = pair.EntryName, Href = writer.CreateMinor( new XRefMap { Sorted = true, HrefUpdated = true, References = pair.ViewModel, }, new[] { pair.EntryName }) }); _entryCount++; _apiCount += pair.ViewModel.Count; } }); lock (writer) { var map = writer.GetMajor(); map.Redirections = (from r in map.Redirections.Concat(entries) orderby r.UidPrefix.Length descending select r).ToList(); writer.UpdateMajor(map); } lock (_currentPackages) { _currentPackages[Array.IndexOf(_currentPackages, currentPackage)] = null; } }