Class NamedSettingsManager
Manager to access a settings store file. Objects are primarily accessed by DisplayName rather than unique key. 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 NamedSettingsManager
- Inheritance
-
NamedSettingsManager
- Inherited Members
Constructors
NamedSettingsManager(string)
Construct an NamedSettingsManager.
public NamedSettingsManager(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
Methods
CopyObject(string, string, bool)
Copy an object in the store. The new object will be a copy of the original, except it will be assigned a new unique key.
public void CopyObject(string fromDisplayName, string toDisplayName, bool force)
Parameters
fromDisplayName
stringtoDisplayName
stringforce
boolif true and destination object already exists overwrite it
ListObjectNames()
Get a list of the display names for the objects in the store.
public List<string> ListObjectNames()
Returns
RegisterObject(string, Dictionary<string, string>)
Register an object. Let the uniqueKey be assigned automatically.
public string RegisterObject(string displayName, Dictionary<string, string> properties)
Parameters
displayName
stringThe display name for the object.
properties
Dictionary<string, string>The property names and values for the object.
Returns
- string
The unique key that was assigned to the object.
RenameObject(string, string, bool)
Rename an object in the store.
public void RenameObject(string oldDisplayName, string newDisplayName, bool force)
Parameters
oldDisplayName
stringnewDisplayName
stringforce
boolif true and destination object already exists overwrite it
TryGetObject(string, out Dictionary<string, string>)
Try to get an object form the store.
public bool TryGetObject(string displayName, out Dictionary<string, string> properties)
Parameters
displayName
stringThe display name for the object.
properties
Dictionary<string, string>The property names and values for the object.
Returns
- bool
True if the object was found, false otherwise.
TryGetObject(string, out string, out Dictionary<string, string>)
Try to get an object form the store.
public bool TryGetObject(string displayName, out string uniqueKey, out Dictionary<string, string> properties)
Parameters
displayName
stringThe display name for the object.
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.
UnregisterObject(string)
Unregister an object from the store.
public void UnregisterObject(string displayName)
Parameters
displayName
stringThe display name for the object.