Skip to content

Commit 93da7ee

Browse files
authored
Add parameter info (dotnet#5183)
1 parent ef2b138 commit 93da7ee

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

xml/System.ComponentModel/LocalizableAttribute.xml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</Attribute>
4040
</Attributes>
4141
<Docs>
42-
<summary>Specifies whether a property should be localized. This class cannot be inherited.</summary>
42+
<summary>Specifies whether a property or parameter should be localized. This class cannot be inherited.</summary>
4343
<remarks>
4444
<format type="text/markdown"><![CDATA[
4545
@@ -49,14 +49,19 @@
4949
By default, members that have no localizable attribute or are marked with the <xref:System.ComponentModel.LocalizableAttribute> set to `false` will have their property values persisted to code, if the data type allows. Otherwise, if the main component is set to `Localizable`, all properties will be persisted to the resource file. The default is `false`.
5050
5151
> [!NOTE]
52-
> When you mark a property with the <xref:System.ComponentModel.LocalizableAttribute> set to `true`, the value of this attribute is set to the constant member <xref:System.ComponentModel.LocalizableAttribute.Yes>. For a property marked with the <xref:System.ComponentModel.LocalizableAttribute> set to `false`, the value is <xref:System.ComponentModel.LocalizableAttribute.No>. Therefore, when you want to check the value of this attribute in your code, you must specify the attribute as <xref:System.ComponentModel.LocalizableAttribute.Yes?displayProperty=nameWithType> or <xref:System.ComponentModel.LocalizableAttribute.No?displayProperty=nameWithType>.
52+
> When you mark a property with the <xref:System.ComponentModel.LocalizableAttribute> set to `true`, the value of this attribute is set to the constant member <xref:System.ComponentModel.LocalizableAttribute.Yes>. For a property marked with the <xref:System.ComponentModel.LocalizableAttribute> set to `false`, the value is <xref:System.ComponentModel.LocalizableAttribute.No>. Therefore, when you want to check the value of this attribute in your code, you must specify the attribute as <xref:System.ComponentModel.LocalizableAttribute.Yes?displayProperty=nameWithType> or <xref:System.ComponentModel.LocalizableAttribute.No?displayProperty=nameWithType>.
5353
54-
For more information, see [Attributes](/dotnet/standard/attributes/).
55-
56-
57-
58-
## Examples
59-
The following example marks a property as needing to be localized.
54+
For more information, see [Attributes](/dotnet/standard/attributes/).
55+
56+
## Examples
57+
58+
The following example marks the `message` parameter as needing to be localized.
59+
60+
```csharp
61+
public static void ShowMessage([Localizable(true)] string message)
62+
```
63+
64+
The following example marks a property as needing to be localized.
6065
6166
[!code-cpp[classic localizableattribute example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic LocalizableAttribute Example/CPP/source.cpp#1)]
6267
[!code-csharp[classic localizableattribute example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic LocalizableAttribute Example/CS/source.cs#1)]

0 commit comments

Comments
 (0)