SettingsProviderCollection.Add(ProviderBase) Method
Definition
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.
Adds a new settings provider to the collection.
public:
override void Add(System::Configuration::Provider::ProviderBase ^ provider);
public override void Add (System.Configuration.Provider.ProviderBase provider);
override this.Add : System.Configuration.Provider.ProviderBase -> unit
Public Overrides Sub Add (provider As ProviderBase)
Parameters
- provider
- ProviderBase
A ProviderBase to add to the collection.
Exceptions
The provider
parameter is not of type SettingsProvider.
-or-
The Name property of the provider parameter is null or an empty string.
-or-
A settings provider with the same Name already exists in the collection.
The collection is read-only.
The provider
parameter is null
.
Remarks
The Name property of the SettingsProvider is used as the storage key.
Caution
Although the Add method has a single ProviderBase parameter to match the signature of this same method in the base class ProviderCollection, this method will throw an exception if the provider
parameter is not of type SettingsProvider.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기