diff --git a/docs/dev/CodingGuidelines/CodingGuidelines.md b/docs/dev/CodingGuidelines/CodingGuidelines.md index 7f3c059eb..12d183e8e 100644 --- a/docs/dev/CodingGuidelines/CodingGuidelines.md +++ b/docs/dev/CodingGuidelines/CodingGuidelines.md @@ -4,6 +4,7 @@ * [Code Style](#code-style) * [Naming of Private and Protected Fields](#naming-of-private-and-protected-fields) + * [Naming of Objects Used in Lock Statements](#naming-of-objects-used-in-lock-statements) * [Naming of Constants](#naming-of-constants) * [Naming of Asynchronous Methods](#naming-of-asynchronous-methods) * [Naming of Value Tuples](#naming-of-value-tuples) @@ -49,6 +50,13 @@ public class MyClass } ``` +### Naming of Objects Used in Lock Statements + +The common well-known naming convention is to call lock objects used in C# `lock` statements as "locker" or "lock". It is recommended to follow the convention in the Acuminator code. +```C# +private readonly object _locker = new(); +``` + ### Naming of Constants Names of constants must begin with a capital letter. @@ -487,4 +495,4 @@ You can find flags indicating the version of analyzed Acumatica DLLs in the `Acu If you need to add a new flag indicating the version of Acumatica DLLs, you should add it to the `PXContext` class. The check for Acumatica version has to be based on the presense of some new API added in the specific version of Acumatica DLLs. We can't rely on standard .Net assembly version attributes because Acumatica assemblies don't have them or they are not updated properly. -*Remember! Only public API can be used to check the version of Acumatica DLLs because Roslyn does not load private and internal metadata of the external dependencies of the analyzed code.* \ No newline at end of file +*Remember! Only public API can be used to check the version of Acumatica DLLs because Roslyn does not load private and internal metadata of the external dependencies of the analyzed code.*