Package.AddOptionKey(String) 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 user option key name into the list of option keys.
protected:
void AddOptionKey(System::String ^ name);
protected:
void AddOptionKey(Platform::String ^ name);
void AddOptionKey(std::wstring const & name);
protected void AddOptionKey (string name);
member this.AddOptionKey : string -> unit
Protected Sub AddOptionKey (name As String)
Parameters
- name
- String
The name of the option key to add. An option key name must not have any periods in it.
Remarks
The AddOptionKey method adds a user option key name into the list of option keys that the package stores in the solution file. To save package data in a solution file, perform the following tasks:
Call AddOptionKey in your package constructor for each option key you want to store.
Override OnLoadOptions and OnSaveOptions and implement your save and load logic for each key. OnSaveOptions is called for each key you have added. OnLoadOptions is called for each key in the solution file.