62 references to ClassDeclaration
Microsoft.CodeAnalysis.CSharp.Features (1)
Snippets\CSharpClassSnippetProvider.cs (1)
51
return (ClassDeclarationSyntax)generator.
ClassDeclaration
(name);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (24)
CodeGeneration\SyntaxGeneratorTests.cs (24)
1534
Generator.
ClassDeclaration
("c"),
1542
Generator.
ClassDeclaration
("c", baseType: Generator.IdentifierName("x")),
1554
Generator.
ClassDeclaration
("c", interfaceTypes: new SyntaxNode[] { }),
1766
Generator.
ClassDeclaration
("c"),
1790
Generator.
ClassDeclaration
("c"),
1799
Generator.
ClassDeclaration
("c"))),
1894
Generator.
ClassDeclaration
("c"),
2024
Generator.
ClassDeclaration
("c"),
2122
Generator.
ClassDeclaration
("c"),
2749
AssertMemberNamesEqual("m", Generator.AddMembers(Generator.
ClassDeclaration
("d"), [Generator.MethodDeclaration("m")]));
2866
AssertMemberNamesEqual("c", Generator.NamespaceDeclaration("n", declarations: [Generator.
ClassDeclaration
("c")]));
2867
AssertMemberNamesEqual("c", Generator.CompilationUnit(declarations: [Generator.
ClassDeclaration
("c")]));
2874
Assert.Equal(DeclarationKind.Class, Generator.GetDeclarationKind(Generator.
ClassDeclaration
("c")));
2897
Assert.Equal("c", Generator.GetName(Generator.
ClassDeclaration
("c")));
2920
Assert.Equal("c", Generator.GetName(Generator.WithName(Generator.
ClassDeclaration
("x"), "c")));
2943
Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.
ClassDeclaration
("c", accessibility: Accessibility.Internal)));
2967
Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.
ClassDeclaration
("c", accessibility: Accessibility.Internal), Accessibility.Private)));
2992
Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.
ClassDeclaration
("c", modifiers: DeclarationModifiers.Abstract)));
3015
Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.WithModifiers(Generator.
ClassDeclaration
("c"), DeclarationModifiers.Abstract)));
3042
Generator.GetModifiers(Generator.WithModifiers(Generator.
ClassDeclaration
("c"), allModifiers)));
3210
Assert.Null(Generator.GetType(Generator.
ClassDeclaration
("c")));
3229
Assert.Null(Generator.GetType(Generator.WithType(Generator.
ClassDeclaration
("c"), Generator.IdentifierName("t"))));
3256
Assert.Equal(0, Generator.GetParameters(Generator.
ClassDeclaration
("c")).Count);
3272
Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.
ClassDeclaration
("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (36)
CodeGeneration\SyntaxGeneratorTests.vb (36)
909
Dim cd = Generator.
ClassDeclaration
("c", modifiers:=DeclarationModifiers.Sealed)
926
Dim cd = Generator.
ClassDeclaration
("c", modifiers:=DeclarationModifiers.Abstract)
1398
Generator.
ClassDeclaration
("c"),
1403
Generator.
ClassDeclaration
("c", typeParameters:={"x", "y"}),
1408
Generator.
ClassDeclaration
("c", accessibility:=Accessibility.Public),
1413
Generator.
ClassDeclaration
("c", baseType:=Generator.IdentifierName("x")),
1420
Generator.
ClassDeclaration
("c", interfaceTypes:={Generator.IdentifierName("x")}),
1427
Generator.
ClassDeclaration
("c", baseType:=Generator.IdentifierName("x"), interfaceTypes:={Generator.IdentifierName("y"), Generator.IdentifierName("z")}),
1435
Generator.
ClassDeclaration
("c", interfaceTypes:={}),
1440
Generator.
ClassDeclaration
("c", members:={Generator.FieldDeclaration("y", type:=Generator.IdentifierName("x"))}),
1693
Generator.
ClassDeclaration
("c"),
1725
Generator.
ClassDeclaration
("c"),
1738
Generator.
ClassDeclaration
("c"))),
1932
Generator.
ClassDeclaration
("c"),
2066
Generator.
ClassDeclaration
("c"),
2218
Generator.
ClassDeclaration
("c"),
2566
Assert.Equal(DeclarationKind.Class, Generator.GetDeclarationKind(Generator.
ClassDeclaration
("c")))
2591
Assert.Equal("c", Generator.GetName(Generator.
ClassDeclaration
("c")))
2616
Assert.Equal("c", Generator.GetName(Generator.WithName(Generator.
ClassDeclaration
("x"), "c")))
2641
Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.
ClassDeclaration
("c", accessibility:=Accessibility.Internal)))
2669
Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.
ClassDeclaration
("c", accessibility:=Accessibility.Internal), Accessibility.Private)))
2697
Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.
ClassDeclaration
("c", modifiers:=DeclarationModifiers.Abstract)))
2719
Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.WithModifiers(Generator.
ClassDeclaration
("c"), DeclarationModifiers.Abstract)))
2741
Dim classBlock = DirectCast(Generator.
ClassDeclaration
("C"), ClassBlockSyntax)
2753
Dim classBlock = DirectCast(Generator.
ClassDeclaration
("C"), ClassBlockSyntax)
2780
Assert.Null(Generator.GetType(Generator.
ClassDeclaration
("c")))
2800
Assert.Null(Generator.GetType(Generator.WithType(Generator.
ClassDeclaration
("c"), Generator.IdentifierName("t"))))
2858
Assert.Equal(0, Generator.GetParameters(Generator.
ClassDeclaration
("c")).Count)
2873
Assert.Equal(0, Generator.GetParameters(Generator.AddParameters(Generator.
ClassDeclaration
("c"), {Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))})).Count)
3158
AssertMemberNamesEqual("m", Generator.
ClassDeclaration
("c", members:={Generator.MethodDeclaration("m")}))
3162
AssertMemberNamesEqual("c", Generator.NamespaceDeclaration("n", declarations:={Generator.
ClassDeclaration
("c")}))
3163
AssertMemberNamesEqual("c", Generator.CompilationUnit(declarations:={Generator.
ClassDeclaration
("c")}))
3168
AssertMemberNamesEqual("m", Generator.AddMembers(Generator.
ClassDeclaration
("d"), {Generator.MethodDeclaration("m")}))
3175
AssertMemberNamesEqual({"m", "m2"}, Generator.AddMembers(Generator.
ClassDeclaration
("d", members:={Generator.MethodDeclaration("m")}), {Generator.MethodDeclaration("m2")}))
3185
TestRemoveAllMembers(Generator.
ClassDeclaration
("d", members:={Generator.MethodDeclaration("m")}))
3544
Generator.
ClassDeclaration
("C", members:={declX, declY}),
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
237
((CompilationUnitSyntax)newTypeDeclarationOrCompilationUnit).AddMembers((ClassDeclarationSyntax)generator.
ClassDeclaration
("Program", modifiers: DeclarationModifiers.Partial, members: new[] { newMethod }));