|
38 | 38 | <Docs>
|
39 | 39 | <summary>Specifies the default value for an application settings property.</summary>
|
40 | 40 | <remarks>
|
41 |
| - <format type="text/markdown"><![CDATA[ |
42 |
| - |
43 |
| -## Remarks |
44 |
| - |
| 41 | + <format type="text/markdown"><![CDATA[ |
| 42 | +
|
| 43 | +## Remarks |
| 44 | +
|
45 | 45 | > [!IMPORTANT]
|
46 |
| -> <xref:System.Configuration.DefaultSettingValueAttribute> can only be applied to individual settings properties; it is invalid to apply this attribute to an entire application settings class. |
47 |
| - |
48 |
| - Different settings providers may have different requirements or limitations on the use of the <xref:System.Configuration.DefaultSettingValueAttribute>. For example, the <xref:System.Configuration.LocalFileSettingsProvider> does not require this attribute, and will override any value provided by this attribute if there are any values - default or user-modified - already present in the data store. |
49 |
| - |
50 |
| - <xref:System.Configuration.DefaultSettingValueAttribute> requires that the default value can be represented as a string. As a result, settings using XML serialization cannot have a default value specified by means of this attribute. Some providers may choose to support multiple serialization schemes which can be specified at compile time using the <xref:System.Configuration.SettingsSerializeAsAttribute>. |
51 |
| - |
| 46 | +> <xref:System.Configuration.DefaultSettingValueAttribute> can only be applied to individual settings properties; it is invalid to apply this attribute to an entire application settings class. |
| 47 | +
|
| 48 | + Different settings providers may have different requirements or limitations on the use of the <xref:System.Configuration.DefaultSettingValueAttribute>. For example, the <xref:System.Configuration.LocalFileSettingsProvider> does not require this attribute, and will override any value provided by this attribute if there are any values - default or user-modified - already present in the data store. |
| 49 | +
|
| 50 | + <xref:System.Configuration.DefaultSettingValueAttribute> requires that the default value can be represented as a string. As a result, settings using XML serialization cannot have a default value specified by means of this attribute. Some providers may choose to support multiple serialization schemes which can be specified at compile time using the <xref:System.Configuration.SettingsSerializeAsAttribute>. |
| 51 | +
|
52 | 52 | > [!CAUTION]
|
53 |
| -> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. |
54 |
| - |
55 |
| - |
56 |
| - |
57 |
| -## Examples |
58 |
| - The following code example demonstrates the use of the <xref:System.Configuration.DefaultSettingValueAttribute> applied to three of the four properties of the `FormSettings` wrapper class, which is derived from the <xref:System.Configuration.ApplicationSettingsBase> class. This class is used to persist the location, size, background color, and text of form. The first three of these form properties have default values associated with them. |
59 |
| - |
60 |
| - The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. |
61 |
| - |
| 53 | +> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. |
| 54 | +
|
| 55 | +
|
| 56 | +
|
| 57 | +## Examples |
| 58 | + The following code example demonstrates the use of the <xref:System.Configuration.DefaultSettingValueAttribute> applied to three of the four properties of the `FormSettings` wrapper class, which is derived from the <xref:System.Configuration.ApplicationSettingsBase> class. This class is used to persist the location, size, background color, and text of form. The first three of these form properties have default values associated with them. |
| 59 | +
|
| 60 | + The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. |
| 61 | +
|
62 | 62 | :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet9":::
|
63 | 63 | :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet9":::
|
64 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet9"::: |
65 |
| - |
| 64 | + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet9"::: |
| 65 | +
|
66 | 66 | ]]></format>
|
67 | 67 | </remarks>
|
68 | 68 | <altmember cref="T:System.Configuration.SettingsProvider" />
|
69 | 69 | <altmember cref="T:System.Configuration.LocalFileSettingsProvider" />
|
70 | 70 | <altmember cref="T:System.Configuration.SettingsSerializeAsAttribute" />
|
71 |
| - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-for-windows-forms">Application Settings for Windows Forms</related> |
| 71 | + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms">Application Settings for Windows Forms</related> |
72 | 72 | </Docs>
|
73 | 73 | <Members>
|
74 | 74 | <Member MemberName=".ctor">
|
|
108 | 108 | <param name="value">A <see cref="T:System.String" /> that represents the default value for the property.</param>
|
109 | 109 | <summary>Initializes an instance of the <see cref="T:System.Configuration.DefaultSettingValueAttribute" /> class.</summary>
|
110 | 110 | <remarks>
|
111 |
| - <format type="text/markdown"><![CDATA[ |
112 |
| - |
113 |
| -## Remarks |
114 |
| - The supplied string must be a value that is compatible with the available serialization mechanism associated with the property type. For example, if the property is of type <xref:System.Drawing.Color>, then a `value` of `"Azure"` would be valid. |
115 |
| - |
| 111 | + <format type="text/markdown"><![CDATA[ |
| 112 | +
|
| 113 | +## Remarks |
| 114 | + The supplied string must be a value that is compatible with the available serialization mechanism associated with the property type. For example, if the property is of type <xref:System.Drawing.Color>, then a `value` of `"Azure"` would be valid. |
| 115 | +
|
116 | 116 | > [!CAUTION]
|
117 |
| -> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. |
118 |
| - |
| 117 | +> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. |
| 118 | +
|
119 | 119 | ]]></format>
|
120 | 120 | </remarks>
|
121 | 121 | <altmember cref="P:System.Configuration.DefaultSettingValueAttribute.Value" />
|
|
159 | 159 | <summary>Gets the default value for the application settings property.</summary>
|
160 | 160 | <value>A <see cref="T:System.String" /> that represents the default value for the property.</value>
|
161 | 161 | <remarks>
|
162 |
| - <format type="text/markdown"><![CDATA[ |
163 |
| - |
164 |
| -## Remarks |
165 |
| - The <xref:System.Configuration.DefaultSettingValueAttribute.Value%2A> property is set in the <xref:System.Configuration.DefaultSettingValueAttribute.%23ctor%2A> constructor. |
166 |
| - |
167 |
| - Setting providers may support multiple serialization schemes that can be specified with the <xref:System.Configuration.SettingsSerializeAsAttribute>. |
168 |
| - |
| 162 | + <format type="text/markdown"><![CDATA[ |
| 163 | +
|
| 164 | +## Remarks |
| 165 | + The <xref:System.Configuration.DefaultSettingValueAttribute.Value%2A> property is set in the <xref:System.Configuration.DefaultSettingValueAttribute.%23ctor%2A> constructor. |
| 166 | +
|
| 167 | + Setting providers may support multiple serialization schemes that can be specified with the <xref:System.Configuration.SettingsSerializeAsAttribute>. |
| 168 | +
|
169 | 169 | ]]></format>
|
170 | 170 | </remarks>
|
171 | 171 | <altmember cref="T:System.Configuration.SettingsSerializeAsAttribute" />
|
|
0 commit comments