Esempio n. 1
0
        /// <summary>
        /// Returns a string with the hierarchy of element names.
        /// </summary>
        public static string GetNameHierarchy([NotNull] this XContainer node)
        {
            if (node == null)
            {
                throw new ArgumentNullException(nameof(node));
            }

            var result = "";

            do
            {
                result = (result.Length == 0) ? node.GetName() : node.GetName() + @"\" + result;
                node   = node.Parent;
            } while (node != null);
            return(result);
        }