Class SettingsManager
Manager to access a settings store file. Settings store files are located under the current user's AppData\Local\AWSToolkit folder. Select keys in these files are encrypted on a per user, per machine basis using the Windows Data Protection API; the encrypted values cannot be used by any other user or on any other machine.
This class is not threadsafe.
public class SettingsManager
- Inheritance
-
SettingsManager
- Inherited Members
Constructors
SettingsManager(string)
Construct a SettingsManager.
public SettingsManager(string settingsType)
Parameters
settingsType
stringThe base filename to read/write.
Properties
IsAvailable
True if the encrypted store is availble, false otherwise.
public static bool IsAvailable { get; }
Property Value
SettingsType
The base filename to read/write.
public string SettingsType { get; }
Property Value
Methods
ListUniqueKeys()
Get a list of the unique keys of all the objects in the store.
public List<string> ListUniqueKeys()
Returns
RegisterObject(Dictionary<string, string>)
Register an object. Let the uniqueKey be assigned automatically.
public string RegisterObject(Dictionary<string, string> properties)
Parameters
properties
Dictionary<string, string>The property names and values for the object.
Returns
- string
The unique key that was assigned to the object.
RegisterObject(string, Dictionary<string, string>)
Register an object.
public string RegisterObject(string uniqueKey, Dictionary<string, string> properties)
Parameters
uniqueKey
stringThe uniqueKey for the object, or null if one should be assigned automatically.
properties
Dictionary<string, string>The property names and values for the object.
Returns
- string
The unique key that was assigned to the object.
SelectProperty(string)
Get the value of a specific property for each object in the store.
public List<string> SelectProperty(string propertyName)
Parameters
propertyName
string
Returns
TryGetObject(string, out Dictionary<string, string>)
Try to get an object form the store.
public bool TryGetObject(string uniqueKey, out Dictionary<string, string> properties)
Parameters
uniqueKey
stringThe uniqueKey of the object in the store
properties
Dictionary<string, string>The property names and values for the object.
Returns
- bool
True if the object was found, false otherwise.
TryGetObjectByProperty(string, string, out string, out Dictionary<string, string>)
Try to get an object form the store based on the value of a specific property. If multiple objects with the same property value exist, return the first one.
public bool TryGetObjectByProperty(string propertyName, string value, out string uniqueKey, out Dictionary<string, string> properties)
Parameters
propertyName
stringThe name of the property to search on.
value
stringThe value of the property to search on.
uniqueKey
stringThe unique key of the object.
properties
Dictionary<string, string>The properties of the object.
Returns
UnregisterObject(string)
Unregister an object from the store.
public void UnregisterObject(string uniqueKey)
Parameters
uniqueKey
stringThe unique key for the object.