public static EnumDeclarationSyntax Apply(EnumDeclarationSyntax node, Func <EnumDeclarationSyntax, SyntaxTrivia, EnumDeclarationSyntax> builder)
        {
            var leadingTrivia  = node.GetLeadingTrivia();
            var trailingTrivia = node.GetTrailingTrivia();

            node = node.WithoutLeadingTrivia();
            node = node.WithoutTrailingTrivia();

            var wp = leadingTrivia.FirstOrDefault(w => w.Kind() == SyntaxKind.WhitespaceTrivia);

            node = builder?.Invoke(node, wp);

            node = node.WithLeadingTrivia(leadingTrivia);

            node = node.WithTrailingTrivia(trailingTrivia);

            return(node);
        }
        public override SyntaxNode VisitEnumDeclaration(EnumDeclarationSyntax node)
        {
            String name        = node.Identifier.ValueText;
            String replaceName = "";

            if (SharedContainer.Instance.nameMap.ContainsKey(name))
            {
                replaceName = SharedContainer.Instance.nameMap[name];
            }
            else
            {
                replaceName = SharedContainer.Instance.RandomString(SharedContainer.Instance.nameMap.Count() + 1);
                SharedContainer.Instance.nameType[name] = Priority.En_Priority.CLASS;
                SharedContainer.Instance.nameMap[name]  = replaceName;
            }

            EnumDeclarationSyntax newSyntax = node.WithIdentifier(Identifier(replaceName)).WithLeadingTrivia(node.GetLeadingTrivia()).WithTrailingTrivia(node.GetTrailingTrivia());

            return(base.VisitEnumDeclaration(node.ReplaceNode(node, newSyntax)));
        }
        /// <summary>
        /// Still needs work!
        /// </summary>
        /// <returns></returns>
        private Model.Enum TraverseEnums(EnumDeclarationSyntax eds)
        {
            Model.Enum retEnu = new Model.Enum();
            //public List<string> EnumItems { get; set; }
            //public string Name { get; set; }
            //public Type Type { get; set; }

            if (eds.HasLeadingTrivia)
            {
                SetOuterComments(retEnu, eds.GetLeadingTrivia().ToFullString());
            }

            if (eds.HasTrailingTrivia)
            {
                SetInnerComments(retEnu, eds.GetTrailingTrivia().ToFullString());
            }

            var types = from aType in eds.ChildNodes().OfType<TypeDeclarationSyntax>() select aType;
            foreach (TypeDeclarationSyntax tds in types)
            {
                //TODO put breakpoint here
                //to find out how to get types
            }
            foreach (SyntaxToken st in eds.Modifiers)
            {
                string modifier = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(st.ValueText);
                retEnu.Encapsulation.Add((Encapsulation)System.Enum.Parse(typeof(Encapsulation), modifier));
            }

            var enumItems = from aEnumItem in eds.ChildNodes().OfType<EnumMemberDeclarationSyntax>() select aEnumItem;
            foreach (EnumMemberDeclarationSyntax emds in enumItems)
            {
                //TODO put breakpoint here
                //to find out how to get enumitems
            }

            return retEnu;
        }