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