ApplicationSettingsBase.Item[String] Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the value of the specified application settings property.
public:
virtual property System::Object ^ default[System::String ^] { System::Object ^ get(System::String ^ propertyName); void set(System::String ^ propertyName, System::Object ^ value); };
public override object this[string propertyName] { get; set; }
member this.Item(string) : obj with get, set
Default Public Overrides Property Item(propertyName As String) As Object
If found, the value of the named settings property; otherwise, null
.
There are no properties associated with the current wrapper or the specified property could not be found.
An attempt was made to set a read-only property.
The value supplied is of a type incompatible with the settings property, during a set operation.
The configuration file could not be parsed.
The Item[] property, also known as the indexer, is routinely used in the settings wrapper class derived from ApplicationSettingsBase. Item[] binds the public property of the wrapper class to the corresponding settings property.
Item[] raises several events depending on the operation being performed:
The first time a property is retrieved, the SettingsLoaded event is raised.
When a property is set, the OnSettingChanging event is raised. If the handler does not cancel the event, then the property value is set and the PropertyChanged event is raised.
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: