Microsoft.DocAsCode.Build.Engine.XRefArchive.CreateMinor C# (CSharp) Метод

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

public CreateMinor ( XRefMap map, IEnumerable names ) : string
map XRefMap
names IEnumerable
Результат string
        public string CreateMinor(XRefMap map, IEnumerable<string> names)
        {
            if (map == null)
            {
                throw new ArgumentNullException(nameof(map));
            }
            if (_mode == XRefArchiveMode.Read)
            {
                throw new InvalidOperationException("Cannot create entry for readonly archive.");
            }
            if (names != null)
            {
                foreach (var name in names)
                {
                    var entryName = NormalizeName(name);
                    if (entryName != null &&
                        !HasEntryCore(entryName))
                    {
                        return CreateCore(entryName, map);
                    }
                }
            }
            while (true)
            {
                var entryName = Guid.NewGuid().ToString() + ".yml";
                if (!HasEntryCore(entryName))
                {
                    return CreateCore(entryName, map);
                }
            }
        }

Usage Example

Пример #1
0
        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)));
                }
            }
        }
All Usage Examples Of Microsoft.DocAsCode.Build.Engine.XRefArchive::CreateMinor