Example #1
0
        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));
        }
Example #2
0
 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);
 }
Example #3
0
 public RecordDefinition(StructDeclarationSyntax parentDecl, StructDeclarationSyntax recordDecl)
 {
     ParentSyntax          = parentDecl;
     Properties            = SimpleProperty.New(recordDecl).ToArray();
     IsConstructorDeclared = GetIsConstructorDeclared(ParentSyntax, Properties);
 }