private IEnumerable <MemberDeclarationSyntax> GetGeneratedMember(SimpleProperty p) { var source = string.Format(@" public {1} {0} => _values.{0};", p.Name, p.Type.WithoutTrivia().GetText().ToString()); yield return(ToMemberDeclarationSyntax(source)); }
internal CodeTemplate(StructDeclarationSyntax parentDecl, StructDeclarationSyntax recordDecl, RoixStructGeneratorOptions options) { ParentSyntax = parentDecl; Name = parentDecl.GetGenericTypeName(); Options = options | GetOptionsFromName(Name); Properties = SimpleProperty.New(recordDecl).ToArray(); IsConstructorDeclared = GetIsConstructorDeclared(parentDecl, Properties); }
public RecordDefinition(StructDeclarationSyntax parentDecl, StructDeclarationSyntax recordDecl) { ParentSyntax = parentDecl; Properties = SimpleProperty.New(recordDecl).ToArray(); IsConstructorDeclared = GetIsConstructorDeclared(ParentSyntax, Properties); }