Skip to content

Commit f08803e

Browse files
committed
fix build warning
1 parent 5f2c872 commit f08803e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

snippets/csharp/System.ComponentModel/DefaultValueAttribute/Overview/source.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44

55
public class Form1 : Form
66
{
7+
// <Snippet1>
78
[DefaultValue(false)]
89
public bool MyProperty { get; set; }
910
// </Snippet1>
11+
1012
protected void Method()
1113
{
1214
// <Snippet2>
1315
// Gets the attributes for the property.
1416
AttributeCollection attributes =
1517
TypeDescriptor.GetProperties(this)["MyProperty"].Attributes;
1618

17-
/* Prints the default value by retrieving the DefaultValueAttribute
19+
/* Prints the default value by retrieving the DefaultValueAttribute
1820
* from the AttributeCollection. */
1921
DefaultValueAttribute myAttribute =
2022
(DefaultValueAttribute)attributes[typeof(DefaultValueAttribute)];

xml/System.ComponentModel/DefaultValueAttribute.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,13 @@
6565
<format type="text/markdown"><![CDATA[
6666
6767
## Remarks
68-
You can create a <xref:System.ComponentModel.DefaultValueAttribute> with any value. A member's default value is typically its initial value. A visual designer can use the default value to reset the member's value. Code generators can use the default values also to determine whether code should be generated for the member.
6968
70-
> [!NOTE]
71-
> A <xref:System.ComponentModel.DefaultValueAttribute> will not cause a member to be automatically initialized with the attribute's value. You must set the initial value in your code.
72-
73-
For more information, see [Attributes](/dotnet/standard/attributes/).
69+
You can create a <xref:System.ComponentModel.DefaultValueAttribute> with any value. A member's default value is typically its initial value. A visual designer can use the default value to reset the member's value. Code generators can use the default values also to determine whether code should be generated for the member.
7470
71+
> [!NOTE]
72+
> A <xref:System.ComponentModel.DefaultValueAttribute> will not cause a member to be automatically initialized with the attribute's value. You must set the initial value in your code.
7573
74+
For more information, see [Attributes](/dotnet/standard/attributes/).
7675
7776
## Examples
7877
The following example sets the default value of `MyProperty` to `false`.

0 commit comments

Comments
 (0)