KnowledgeBase.KB.ToMList2Key C# (CSharp) Method

ToMList2Key() private static method

private static ToMList2Key ( IEnumerable ToMList ) : Name
ToMList IEnumerable
return Name
        private static Name ToMList2Key(IEnumerable<Name> ToMList)
        {
            Name current = null;
            foreach (var n in ToMList.Reverse())
            {
                if(!(n.IsPrimitive||n.IsUniversal))
                    throw new ArgumentException("The name list can only have primitive or universal symbols",nameof(ToMList));
                if (current == null)
                    current = n;
                else
                    current = Name.BuildName(n, current);
            }
            return current;
        }