Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax nodes.
public static class SyntaxAccessorDeclarationFactory
AccessorDeclarationSyntax Get(bool withSemicolon = True)Summary: Creates a get accessor declaration.
Parameters:
withSemicolon- If true, includes a semicolon token; otherwise, uses a missing token.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntaxrepresenting a get accessor.
AccessorDeclarationSyntax Set(bool withSemicolon = True)Summary: Creates a set accessor declaration.
Parameters:
withSemicolon- If true, includes a semicolon token; otherwise, uses a missing token.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntaxrepresenting a set accessor.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax nodes.
public static class SyntaxArgumentFactory
ArgumentSyntax Create(string argumentName)Summary: Creates an argument from an identifier name.
Parameters:
argumentName- The name of the argument identifier.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntaxnode.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentListSyntax nodes.
public static class SyntaxArgumentListFactory
ArgumentListSyntax CreateWithOneArgumentItem(ArgumentSyntax argument)Summary: Creates an argument list with a single argument.
Parameters:
argument- The argument to include.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentListSyntaxcontaining one argument.
ArgumentListSyntax CreateWithOneExpressionItem(ExpressionSyntax argumentExpression1)Summary: Creates an argument list with a single argument from an expression.
Parameters:
argumentExpression1- The expression to use as the argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentListSyntaxcontaining one argument.
ArgumentListSyntax CreateWithOneItem(string argumentName)Summary: Creates an argument list with a single argument from an identifier name.
Parameters:
argumentName- The name of the argument identifier.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentListSyntaxcontaining one argument.
ArgumentListSyntax CreateWithThreeArgumentItems(ArgumentSyntax argument1, ArgumentSyntax argument2, ArgumentSyntax argument3)Summary: Creates an argument list with three arguments.
Parameters:
argument1- The first argument to include.
argument2- The second argument to include.
argument3- The third argument to include.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentListSyntaxcontaining three arguments.
ArgumentListSyntax CreateWithThreeExpressionItems(ExpressionSyntax argumentExpression1, ExpressionSyntax argumentExpression2, ExpressionSyntax argumentExpression3)Summary: Creates an argument list with three arguments from expressions.
Parameters:
argumentExpression1- The expression to use as the first argument.
argumentExpression2- The expression to use as the second argument.
argumentExpression3- The expression to use as the third argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentListSyntaxcontaining three arguments.
ArgumentListSyntax CreateWithTwoArgumentItems(ArgumentSyntax argument1, ArgumentSyntax argument2)Summary: Creates an argument list with two arguments.
Parameters:
argument1- The first argument to include.
argument2- The second argument to include.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentListSyntaxcontaining two arguments.
ArgumentListSyntax CreateWithTwoExpressionItems(ExpressionSyntax argumentExpression1, ExpressionSyntax argumentExpression2)Summary: Creates an argument list with two arguments from expressions.
Parameters:
argumentExpression1- The expression to use as the first argument.
argumentExpression2- The expression to use as the second argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentListSyntaxcontaining two arguments.
ArgumentListSyntax CreateWithTwoItems(string argumentName1, string argumentName2)Summary: Creates an argument list with two arguments from identifier names.
Parameters:
argumentName1- The name of the first argument identifier.
argumentName2- The name of the second argument identifier.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentListSyntaxcontaining two arguments.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.AssignmentExpressionSyntax nodes.
public static class SyntaxAssignmentExpressionFactory
AssignmentExpressionSyntax CreateSimple(string toIdentifierName, string fromIdentifierName)Summary: Creates a simple assignment expression (e.g.,
toIdentifierName = fromIdentifierName).Parameters:
toIdentifierName- The identifier name on the left side of the assignment.
fromIdentifierName- The identifier name on the right side of the assignment.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AssignmentExpressionSyntaxnode representing the simple assignment.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.AttributeArgumentSyntax nodes.
public static class SyntaxAttributeArgumentFactory
AttributeArgumentSyntax Create(string attributeValue)Summary: Creates an attribute argument from a string value.
Parameters:
attributeValue- The string value for the attribute argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeArgumentSyntaxnode.
AttributeArgumentSyntax Create(int attributeValue)Summary: Creates an attribute argument from a string value.
Parameters:
attributeValue- The string value for the attribute argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeArgumentSyntaxnode.
AttributeArgumentSyntax Create(object attributeValue)Summary: Creates an attribute argument from a string value.
Parameters:
attributeValue- The string value for the attribute argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeArgumentSyntaxnode.
AttributeArgumentSyntax CreateWithNameEquals(string attributeName, string attributeValue)Summary: Creates an attribute argument with a name-equals syntax from a string value.
Parameters:
attributeName- The name of the attribute property.
attributeValue- The string value for the attribute argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeArgumentSyntaxnode with a name-equals clause.
AttributeArgumentSyntax CreateWithNameEquals(string attributeName, int attributeValue)Summary: Creates an attribute argument with a name-equals syntax from a string value.
Parameters:
attributeName- The name of the attribute property.
attributeValue- The string value for the attribute argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeArgumentSyntaxnode with a name-equals clause.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.AttributeArgumentListSyntax nodes.
public static class SyntaxAttributeArgumentListFactory
AttributeArgumentListSyntax CreateWithOneItemWithNameEquals(string attributeName, string attributeValue)Summary: Creates an attribute argument list with a single named argument from a string value.
Parameters:
attributeName- The name of the attribute property.
attributeValue- The string value for the attribute argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeArgumentListSyntaxcontaining one named argument.
AttributeArgumentListSyntax CreateWithOneItemWithNameEquals(string attributeName, int attributeValue)Summary: Creates an attribute argument list with a single named argument from a string value.
Parameters:
attributeName- The name of the attribute property.
attributeValue- The string value for the attribute argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeArgumentListSyntaxcontaining one named argument.
Syntax Attribute Factory.
Remarks: List of ValidationAttribute's: https://referencesource.microsoft.com/#System.ComponentModel.DataAnnotations/DataAnnotations/ValidationAttribute.cs.
public static class SyntaxAttributeFactory
AttributeSyntax Create(string attributeName)Summary: Creates an attribute from a name.
Parameters:
attributeName- The name of the attribute (with or without "Attribute" suffix).Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntaxnode.
AttributeSyntax CreateFromValidationAttribute(ValidationAttribute validationAttribute)Summary: Creates an attribute syntax from a
System.ComponentModel.DataAnnotations.ValidationAttributeinstance.Parameters:
validationAttribute- The validation attribute to convert.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntaxnode representing the validation attribute.
AttributeSyntax CreateWithOneItemWithOneArgument(string attributeName, string argumentValue)Summary: Creates an attribute with a single string argument.
Parameters:
attributeName- The name of the attribute (with or without "Attribute" suffix).
argumentValue- The string value for the argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntaxnode with one argument.
AttributeSyntax CreateWithOneItemWithOneArgument(string attributeName, int argumentValue)Summary: Creates an attribute with a single string argument.
Parameters:
attributeName- The name of the attribute (with or without "Attribute" suffix).
argumentValue- The string value for the argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntaxnode with one argument.
AttributeSyntax CreateWithOneItemWithTwoArgument(string attributeName, object argumentValue1, object argumentValue2)Summary: Creates an attribute with two arguments.
Parameters:
attributeName- The name of the attribute (with or without "Attribute" suffix).
argumentValue1- The first argument value.
argumentValue2- The second argument value.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntaxnode with two arguments.
string RemoveSuffix(string attributeName)Summary: Removes the "Attribute" suffix from an attribute name if present.
Parameters:
attributeName- The attribute name to process.Returns: The attribute name without the "Attribute" suffix.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax nodes.
public static class SyntaxAttributeListFactory
AttributeListSyntax Create(string attributeName)Summary: Creates an attribute list with a single attribute.
Parameters:
attributeName- The name of the attribute.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntaxcontaining one attribute.
AttributeListSyntax Create(string attributeName, AttributeArgumentListSyntax attributeArgumentList)Summary: Creates an attribute list with a single attribute.
Parameters:
attributeName- The name of the attribute.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntaxcontaining one attribute.
AttributeListSyntax CreateWithOneItemWithOneArgument(string attributeName, string argumentValue)Summary: Creates an attribute list with a single attribute and one string argument.
Parameters:
attributeName- The name of the attribute.
argumentValue- The string value for the argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntaxcontaining one attribute with one argument.
AttributeListSyntax CreateWithOneItemWithOneArgumentWithNameEquals(string attributeName, string argumentName, string argumentValue)Summary: Creates an attribute list with a single attribute and one named argument.
Parameters:
attributeName- The name of the attribute.
argumentName- The name of the argument property.
argumentValue- The string value for the argument.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntaxcontaining one attribute with a named argument.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.BaseListSyntax nodes.
public static class SyntaxBaseListFactory
BaseListSyntax CreateOneSimpleBaseType(string typeName)Summary: Creates a base list with a single base type.
Parameters:
typeName- The name of the base type.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.BaseListSyntaxcontaining one base type.
BaseListSyntax CreateTwoSimpleBaseTypes(string typeName1, string typeName2)Summary: Creates a base list with two base types.
Parameters:
typeName1- The name of the first base type.
typeName2- The name of the second base type.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.BaseListSyntaxcontaining two base types.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax nodes.
public static class SyntaxClassDeclarationFactory
ClassDeclarationSyntax Create(string classTypeName)Summary: Creates a public class declaration.
Parameters:
classTypeName- The name of the class.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith public modifier.
ClassDeclarationSyntax CreateAsInternalStatic(string classTypeName)Summary: Creates an internal static class declaration.
Parameters:
classTypeName- The name of the class.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith internal and static modifiers.
ClassDeclarationSyntax CreateAsPublicPartial(string classTypeName)Summary: Creates a public partial class declaration.
Parameters:
classTypeName- The name of the class.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith public and partial modifiers.
ClassDeclarationSyntax CreateAsPublicStatic(string classTypeName)Summary: Creates a public static class declaration.
Parameters:
classTypeName- The name of the class.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith public and static modifiers.
ClassDeclarationSyntax CreateWithInheritClassAndInterface(string classTypeName, string inheritClassTypeName, string interfaceTypeName)Summary: Creates a public class declaration that inherits from a base class and implements an interface.
Parameters:
classTypeName- The name of the class.
inheritClassTypeName- The name of the base class to inherit from.
interfaceTypeName- The name of the interface to implement.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith inheritance and interface implementation.
ClassDeclarationSyntax CreateWithInheritClassType(string classTypeName, string inheritClassTypeName)Summary: Creates a public class declaration that inherits from a base class.
Parameters:
classTypeName- The name of the class.
inheritClassTypeName- The name of the base class to inherit from.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith inheritance.
ClassDeclarationSyntax CreateWithInheritClassTypeAndSuppressMessageAttributeByCodeAnalysisCheckId(string classTypeName, string inheritClassTypeName, int checkId, string justification = )Summary: Creates a public class declaration with inheritance and a Code Analysis suppress message attribute.
Parameters:
classTypeName- The name of the class.
inheritClassTypeName- The name of the base class to inherit from.
checkId- The Code Analysis check ID to suppress.
justification- The justification for suppressing the check.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith inheritance and the suppress message attribute.
ClassDeclarationSyntax CreateWithInheritClassTypeAndSuppressMessageAttributeByStyleCopCheckId(string classTypeName, string inheritClassTypeName, int checkId, string justification = )Summary: Creates a public class declaration with inheritance and a StyleCop suppress message attribute.
Parameters:
classTypeName- The name of the class.
inheritClassTypeName- The name of the base class to inherit from.
checkId- The StyleCop check ID to suppress.
justification- The justification for suppressing the check.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith inheritance and the suppress message attribute.
ClassDeclarationSyntax CreateWithInterface(string classTypeName, string interfaceTypeName)Summary: Creates a public class declaration that implements an interface.
Parameters:
classTypeName- The name of the class.
interfaceTypeName- The name of the interface to implement.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith interface implementation.
ClassDeclarationSyntax CreateWithSuppressMessageAttribute(string classTypeName, SuppressMessageAttribute suppressMessage)Summary: Creates a public class declaration with a suppress message attribute.
Parameters:
classTypeName- The name of the class.
suppressMessage- The suppress message attribute to add.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith the suppress message attribute.
ClassDeclarationSyntax CreateWithSuppressMessageAttributeByCodeAnalysisCheckId(string classTypeName, int checkId, string justification = )Summary: Creates a public class declaration with a Code Analysis suppress message attribute.
Parameters:
classTypeName- The name of the class.
checkId- The Code Analysis check ID to suppress.
justification- The justification for suppressing the check.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith the suppress message attribute.
ClassDeclarationSyntax CreateWithSuppressMessageAttributeByStyleCopCheckId(string classTypeName, int checkId, string justification = )Summary: Creates a public class declaration with a StyleCop suppress message attribute.
Parameters:
classTypeName- The name of the class.
checkId- The StyleCop check ID to suppress.
justification- The justification for suppressing the check.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntaxwith the suppress message attribute.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax nodes.
public static class SyntaxIfStatementFactory
StatementSyntax CreateParameterArgumentNullCheck(string parameterName, bool includeSystem = True)Summary: Creates an if statement that checks if a parameter is null and throws
System.ArgumentNullException.Parameters:
parameterName- The name of the parameter to check for null.
includeSystem- If true, includes the System namespace prefix for ArgumentNullException.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntaxrepresenting the null check.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.InterfaceDeclarationSyntax nodes.
public static class SyntaxInterfaceDeclarationFactory
InterfaceDeclarationSyntax Create(string interfaceTypeName)Summary: Creates a public interface declaration.
Parameters:
interfaceTypeName- The name of the interface.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.InterfaceDeclarationSyntaxwith public modifier.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.InterpolatedStringContentSyntax nodes for interpolated strings.
public static class SyntaxInterpolatedFactory
InterpolatedStringContentSyntax CreateNameOf(string argumentName)Summary: Creates an interpolated content node containing a nameof expression.
Parameters:
argumentName- The name of the argument to use in the nameof expression.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.InterpolatedStringContentSyntaxrepresenting nameof(argumentName).
InterpolatedStringContentSyntax StringText(string value)Summary: Creates an interpolated string text content from a value.
Parameters:
value- The text value to include in the interpolated string.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.InterpolatedStringContentSyntaxrepresenting the text.
InterpolatedStringContentSyntax StringTextColon()Summary: Creates interpolated string text for a colon and space (": ").
Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.InterpolatedStringContentSyntaxrepresenting ": ".
InterpolatedStringContentSyntax StringTextColonAndParenthesesStart()Summary: Creates interpolated string text for ": (".
Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.InterpolatedStringContentSyntaxrepresenting ": (".
InterpolatedStringContentSyntax StringTextComma()Summary: Creates interpolated string text for a comma and space (", ").
Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.InterpolatedStringContentSyntaxrepresenting ", ".
InterpolatedStringContentSyntax StringTextDotCountColon()Summary: Creates interpolated string text for ".Count: ".
Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.InterpolatedStringContentSyntaxrepresenting ".Count: ".
InterpolatedStringContentSyntax StringTextParenthesesEnd()Summary: Creates interpolated string text for ")".
Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.InterpolatedStringContentSyntaxrepresenting ")".
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.LiteralExpressionSyntax nodes.
public static class SyntaxLiteralExpressionFactory
LiteralExpressionSyntax Create(string value, SyntaxKind syntaxKind = StringLiteralExpression)Summary: Creates a literal expression from a string value with the specified syntax kind.
Parameters:
value- The value for the literal expression.
syntaxKind- The syntax kind for the literal (string or numeric).Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.LiteralExpressionSyntaxnode.
LiteralExpressionSyntax Create(int value)Summary: Creates a literal expression from a string value with the specified syntax kind.
Parameters:
value- The value for the literal expression.
syntaxKind- The syntax kind for the literal (string or numeric).Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.LiteralExpressionSyntaxnode.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.MemberAccessExpressionSyntax nodes.
public static class SyntaxMemberAccessExpressionFactory
MemberAccessExpressionSyntax Create(string memberTypeName, string memberName)Summary: Creates a simple member access expression (e.g.,
memberName.memberTypeName).Parameters:
memberTypeName- The name of the member being accessed.
memberName- The name of the object containing the member.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.MemberAccessExpressionSyntaxnode.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.NameEqualsSyntax nodes.
public static class SyntaxNameEqualsFactory
NameEqualsSyntax Create(string value)Summary: Creates a name-equals syntax node (used in attribute named arguments and object initializers).
Parameters:
value- The identifier name for the name-equals clause.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.NameEqualsSyntaxnode.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.ObjectCreationExpressionSyntax nodes.
public static class SyntaxObjectCreationExpressionFactory
ObjectCreationExpressionSyntax Create(string identifierName)Summary: Creates an object creation expression for a type.
Parameters:
identifierName- The name of the type to instantiate.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.ObjectCreationExpressionSyntaxnode.
ObjectCreationExpressionSyntax Create(string namespaceName, string identifierName)Summary: Creates an object creation expression for a type.
Parameters:
identifierName- The name of the type to instantiate.Returns: An
Microsoft.CodeAnalysis.CSharp.Syntax.ObjectCreationExpressionSyntaxnode.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax nodes.
public static class SyntaxParameterFactory
ParameterSyntax Create(string parameterTypeName, string parameterName, string genericListTypeName = null)Summary: Creates a parameter with an optional generic list type.
Parameters:
parameterTypeName- The type name of the parameter.
parameterName- The name of the parameter.
genericListTypeName- The generic list type name (e.g., "List", "IEnumerable").Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntaxnode.
ParameterSyntax CreateWithAttribute(string attributeTypeName, string parameterTypeName, string parameterName)Summary: Creates a parameter with an attribute.
Parameters:
attributeTypeName- The type name of the attribute to apply.
parameterTypeName- The type name of the parameter.
parameterName- The name of the parameter.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntaxnode with an attribute.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax nodes.
public static class SyntaxParameterListFactory
ParameterListSyntax CreateWithOneItem(string parameterTypeName, string parameterName, string genericListTypeName = null)Summary: Creates a parameter list with a single parameter.
Parameters:
parameterTypeName- The type name of the parameter.
parameterName- The name of the parameter.
genericListTypeName- The generic list type name (e.g., "List", "IEnumerable").Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntaxcontaining one parameter.
ParameterListSyntax CreateWithOneParameterItem(ParameterSyntax parameter)Summary: Creates a parameter list with one parameter.
Parameters:
parameter- The parameter to include.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntaxcontaining one parameter.
ParameterListSyntax CreateWithThreeParameterItems(ParameterSyntax parameter1, ParameterSyntax parameter2, ParameterSyntax parameter3)Summary: Creates a parameter list with three parameters.
Parameters:
parameter1- The first parameter to include.
parameter2- The second parameter to include.
parameter3- The third parameter to include.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntaxcontaining three parameters.
ParameterListSyntax CreateWithTwoParameterItems(ParameterSyntax parameter1, ParameterSyntax parameter2)Summary: Creates a parameter list with two parameters.
Parameters:
parameter1- The first parameter to include.
parameter2- The second parameter to include.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntaxcontaining two parameters.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.SimpleBaseTypeSyntax nodes.
public static class SyntaxSimpleBaseTypeFactory
SimpleBaseTypeSyntax Create(string typeName)Summary: Creates a simple base type from a type name.
Parameters:
typeName- The name of the base type.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.SimpleBaseTypeSyntaxnode.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.ThrowStatementSyntax nodes.
public static class SyntaxThrowStatementFactory
ThrowStatementSyntax CreateArgumentNullException(string parameterName, bool includeSystem = True)Summary: Creates a throw statement for
System.ArgumentNullExceptionwith a parameter name.Parameters:
parameterName- The name of the null parameter.
includeSystem- If true, includes the System namespace prefix.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ThrowStatementSyntaxnode throwing ArgumentNullException.
ThrowStatementSyntax CreateNotImplementedException(bool includeSystem = True)Summary: Creates a throw statement for
System.NotImplementedException.Parameters:
includeSystem- If true, includes the System namespace prefix.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.ThrowStatementSyntaxnode throwing NotImplementedException.
SyntaxTokenFactory - for base methods.
public static class SyntaxTokenFactory
SyntaxToken AbstractKeyword(bool withTrailingSpace = True)
SyntaxToken AsyncKeyword(bool withTrailingSpace = True)
SyntaxToken ByteKeyword(bool withTrailingSpace = True)
SyntaxToken CarriageReturnLineFeed()
SyntaxToken Colon(bool withTrailingSpace = False)
SyntaxToken Comma(bool withTrailingSpace = True)
SyntaxToken DefaultKeyword(bool withTrailingSpace = True)
SyntaxToken DoubleKeyword(bool withTrailingSpace = True)
SyntaxToken Equals(bool withTrailingSpace = True)
SyntaxToken EqualsGreaterThan(bool withTrailingSpace = True)
SyntaxToken ImplicitKeyword(bool withTrailingSpace = True)
SyntaxToken IntKeyword(bool withTrailingSpace = True)
SyntaxToken InternalKeyword(bool withTrailingSpace = True)
SyntaxToken LineFeed()
SyntaxToken NewKeyword(bool withTrailingSpace = True)
SyntaxToken ObjectKeyword(bool withTrailingSpace = True)
SyntaxToken OperatorKeyword(bool withTrailingSpace = True)
SyntaxToken OverrideKeyword(bool withTrailingSpace = True)
SyntaxToken PartialKeyword(bool withTrailingSpace = True)
SyntaxToken PrivateKeyword(bool withTrailingSpace = True)
SyntaxToken ProtectedKeyword(bool withTrailingSpace = True)
SyntaxToken PublicKeyword(bool withTrailingSpace = True)
SyntaxToken ReadOnlyKeyword(bool withTrailingSpace = True)
SyntaxToken Semicolon(bool withTrailingSpace = False)
SyntaxToken StaticKeyword(bool withTrailingSpace = True)
SyntaxToken StringKeyword(bool withTrailingSpace = True)
SyntaxToken Token(SyntaxKind syntaxKind)Summary: Creates a syntax token of the specified kind.
Parameters:
syntaxKind- The kind of token to create.Returns: A
Microsoft.CodeAnalysis.SyntaxToken.
SyntaxToken TokenWithTrailing(SyntaxKind syntaxKind, SyntaxTrivia syntaxTrivia)Summary: Creates a syntax token with trailing trivia.
Parameters:
syntaxKind- The kind of token to create.
syntaxTrivia- The trailing trivia to add.Returns: A
Microsoft.CodeAnalysis.SyntaxTokenwith the specified trailing trivia.
SyntaxToken TokenWithTrailingSpace(SyntaxKind syntaxKind)Summary: Creates a syntax token with a trailing space.
Parameters:
syntaxKind- The kind of token to create.Returns: A
Microsoft.CodeAnalysis.SyntaxTokenwith trailing space trivia.
SyntaxToken VoidKeyword(bool withTrailingSpace = True)
Factory for creating Microsoft.CodeAnalysis.SyntaxTokenList modifier lists.
public static class SyntaxTokenListFactory
SyntaxTokenList InternalStaticKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)
SyntaxTokenList PrivateAsyncKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)
SyntaxTokenList PrivateReadonlyKeyword(bool withTrailingSpace = True)
SyntaxTokenList ProtectedReadOnlyKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)
SyntaxTokenList ProtectedStaticKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)
SyntaxTokenList PublicAsyncKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)
SyntaxTokenList PublicKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)Summary: Creates a token list with the public keyword.
Parameters:
withLeadingLineFeed- If true, adds a leading line feed.
withTrailingSpace- If true, adds a trailing space.Returns: A
Microsoft.CodeAnalysis.SyntaxTokenListcontaining the public modifier.
SyntaxTokenList PublicOverrideKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)
SyntaxTokenList PublicStaticKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.TypeArgumentListSyntax nodes.
public static class SyntaxTypeArgumentListFactory
TypeArgumentListSyntax CreateWithOneItem(string typeName)Summary: Creates a type argument list with a single type.
Parameters:
typeName- The name of the type argument.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.TypeArgumentListSyntaxcontaining one type.
TypeArgumentListSyntax CreateWithTwoItems(string typeName1, string typeName2)Summary: Creates a type argument list with two types.
Parameters:
typeName1- The name of the first type argument.
typeName2- The name of the second type argument.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.TypeArgumentListSyntaxcontaining two types.
Factory for creating Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax nodes.
public static class SyntaxVariableDeclarationFactory
VariableDeclarationSyntax Create(string identifierTypeName, string identifierName)Summary: Creates a variable declaration.
Parameters:
identifierTypeName- The type name of the variable.
identifierName- The name of the variable.Returns: A
Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntaxnode.