private static IEnumerable<FieldNode> GetFieldNodes(FieldDeclarationSyntax fd) { // For each variable in the field foreach (var variable in fd.Declaration.Variables) { FieldNode field = new FieldNode(); field.Modifier = fd.Modifiers.ToString(); field.Name = variable.Identifier.ToString(); field.ReturnType = fd.Declaration.Type.ToString(); yield return field; } }
private static EnumNode GetEnumNode(EnumDeclarationSyntax EachEnum) { EnumNode enumnode = new EnumNode(); enumnode.Name = EachEnum.Identifier.ToString(); foreach (var member in EachEnum.Members) { FieldNode f = new FieldNode(); f.Name = member.Identifier.ToString(); enumnode.Fields.Add(f); } return enumnode; }