42 references to CastExpression
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
143return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
91var castExpression = CastExpression(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (2)
245=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 338=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
143return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).WithAdditionalAnnotations(Simplifier.Annotation);
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
91var castExpression = CastExpression(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (2)
245=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 338=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
Microsoft.Interop.ComInterfaceGenerator (17)
ComClassGenerator.cs (2)
102CastExpression( 155CastExpression(
ComInterfaceGenerator.cs (8)
721CastExpression( 728CastExpression( 742CastExpression( 749CastExpression( 763CastExpression( 770CastExpression( 807Argument(CastExpression(IdentifierName("nuint"), 881CastExpression(
ComMethodContext.cs (1)
155CastExpression(OriginalDeclaringInterface.Info.Type.Syntax, IdentifierName("this"))),
Marshallers\ManagedHResultExceptionGeneratorResolver.cs (1)
60Argument(CastExpression(TypeSyntaxes.System_IntPtr, IdentifierName(VirtualMethodPointerStubGenerator.NativeThisParameterIdentifier))));
Marshallers\ObjectUnwrapperResolver.cs (1)
48CastExpression(
VirtualMethodPointerStubGenerator.cs (4)
61CastExpression( 108return ParenthesizedExpression(CastExpression( 251CastExpression(PointerType(PredefinedType(Token(SyntaxKind.VoidKeyword))), 252CastExpression(functionPointerType,
Microsoft.Interop.LibraryImportGenerator (1)
LibraryImportGenerator.cs (1)
152CastExpression(TypeSyntaxes.DllImportSearchPath,
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportGenerator.cs (1)
98CastExpression(TypeSyntaxes.DllImportSearchPath,
Microsoft.Interop.SourceGeneration (11)
MarshalAsParser.cs (3)
49CastExpression(TypeSyntaxes.System_Runtime_InteropServices_UnmanagedType, 78CastExpression(TypeSyntaxes.System_Runtime_InteropServices_UnmanagedType, 88AttributeArgument(CastExpression(TypeSyntaxes.System_Runtime_InteropServices_UnmanagedType,
Marshalling\BoolMarshaller.cs (1)
66CastExpression(
Marshalling\CharMarshaller.cs (2)
74CastExpression( 111CastExpression(
Marshalling\ElementsMarshalling.cs (3)
83CastExpression( 537CastExpression(elementMarshaller.NativeType.Syntax, 545CastExpression(TypeSyntaxes.System_IntPtr,
Marshalling\MarshallingGeneratorExtensions.cs (1)
149ValueBoundaryBehavior.CastNativeIdentifier => Argument(CastExpression(generator.AsParameter(context).Type, IdentifierName(nativeIdentifier))),
Marshalling\StatelessMarshallingStrategy.cs (1)
84CastExpression(ptrType.Syntax, convertToUnmanaged));
Roslyn.Diagnostics.CSharp.Analyzers (4)
PreferNullLiteralCodeFixProvider.cs (1)
67var castExpression = SyntaxFactory.CastExpression(type, newSyntax.WithTrailingTrivia(defaultExpression.Keyword.TrailingTrivia));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
91var castExpression = CastExpression(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (2)
245=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 338=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation);