-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
UserScopedSettingAttribute.xml
111 lines (101 loc) · 7.15 KB
/
UserScopedSettingAttribute.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<Type Name="UserScopedSettingAttribute" FullName="System.Configuration.UserScopedSettingAttribute">
<TypeSignature Language="C#" Value="public sealed class UserScopedSettingAttribute : System.Configuration.SettingAttribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit UserScopedSettingAttribute extends System.Configuration.SettingAttribute" />
<TypeSignature Language="DocId" Value="T:System.Configuration.UserScopedSettingAttribute" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class UserScopedSettingAttribute
Inherits SettingAttribute" />
<TypeSignature Language="F#" Value="type UserScopedSettingAttribute = class
 inherit SettingAttribute" />
<TypeSignature Language="C++ CLI" Value="public ref class UserScopedSettingAttribute sealed : System::Configuration::SettingAttribute" />
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Configuration.ConfigurationManager</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="System.Configuration.ConfigurationManager" FromVersion="9.0.0.0" To="System" ToVersion="4.0.0.0" FrameworkAlternate="netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Configuration.SettingAttribute</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.AttributeUsage(System.AttributeTargets.Property)]</AttributeName>
<AttributeName Language="F#">[<System.AttributeUsage(System.AttributeTargets.Property)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Specifies that an application settings group or property contains distinct values for each user of an application. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Application settings properties have a scope that is based either at the application or the user level. As the categories imply, application-scoped properties present uniform values to all users of the application, whereas user-scoped properties have dedicated values for each user of the application.
The <xref:System.Configuration.UserScopedSettingAttribute> indicates that a property should be considered a user level setting, and that appropriate storage decisions should be made accordingly by the settings provider.
A scope attribute is required for each application settings property. If a property is not applied with either a <xref:System.Configuration.ApplicationScopedSettingAttribute> or <xref:System.Configuration.UserScopedSettingAttribute>, the property is ignored by the settings provider - it is not serialized. It is invalid, however, to apply both attributes to the same settings property. Such an attempt will cause a <xref:System.Configuration.ConfigurationErrorsException> to be thrown.
## Examples
The following code example demonstrates the use of the <xref:System.Configuration.UserScopedSettingAttribute> applied to all 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 full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet9":::
:::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet9":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet9":::
]]></format>
</remarks>
<altmember cref="T:System.Configuration.ApplicationScopedSettingAttribute" />
<altmember cref="T:System.Configuration.ApplicationSettingsBase" />
<altmember cref="T:System.Configuration.SettingsProvider" />
<altmember cref="T:System.Configuration.ConfigurationErrorsException" />
<related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-architecture">Application Settings Architecture</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public UserScopedSettingAttribute ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Configuration.UserScopedSettingAttribute.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 UserScopedSettingAttribute();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Configuration.ConfigurationManager</AssemblyName>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Configuration.UserScopedSettingAttribute" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Each application settings property must be applied with a single scope attribute in order for it to be recognized and serialized by the settings provider.
]]></format>
</remarks>
<altmember cref="T:System.Configuration.SettingsProvider" />
<related type="Article" href="https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2008/wabtadw6(v=vs.90)">How to: Create Application Settings</related>
</Docs>
</Member>
</Members>
</Type>