From 35d882309d0f6397c1509eb51e510c110da1c24d Mon Sep 17 00:00:00 2001 From: RaymondY Date: Thu, 3 Nov 2022 22:13:15 +0800 Subject: [PATCH] correct code snippets (#77581) Let them be valid C# code. Uniform code style as well. --- docs/design/features/source-generator-pinvokes.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/design/features/source-generator-pinvokes.md b/docs/design/features/source-generator-pinvokes.md index f3608e09252..84aa4953ee4 100644 --- a/docs/design/features/source-generator-pinvokes.md +++ b/docs/design/features/source-generator-pinvokes.md @@ -49,7 +49,7 @@ The P/Invoke algorithm is presented below using a simple example. ``` CSharp /* A */ [DllImportAttribute("Kernel32.dll")] -/* B */ extern static bool QueryPerformanceCounter(out long lpPerformanceCount); +/* B */ static extern bool QueryPerformanceCounter(out long lpPerformanceCount); ... long count; /* C */ QueryPerformanceCounter(out count); @@ -81,7 +81,7 @@ An example of how the previous P/Invoke snippet could be transformed is below. T ``` CSharp /* A */ [LibraryImportAttribute("Kernel32.dll")] -/* B */ partial static bool QueryPerformanceCounter(out long lpPerformanceCount); +/* B */ static partial bool QueryPerformanceCounter(out long lpPerformanceCount); ... long count; /* C*/ QueryPerformanceCounter(out count); @@ -94,7 +94,7 @@ During the source generation process the metadata in the `LibraryImportAttribute `Stubs.g.cs` (Source Generator code) ``` CSharp -/* D */ partial static bool QueryPerformanceCounter(out long lpPerformanceCount) +/* D */ static partial bool QueryPerformanceCounter(out long lpPerformanceCount) { unsafe {