Skip to content

Latest commit

 

History

History
721 lines (594 loc) · 16.4 KB

Atc.CodeAnalysis.CSharp.SyntaxFactories.md

File metadata and controls

721 lines (594 loc) · 16.4 KB

Atc.CodeAnalysis.CSharp.SyntaxFactories


SyntaxAccessorDeclarationFactory

public static class SyntaxAccessorDeclarationFactory

Static Methods

Get

AccessorDeclarationSyntax Get(bool withSemicolon = True)

Set

AccessorDeclarationSyntax Set(bool withSemicolon = True)

SyntaxArgumentFactory

public static class SyntaxArgumentFactory

Static Methods

Create

ArgumentSyntax Create(string argumentName)

SyntaxArgumentListFactory

public static class SyntaxArgumentListFactory

Static Methods

CreateWithOneArgumentItem

ArgumentListSyntax CreateWithOneArgumentItem(ArgumentSyntax argument)

CreateWithOneExpressionItem

ArgumentListSyntax CreateWithOneExpressionItem(ExpressionSyntax argumentExpression1)

CreateWithOneItem

ArgumentListSyntax CreateWithOneItem(string argumentName)

CreateWithThreeArgumentItems

ArgumentListSyntax CreateWithThreeArgumentItems(ArgumentSyntax argument1, ArgumentSyntax argument2, ArgumentSyntax argument3)

CreateWithThreeExpressionItems

ArgumentListSyntax CreateWithThreeExpressionItems(ExpressionSyntax argumentExpression1, ExpressionSyntax argumentExpression2, ExpressionSyntax argumentExpression3)

CreateWithTwoArgumentItems

ArgumentListSyntax CreateWithTwoArgumentItems(ArgumentSyntax argument1, ArgumentSyntax argument2)

CreateWithTwoExpressionItems

ArgumentListSyntax CreateWithTwoExpressionItems(ExpressionSyntax argumentExpression1, ExpressionSyntax argumentExpression2)

CreateWithTwoItems

ArgumentListSyntax CreateWithTwoItems(string argumentName1, string argumentName2)

SyntaxAssignmentExpressionFactory

public static class SyntaxAssignmentExpressionFactory

Static Methods

CreateSimple

AssignmentExpressionSyntax CreateSimple(string toIdentifierName, string fromIdentifierName)

SyntaxAttributeArgumentFactory

public static class SyntaxAttributeArgumentFactory

Static Methods

Create

AttributeArgumentSyntax Create(string attributeValue)

Create

AttributeArgumentSyntax Create(int attributeValue)

Create

AttributeArgumentSyntax Create(object attributeValue)

CreateWithNameEquals

AttributeArgumentSyntax CreateWithNameEquals(string attributeName, string attributeValue)

CreateWithNameEquals

AttributeArgumentSyntax CreateWithNameEquals(string attributeName, int attributeValue)

SyntaxAttributeArgumentListFactory

public static class SyntaxAttributeArgumentListFactory

Static Methods

CreateWithOneItemWithNameEquals

AttributeArgumentListSyntax CreateWithOneItemWithNameEquals(string attributeName, string attributeValue)

CreateWithOneItemWithNameEquals

AttributeArgumentListSyntax CreateWithOneItemWithNameEquals(string attributeName, int attributeValue)

SyntaxAttributeFactory

Syntax Attribute Factory.

Remarks: List of ValidationAttribute's: https://referencesource.microsoft.com/#System.ComponentModel.DataAnnotations/DataAnnotations/ValidationAttribute.cs.

public static class SyntaxAttributeFactory

Static Methods

Create

AttributeSyntax Create(string attributeName)

CreateFromValidationAttribute

AttributeSyntax CreateFromValidationAttribute(ValidationAttribute validationAttribute)

CreateWithOneItemWithOneArgument

AttributeSyntax CreateWithOneItemWithOneArgument(string attributeName, string argumentValue)

CreateWithOneItemWithOneArgument

AttributeSyntax CreateWithOneItemWithOneArgument(string attributeName, int argumentValue)

CreateWithOneItemWithTwoArgument

AttributeSyntax CreateWithOneItemWithTwoArgument(string attributeName, object argumentValue1, object argumentValue2)

RemoveSuffix

string RemoveSuffix(string attributeName)

SyntaxAttributeListFactory

public static class SyntaxAttributeListFactory

Static Methods

Create

AttributeListSyntax Create(string attributeName)

Create

AttributeListSyntax Create(string attributeName, AttributeArgumentListSyntax attributeArgumentList)

CreateWithOneItemWithOneArgument

AttributeListSyntax CreateWithOneItemWithOneArgument(string attributeName, string argumentValue)

CreateWithOneItemWithOneArgumentWithNameEquals

AttributeListSyntax CreateWithOneItemWithOneArgumentWithNameEquals(string attributeName, string argumentName, string argumentValue)

SyntaxBaseListFactory

public static class SyntaxBaseListFactory

Static Methods

CreateOneSimpleBaseType

BaseListSyntax CreateOneSimpleBaseType(string typeName)

CreateTwoSimpleBaseTypes

BaseListSyntax CreateTwoSimpleBaseTypes(string typeName1, string typeName2)

SyntaxClassDeclarationFactory

public static class SyntaxClassDeclarationFactory

Static Methods

Create

ClassDeclarationSyntax Create(string classTypeName)

CreateAsInternalStatic

ClassDeclarationSyntax CreateAsInternalStatic(string classTypeName)

CreateAsPublicPartial

ClassDeclarationSyntax CreateAsPublicPartial(string classTypeName)

CreateAsPublicStatic

ClassDeclarationSyntax CreateAsPublicStatic(string classTypeName)

CreateWithInheritClassAndInterface

ClassDeclarationSyntax CreateWithInheritClassAndInterface(string classTypeName, string inheritClassTypeName, string interfaceTypeName)

CreateWithInheritClassType

ClassDeclarationSyntax CreateWithInheritClassType(string classTypeName, string inheritClassTypeName)

CreateWithInheritClassTypeAndSuppressMessageAttributeByCodeAnalysisCheckId

ClassDeclarationSyntax CreateWithInheritClassTypeAndSuppressMessageAttributeByCodeAnalysisCheckId(string classTypeName, string inheritClassTypeName, int checkId, string justification = )

CreateWithInheritClassTypeAndSuppressMessageAttributeByStyleCopCheckId

ClassDeclarationSyntax CreateWithInheritClassTypeAndSuppressMessageAttributeByStyleCopCheckId(string classTypeName, string inheritClassTypeName, int checkId, string justification = )

CreateWithInterface

ClassDeclarationSyntax CreateWithInterface(string classTypeName, string interfaceTypeName)

CreateWithSuppressMessageAttribute

ClassDeclarationSyntax CreateWithSuppressMessageAttribute(string classTypeName, SuppressMessageAttribute suppressMessage)

CreateWithSuppressMessageAttributeByCodeAnalysisCheckId

ClassDeclarationSyntax CreateWithSuppressMessageAttributeByCodeAnalysisCheckId(string classTypeName, int checkId, string justification = )

CreateWithSuppressMessageAttributeByStyleCopCheckId

ClassDeclarationSyntax CreateWithSuppressMessageAttributeByStyleCopCheckId(string classTypeName, int checkId, string justification = )

SyntaxIfStatementFactory

public static class SyntaxIfStatementFactory

Static Methods

CreateParameterArgumentNullCheck

StatementSyntax CreateParameterArgumentNullCheck(string parameterName, bool includeSystem = True)

SyntaxInterfaceDeclarationFactory

public static class SyntaxInterfaceDeclarationFactory

Static Methods

Create

InterfaceDeclarationSyntax Create(string interfaceTypeName)

SyntaxInterpolatedFactory

public static class SyntaxInterpolatedFactory

Static Methods

CreateNameOf

InterpolatedStringContentSyntax CreateNameOf(string argumentName)

StringText

InterpolatedStringContentSyntax StringText(string value)

StringTextColon

InterpolatedStringContentSyntax StringTextColon()

StringTextColonAndParenthesesStart

InterpolatedStringContentSyntax StringTextColonAndParenthesesStart()

StringTextComma

InterpolatedStringContentSyntax StringTextComma()

StringTextDotCountColon

InterpolatedStringContentSyntax StringTextDotCountColon()

StringTextParenthesesEnd

InterpolatedStringContentSyntax StringTextParenthesesEnd()

SyntaxLiteralExpressionFactory

public static class SyntaxLiteralExpressionFactory

Static Methods

Create

LiteralExpressionSyntax Create(string value, SyntaxKind syntaxKind = StringLiteralExpression)

Create

LiteralExpressionSyntax Create(int value)

SyntaxMemberAccessExpressionFactory

public static class SyntaxMemberAccessExpressionFactory

Static Methods

Create

MemberAccessExpressionSyntax Create(string memberTypeName, string memberName)

SyntaxNameEqualsFactory

public static class SyntaxNameEqualsFactory

Static Methods

Create

NameEqualsSyntax Create(string value)

SyntaxObjectCreationExpressionFactory

public static class SyntaxObjectCreationExpressionFactory

Static Methods

Create

ObjectCreationExpressionSyntax Create(string identifierName)

Create

ObjectCreationExpressionSyntax Create(string namespaceName, string identifierName)

SyntaxParameterFactory

public static class SyntaxParameterFactory

Static Methods

Create

ParameterSyntax Create(string parameterTypeName, string parameterName, string genericListTypeName = null)

CreateWithAttribute

ParameterSyntax CreateWithAttribute(string attributeTypeName, string parameterTypeName, string parameterName)

SyntaxParameterListFactory

public static class SyntaxParameterListFactory

Static Methods

CreateWithOneItem

ParameterListSyntax CreateWithOneItem(string parameterTypeName, string parameterName, string genericListTypeName = null)

CreateWithOneParameterItem

ParameterListSyntax CreateWithOneParameterItem(ParameterSyntax parameter)

CreateWithThreeParameterItems

ParameterListSyntax CreateWithThreeParameterItems(ParameterSyntax parameter1, ParameterSyntax parameter2, ParameterSyntax parameter3)

CreateWithTwoParameterItems

ParameterListSyntax CreateWithTwoParameterItems(ParameterSyntax parameter1, ParameterSyntax parameter2)

SyntaxSimpleBaseTypeFactory

public static class SyntaxSimpleBaseTypeFactory

Static Methods

Create

SimpleBaseTypeSyntax Create(string typeName)

SyntaxThrowStatementFactory

public static class SyntaxThrowStatementFactory

Static Methods

CreateArgumentNullException

ThrowStatementSyntax CreateArgumentNullException(string parameterName, bool includeSystem = True)

CreateNotImplementedException

ThrowStatementSyntax CreateNotImplementedException(bool includeSystem = True)

SyntaxTokenFactory

SyntaxTokenFactory - for base methods.

public static class SyntaxTokenFactory

Static Methods

AbstractKeyword

SyntaxToken AbstractKeyword(bool withTrailingSpace = True)

AsyncKeyword

SyntaxToken AsyncKeyword(bool withTrailingSpace = True)

ByteKeyword

SyntaxToken ByteKeyword(bool withTrailingSpace = True)

CarriageReturnLineFeed

SyntaxToken CarriageReturnLineFeed()

Colon

SyntaxToken Colon(bool withTrailingSpace = False)

Comma

SyntaxToken Comma(bool withTrailingSpace = True)

DefaultKeyword

SyntaxToken DefaultKeyword(bool withTrailingSpace = True)

DoubleKeyword

SyntaxToken DoubleKeyword(bool withTrailingSpace = True)

Equals

SyntaxToken Equals(bool withTrailingSpace = True)

EqualsGreaterThan

SyntaxToken EqualsGreaterThan(bool withTrailingSpace = True)

ImplicitKeyword

SyntaxToken ImplicitKeyword(bool withTrailingSpace = True)

IntKeyword

SyntaxToken IntKeyword(bool withTrailingSpace = True)

InternalKeyword

SyntaxToken InternalKeyword(bool withTrailingSpace = True)

LineFeed

SyntaxToken LineFeed()

NewKeyword

SyntaxToken NewKeyword(bool withTrailingSpace = True)

ObjectKeyword

SyntaxToken ObjectKeyword(bool withTrailingSpace = True)

OperatorKeyword

SyntaxToken OperatorKeyword(bool withTrailingSpace = True)

OverrideKeyword

SyntaxToken OverrideKeyword(bool withTrailingSpace = True)

PartialKeyword

SyntaxToken PartialKeyword(bool withTrailingSpace = True)

PrivateKeyword

SyntaxToken PrivateKeyword(bool withTrailingSpace = True)

ProtectedKeyword

SyntaxToken ProtectedKeyword(bool withTrailingSpace = True)

PublicKeyword

SyntaxToken PublicKeyword(bool withTrailingSpace = True)

ReadOnlyKeyword

SyntaxToken ReadOnlyKeyword(bool withTrailingSpace = True)

Semicolon

SyntaxToken Semicolon(bool withTrailingSpace = False)

StaticKeyword

SyntaxToken StaticKeyword(bool withTrailingSpace = True)

StringKeyword

SyntaxToken StringKeyword(bool withTrailingSpace = True)

Token

SyntaxToken Token(SyntaxKind syntaxKind)

TokenWithTrailing

SyntaxToken TokenWithTrailing(SyntaxKind syntaxKind, SyntaxTrivia syntaxTrivia)

TokenWithTrailingSpace

SyntaxToken TokenWithTrailingSpace(SyntaxKind syntaxKind)

VoidKeyword

SyntaxToken VoidKeyword(bool withTrailingSpace = True)

SyntaxTokenListFactory

public static class SyntaxTokenListFactory

Static Methods

InternalStaticKeyword

SyntaxTokenList InternalStaticKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)

PrivateAsyncKeyword

SyntaxTokenList PrivateAsyncKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)

PrivateReadonlyKeyword

SyntaxTokenList PrivateReadonlyKeyword(bool withTrailingSpace = True)

ProtectedReadOnlyKeyword

SyntaxTokenList ProtectedReadOnlyKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)

ProtectedStaticKeyword

SyntaxTokenList ProtectedStaticKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)

PublicAsyncKeyword

SyntaxTokenList PublicAsyncKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)

PublicKeyword

SyntaxTokenList PublicKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)

PublicOverrideKeyword

SyntaxTokenList PublicOverrideKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)

PublicStaticKeyword

SyntaxTokenList PublicStaticKeyword(bool withLeadingLineFeed = False, bool withTrailingSpace = True)

SyntaxTypeArgumentListFactory

public static class SyntaxTypeArgumentListFactory

Static Methods

CreateWithOneItem

TypeArgumentListSyntax CreateWithOneItem(string typeName)

CreateWithTwoItems

TypeArgumentListSyntax CreateWithTwoItems(string typeName1, string typeName2)

SyntaxVariableDeclarationFactory

public static class SyntaxVariableDeclarationFactory

Static Methods

Create

VariableDeclarationSyntax Create(string identifierTypeName, string identifierName)

Generated by MarkdownCodeDoc version 1.2