Zero Install .NET API 2.20.0
ZeroInstall.Store.Configuration.Config Class Reference

User settings controlling network behaviour, solving, etc.. More...

Inheritance diagram for ZeroInstall.Store.Configuration.Config:
NanoByte.Common.ICloneable< Config >

Public Member Functions

 Config ()
 Creates a new configuration with default values set.
 
IEnumerator< KeyValuePair< string, string > > GetEnumerator ()
 
string GetOption (string key)
 Retrieves the string representation of an option identified by a key. More...
 
void SetOption (string key, string value)
 Sets an option identified by a key. More...
 
void ResetOption (string key)
 Resets an option identified by a key to its default value. More...
 
void Save ()
 Saves the settings to an INI file in the default location in the user profile. More...
 
void Save (string path)
 Saves the settings to an INI file. More...
 
Config Clone ()
 Creates a deep copy of this Config instance. More...
 
bool Equals (Config? other)
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 
- Public Member Functions inherited from NanoByte.Common.ICloneable< Config >
Config Clone ()
 

Static Public Member Functions

static bool IsOptionLocked (string key)
 Determines whether an option is locked by a group policy. More...
 
static Config Load ()
 Aggregates the settings from all applicable INI files listed by Locations.GetLoadConfigPaths. More...
 
static Config LoadSafe ()
 Tries to load the Config. Automatically falls back to default values on errors. More...
 
static Config Load (string path)
 Loads the settings from a single INI file. More...
 
static Config From (IConfiguration configuration)
 Gets the settings from a .NET Extensions IConfiguration provider. More...
 

Static Public Attributes

const int DefaultMaxParallelDownloads = 4
 The default value for MaxParallelDownloads.
 
const string DefaultFeedMirror = "http://roscidus.com/0mirror"
 The default value for FeedMirror.
 
const string DefaultKeyInfoServer = "https://keylookup.0install.net/"
 The default value for KeyInfoServer.
 
const string DefaultSelfUpdateUri = "https://apps.0install.net/0install/0install-win.xml"
 The default value for SelfUpdateUri.
 
const string DefaultExternalSolverUri = "https://apps.0install.net/0install/0install-ocaml.xml"
 The default value for ExternalSolverUri.
 
const string DefaultSyncServer = "https://0install.de/sync/"
 The default value for SyncServer.
 

Properties

ConfigTab InitialTab [getset]
 The initial tab to show in GUI representations.
 
TimeSpan Freshness = _defaultFreshness [getset]
 The maximum age a cached Feed may have until it is considered stale (needs to be updated).
 
bool HelpWithTesting [getset]
 Always prefer the newest versions, even if they have not been marked as Stability.Stable yet.
 
NetworkLevel NetworkUse [getset]
 Controls how liberally network access is attempted.
 
bool AutoApproveKeys = true [getset]
 Automatically approve keys known by the KeyInfoServer and seen the first time a feed is fetched.
 
int MaxParallelDownloads = DefaultMaxParallelDownloads [getset]
 Maximum number of Implementations to download in parallel.
 
FeedUriFeedMirror = new(DefaultFeedMirror) [getset]
 The mirror server used to provide feeds when the original server is unavailable. Set to empty to deactivate use of feed mirror.
 
FeedUriKeyInfoServer = new(DefaultKeyInfoServer) [getset]
 The key information server used to get information about who signed a feed. Set to empty to deactivate use of key information server.
 
FeedUriSelfUpdateUri = new(DefaultSelfUpdateUri) [getset]
 The feed URI used to search for updates for Zero Install itself. Set to empty to deactivate self-update.
 
FeedUriExternalSolverUri = new(DefaultExternalSolverUri) [getset]
 The feed URI used to get the external solver. Set to empty to deactivate use of external solver.
 
FeedUriSyncServer = new(DefaultSyncServer) [getset]
 The sync server used to synchronize your app list between multiple computers. More...
 
string SyncServerUsername = "" [getset]
 The username to authenticate with against the SyncServer. More...
 
string SyncServerPassword = "" [getset]
 The password to authenticate with against the SyncServer. More...
 
string SyncCryptoKey = "" [getset]
 The local key used to encrypt data before sending it to the SyncServer.
 
bool IsSyncConfigured [get]
 Indicates whether the sync-related configuration is complete.
 

Detailed Description

User settings controlling network behaviour, solving, etc..

Member Function Documentation

◆ Clone()

Config ZeroInstall.Store.Configuration.Config.Clone ( )
inline

Creates a deep copy of this Config instance.

Returns
The new copy of the Config.

◆ From()

static Config ZeroInstall.Store.Configuration.Config.From ( IConfiguration  configuration)
inlinestatic

Gets the settings from a .NET Extensions IConfiguration provider.

Returns
The loaded Config.

◆ GetOption()

string ZeroInstall.Store.Configuration.Config.GetOption ( string  key)

Retrieves the string representation of an option identified by a key.

Parameters
keyThe key of the option to retrieve.
Returns
The string representation of the the option.
Exceptions
KeyNotFoundExceptionkey is invalid.

◆ IsOptionLocked()

static bool ZeroInstall.Store.Configuration.Config.IsOptionLocked ( string  key)
inlinestatic

Determines whether an option is locked by a group policy.

Parameters
keyThe key of the option to check.

◆ Load() [1/2]

static Config ZeroInstall.Store.Configuration.Config.Load ( )
inlinestatic

Aggregates the settings from all applicable INI files listed by Locations.GetLoadConfigPaths.

Returns
The loaded Config.
Exceptions
IOExceptionA problem occurred while reading the file.
UnauthorizedAccessExceptionRead access to the file is not permitted.
InvalidDataExceptionA problem occurred while deserializing the config data.

◆ Load() [2/2]

static Config ZeroInstall.Store.Configuration.Config.Load ( string  path)
inlinestatic

Loads the settings from a single INI file.

Returns
The loaded Config.
Exceptions
IOExceptionA problem occurred while reading the file.
UnauthorizedAccessExceptionRead access to the file is not permitted.
InvalidDataExceptionA problem occurred while deserializing the config data.

◆ LoadSafe()

static Config ZeroInstall.Store.Configuration.Config.LoadSafe ( )
inlinestatic

Tries to load the Config. Automatically falls back to default values on errors.

Returns
The loaded Config or default Config if there was a problem.

◆ ResetOption()

void ZeroInstall.Store.Configuration.Config.ResetOption ( string  key)

Resets an option identified by a key to its default value.

Parameters
keyThe key of the option to reset.
Exceptions
KeyNotFoundExceptionkey is invalid.

◆ Save() [1/2]

void ZeroInstall.Store.Configuration.Config.Save ( )

Saves the settings to an INI file in the default location in the user profile.

This method performs an atomic write operation when possible.

Exceptions
IOExceptionA problem occurred while writing the file.
UnauthorizedAccessExceptionWrite access to the file is not permitted.

◆ Save() [2/2]

void ZeroInstall.Store.Configuration.Config.Save ( string  path)
inline

Saves the settings to an INI file.

This method performs an atomic write operation when possible.

Exceptions
IOExceptionA problem occurred while writing the file.
UnauthorizedAccessExceptionWrite access to the file is not permitted.

◆ SetOption()

void ZeroInstall.Store.Configuration.Config.SetOption ( string  key,
string  value 
)
inline

Sets an option identified by a key.

Parameters
keyThe key of the option to set.
valueA string representation of the option.
Exceptions
KeyNotFoundExceptionkey is invalid.
FormatExceptionvalue is invalid.
UnauthorizedAccessExceptionThis option is controlled by a group policy and can therefore not be modified.

Property Documentation

◆ SyncServer

FeedUri? ZeroInstall.Store.Configuration.Config.SyncServer = new(DefaultSyncServer)
getset

The sync server used to synchronize your app list between multiple computers.

See also
SyncServerUsername, SyncServerPassword

◆ SyncServerPassword

string ZeroInstall.Store.Configuration.Config.SyncServerPassword = ""
getset

The password to authenticate with against the SyncServer.

See also
SyncServer, SyncServerUsername

◆ SyncServerUsername

string ZeroInstall.Store.Configuration.Config.SyncServerUsername = ""
getset

The username to authenticate with against the SyncServer.

See also
SyncServer, SyncServerPassword

The documentation for this class was generated from the following files: