Beispiel #1
0
 public static BaseListSyntax CreateTwoSimpleBaseTypes(
     string typeName1,
     string typeName2)
 {
     return(SyntaxFactory.BaseList(
                SyntaxFactory.SeparatedList <BaseTypeSyntax>(
                    new SyntaxNodeOrToken[]
     {
         SyntaxSimpleBaseTypeFactory.Create(typeName1),
         SyntaxTokenFactory.Comma(),
         SyntaxSimpleBaseTypeFactory.Create(typeName2),
     })));
 }
        public static ClassDeclarationSyntax CreateWithInheritClassType(string classTypeName, string inheritClassTypeName)
        {
            if (classTypeName == null)
            {
                throw new ArgumentNullException(nameof(classTypeName));
            }

            if (inheritClassTypeName == null)
            {
                throw new ArgumentNullException(nameof(inheritClassTypeName));
            }

            return(SyntaxFactory.ClassDeclaration(classTypeName)
                   .AddModifiers(SyntaxTokenFactory.PublicKeyword())
                   .AddBaseListTypes(SyntaxSimpleBaseTypeFactory.Create(inheritClassTypeName)));
        }
Beispiel #3
0
 public static BaseListSyntax CreateOneSimpleBaseType(string typeName)
 {
     return(SyntaxFactory.BaseList(
                SyntaxFactory.SingletonSeparatedList <BaseTypeSyntax>(
                    SyntaxSimpleBaseTypeFactory.Create(typeName))));
 }