Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion documentation/SA1642.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,26 @@ For example:
/// <summary>
/// Initializes static members of the <see cref="Customer"/> class.
/// </summary>
public static Customer()
static Customer()
{
}
```

The standard text may also use `<see langword="static"/>`, `<see langword="class"/>`, or
`<see langword="struct"/>` for the corresponding keyword. Record declarations may use
`<see langword="record"/>` in place of their standard `class` or `struct` type kind. For example:

```csharp
/// <summary>
/// Initializes <see langword="static"/> members of the <see cref="Customer"/> class.
/// </summary>
static Customer()
{
}
```

This allowance does not apply to words used as prose, such as `new` in the instance-constructor standard text.

For compatibility with StyleCop Classic, private instance constructors are allowed to use the summary text "Prevents a
default instance of the {class name} class from being created." New code is encouraged to use the form above instead for
all instance constructors.
Expand Down
17 changes: 16 additions & 1 deletion documentation/cs-cz/SA1642.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,26 @@ Například:
/// <summary>
/// Initializes static members of the <see cref="Customer"/> class.
/// </summary>
public static Customer()
static Customer()
{
}
```

Standardní text může také použít značku `<see langword="static"/>`, `<see langword="class"/>` nebo
`<see langword="struct"/>` pro odpovídající klíčové slovo. Deklarace záznamů mohou místo standardního druhu
`class` nebo `struct` použít značku `<see langword="record"/>`. Například:

```csharp
/// <summary>
/// Initializes <see langword="static"/> members of the <see cref="Customer"/> class.
/// </summary>
static Customer()
{
}
```

Toto pravidlo se nevztahuje na slova použitá jako běžný text, například `new` ve standardním textu konstruktoru instance.

Kvůli kompatibilitě se StyleCop Classic smějí privátní konstruktory instancí používat text souhrnu „Prevents a default
instance of the {class name} class from being created.“. Pro nový kód se však doporučuje používat u všech konstruktorů
instancí výše uvedenou formulaci.
Expand Down
17 changes: 16 additions & 1 deletion documentation/ru-ru/SA1642.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,26 @@ public Customer()
/// <summary>
/// Initializes static members of the <see cref="Customer"/> class.
/// </summary>
public static Customer()
static Customer()
{
}
```

Стандартный текст также может использовать `<see langword="static"/>`, `<see langword="class"/>` или
`<see langword="struct"/>` для соответствующего ключевого слова. В объявлениях записей можно использовать
`<see langword="record"/>` вместо стандартного вида `class` или `struct`. Например:

```csharp
/// <summary>
/// Initializes <see langword="static"/> members of the <see cref="Customer"/> class.
/// </summary>
static Customer()
{
}
```

Это правило не распространяется на слова, используемые как обычный текст, например `new` в описании конструктора экземпляра.

Для совместимости со StyleCop Classic закрытым конструкторам экземпляра разрешено использовать описание
«Prevents a default instance of the {class name} class from being created.» («Предотвращает создание экземпляра класса {имя класса} по умолчанию.»).
В новом коде для всех конструкторов экземпляра рекомендуется использовать приведённую выше форму.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<data name="StartingTextSetsWhether" xml:space="preserve">
<value>Nastaví hodnotu udávající, zda</value>
</data>
<data name="StaticConstructorKeywordText" xml:space="preserve">
<value>statické</value>
</data>
<data name="StaticConstructorStandardTextFirstPart" xml:space="preserve">
<value>Inicializuje statické členy {0} </value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<data name="StartingTextSetsWhether" xml:space="preserve">
<value>Setzt einen Wert, der angibt, ob</value>
</data>
<data name="StaticConstructorKeywordText" xml:space="preserve">
<value>statische</value>
</data>
<data name="StaticConstructorStandardTextFirstPart" xml:space="preserve">
<value>Initialisiert statische Member der </value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<data name="StartingTextSetsWhether" xml:space="preserve">
<value>Sets a value indicating whether</value>
</data>
<data name="StaticConstructorKeywordText" xml:space="preserve">
<value>static</value>
</data>
<data name="StaticConstructorStandardTextFirstPart" xml:space="preserve">
<value>Initialises static members of the </value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<data name="StartingTextSetsWhether" xml:space="preserve">
<value>Establece un valor que indica si</value>
</data>
<data name="StaticConstructorKeywordText" xml:space="preserve">
<value>estáticos</value>
</data>
<data name="StaticConstructorStandardTextFirstPart" xml:space="preserve">
<value>Inicializa miembros estáticos de la {0} </value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<data name="StartingTextSetsWhether" xml:space="preserve">
<value>Définit une valeur indiquant si</value>
</data>
<data name="StaticConstructorKeywordText" xml:space="preserve">
<value>statiques</value>
</data>
<data name="StaticConstructorStandardTextFirstPart" xml:space="preserve">
<value>Initialise les membres statiques de la {0} </value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@
<data name="StartingTextReturnsWhether" xml:space="preserve">
<value>Retourneert een waarde welke aangeeft</value>
</data>
<data name="StaticConstructorKeywordText" xml:space="preserve">
<value>statische</value>
</data>
<data name="StaticConstructorStandardTextFirstPart" xml:space="preserve">
<value>Initialiseert statische leden van de </value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<data name="StartingTextSetsWhether" xml:space="preserve">
<value>Ustawia wartość wskazującą czy</value>
</data>
<data name="StaticConstructorKeywordText" xml:space="preserve">
<value>statyczne</value>
</data>
<data name="StaticConstructorStandardTextFirstPart" xml:space="preserve">
<value>Inicjalizuje statyczne składowe {0} </value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<data name="StartingTextSetsWhether" xml:space="preserve">
<value>Define um valor que indica se</value>
</data>
<data name="StaticConstructorKeywordText" xml:space="preserve">
<value>estáticos</value>
</data>
<data name="StaticConstructorStandardTextFirstPart" xml:space="preserve">
<value>Inicia os membros estáticos da {0} </value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,9 @@
<data name="StartingTextSetsWhether" xml:space="preserve">
<value>Sets a value indicating whether</value>
</data>
<data name="StaticConstructorKeywordText" xml:space="preserve">
<value>static</value>
</data>
<data name="StaticConstructorStandardTextFirstPart" xml:space="preserve">
<value>Initializes static members of the </value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@
<data name="StartingTextSetsWhether" xml:space="preserve">
<value>Задает значение, показывающее,</value>
</data>
<data name="StaticConstructorKeywordText" xml:space="preserve">
<value>статические</value>
</data>
<data name="StaticConstructorStandardTextFirstPart" xml:space="preserve">
<value>Инициализирует статические члены {0} </value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ private static void HandleConstructorDeclaration(SyntaxNodeAnalysisContext conte
context,
string.Format(resourceManager.GetString(nameof(DocumentationResources.StaticConstructorStandardTextFirstPart), culture), typeKindText),
string.Format(resourceManager.GetString(nameof(DocumentationResources.StaticConstructorStandardTextSecondPart), culture), typeKindText),
Descriptor);
Descriptor,
allowLangwordStandardText: true,
documentationCulture: culture,
typeKindText: typeKindText);
}
else if (constructorDeclarationSyntax.Modifiers.Any(SyntaxKind.PrivateKeyword))
{
Expand All @@ -171,7 +174,9 @@ private static void HandleConstructorDeclaration(SyntaxNodeAnalysisContext conte
string.Format(
resourceManager.GetString(nameof(DocumentationResources.PrivateConstructorStandardTextSecondPart), culture),
typeKindText),
null);
null,
allowLangwordStandardText: true,
typeKindText: typeKindText);

if (privateConstructorMatch == MatchResult.FoundMatch)
{
Expand All @@ -187,7 +192,9 @@ private static void HandleConstructorDeclaration(SyntaxNodeAnalysisContext conte
string.Format(
resourceManager.GetString(nameof(DocumentationResources.NonPrivateConstructorStandardTextSecondPart), culture),
typeKindText),
Descriptor);
Descriptor,
allowLangwordStandardText: true,
typeKindText: typeKindText);
}
else
{
Expand All @@ -199,7 +206,9 @@ private static void HandleConstructorDeclaration(SyntaxNodeAnalysisContext conte
string.Format(
resourceManager.GetString(nameof(DocumentationResources.NonPrivateConstructorStandardTextSecondPart), culture),
typeKindText),
Descriptor);
Descriptor,
allowLangwordStandardText: true,
typeKindText: typeKindText);
}
}
}
Expand Down
Loading
Loading