Esempio n. 1
0
        private static string GetObjectNodeName(ObjectNode node)
        {
            string name = node.GetType().Name;

            // Some nodes are generic and their type name contains "`". Strip it.
            int indexOfAccent = name.LastIndexOf('`');

            if (indexOfAccent > 0)
            {
                name = name.Substring(0, indexOfAccent);
            }

            // Node type names generally end with "Node", but that's redundant.
            if (name.EndsWith("Node"))
            {
                name = name.Substring(0, name.Length - 4);
            }

            return(name);
        }