Class Config
- Namespace
- ZeroInstall.Store.Configuration
- Assembly
- ZeroInstall.Store.dll
User settings controlling network behaviour, solving, etc..
[Serializable]
public sealed class Config : IEnumerable<KeyValuePair<string, string>>, IEnumerable, ICloneable<Config>, IEquatable<Config>
- Inheritance
-
Config
- Implements
- Inherited Members
Constructors
Config()
Creates a new configuration with default values set.
public Config()
Fields
DefaultExternalSolverUri
The default value for ExternalSolverUri.
public const string DefaultExternalSolverUri = "https://apps.0install.net/0install/0install-ocaml.xml"
Field Value
DefaultFeedMirror
The default value for FeedMirror.
public const string DefaultFeedMirror = "https://roscidus.com/0mirror"
Field Value
DefaultKeyInfoServer
The default value for KeyInfoServer.
public const string DefaultKeyInfoServer = "https://keylookup.0install.net/"
Field Value
DefaultMaxParallelDownloads
The default value for MaxParallelDownloads.
public const int DefaultMaxParallelDownloads = 4
Field Value
DefaultSelfUpdateUri
The default value for SelfUpdateUri.
public const string DefaultSelfUpdateUri = "https://apps.0install.net/0install/0install-dotnet.xml"
Field Value
DefaultSyncServer
The default value for SyncServer.
public const string DefaultSyncServer = "https://0install.de/sync/"
Field Value
Properties
AutoApproveKeys
Automatically approve keys known by the KeyInfoServer and seen the first time a feed is fetched.
public bool AutoApproveKeys { get; set; }
Property Value
EffectiveNetworkUse
Same as NetworkUse, except when there the internet connection is metered (capped at Minimal) or unavailable (capped at Offline).
[Browsable(false)]
public NetworkLevel EffectiveNetworkUse { get; }
Property Value
ExternalSolverUri
The feed URI used to get the external solver. Set to empty to deactivate use of external solver.
public FeedUri? ExternalSolverUri { get; set; }
Property Value
FeedMirror
The mirror server used to provide feeds when the original server is unavailable. Set to empty to deactivate use of feed mirror.
public FeedUri? FeedMirror { get; set; }
Property Value
Freshness
The maximum age a cached Feed may have until it is considered stale (needs to be updated).
public TimeSpan Freshness { get; set; }
Property Value
HelpWithTesting
Always prefer the newest versions, even if they have not been marked as Stable yet.
public bool HelpWithTesting { get; set; }
Property Value
InitialTab
The initial tab to show in GUI representations.
[Browsable(false)]
public ConfigTab InitialTab { get; set; }
Property Value
IsSyncConfigured
Indicates whether the sync-related configuration is complete.
[Browsable(false)]
public bool IsSyncConfigured { get; }
Property Value
KeyInfoServer
The key information server used to get information about who signed a feed. Set to empty to deactivate use of key information server.
public FeedUri? KeyInfoServer { get; set; }
Property Value
KioskMode
Restrict usage to feeds specified in the catalog.
public bool KioskMode { get; set; }
Property Value
MaxParallelDownloads
Maximum number of Implementations to download in parallel.
[Range(1, 128)]
public int MaxParallelDownloads { get; set; }
Property Value
NetworkUse
Controls how liberally network access is attempted.
public NetworkLevel NetworkUse { get; set; }
Property Value
SelfUpdateUri
The feed URI used to search for updates for Zero Install itself. Set to empty to deactivate self-update.
public FeedUri? SelfUpdateUri { get; set; }
Property Value
SyncCryptoKey
The local key used to encrypt data before sending it to the SyncServer.
public string SyncCryptoKey { get; set; }
Property Value
SyncServer
The sync server used to synchronize your app list between multiple computers.
public FeedUri? SyncServer { get; set; }
Property Value
- See Also
SyncServerCredentials
The credentials specified in SyncServerUsername and SyncServerPassword.
[Browsable(false)]
public NetworkCredential? SyncServerCredentials { get; }
Property Value
SyncServerKerberos
Always prefer the newest versions, even if they have not been marked as Stable yet.
public bool SyncServerKerberos { get; set; }
Property Value
SyncServerPassword
The password to authenticate with against the SyncServer.
public string SyncServerPassword { get; set; }
Property Value
- See Also
SyncServerUsername
The username to authenticate with against the SyncServer.
public string SyncServerUsername { get; set; }
Property Value
- See Also
Methods
Clone()
Creates a deep copy of this Config instance.
public Config Clone()
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
Equals(Config?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Config? other)
Parameters
other
ConfigAn object to compare with this object.
Returns
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<string, string>>
An enumerator that can be used to iterate through the collection.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
GetOption(string)
Retrieves the string representation of an option identified by a key.
public string GetOption(string key)
Parameters
key
stringThe key of the option to retrieve.
Returns
- string
The string representation of the the option.
Exceptions
- KeyNotFoundException
key
is invalid.
IsOptionLocked(string)
Determines whether an option is locked by a group policy (in the Windows registry).
public static bool IsOptionLocked(string key)
Parameters
key
stringThe key of the option to check.
Returns
Load()
Aggregates options from all applicable config files and registry locations.
public static Config Load()
Returns
Exceptions
- IOException
A problem occurred while reading the file.
- UnauthorizedAccessException
Read access to the file is not permitted.
- InvalidDataException
A problem occurred while deserializing the config data.
LoadSafe()
Tries to aggregates options from all applicable config files and registry locations. Automatically falls back to default values on errors.
public static Config LoadSafe()
Returns
ReadFrom(IniData, string)
Reads options from a config file stream and merges them into the config instance.
public void ReadFrom(IniData iniData, string path = "embedded")
Parameters
iniData
IniDataThe parsed file.
path
stringThe path of the file
iniData
was read from. Used for logging.
Exceptions
- InvalidDataException
The file contains invalid config values.
ReadFromFile(string)
Reads options from a config file and merges them into the config instance.
public void ReadFromFile(string path)
Parameters
path
stringThe path of the file to read.
Exceptions
- IOException
A problem occurred while reading the file.
- UnauthorizedAccessException
Read access to the file is not permitted.
- InvalidDataException
The file contains invalid config values.
ReadFromFiles()
Reads options from config files in default locations and merges them into the config instance.
public void ReadFromFiles()
Exceptions
- IOException
A problem occurred while reading the file.
- UnauthorizedAccessException
Read access to the file is not permitted.
- InvalidDataException
The file contains invalid config values.
ReadFromFilesMachineWideOnly()
Reads options from config files in machine-wide locations.
public void ReadFromFilesMachineWideOnly()
Exceptions
- IOException
A problem occurred while reading the file.
- UnauthorizedAccessException
Read access to the file is not permitted.
- InvalidDataException
The file contains invalid config values.
ReadFromGroupPolicy()
Reads options from group policies (in the Windows registry) and merges them into the config instance.
public void ReadFromGroupPolicy()
Exceptions
- UnauthorizedAccessException
Read access to the registry key is not permitted.
- InvalidDataException
The registry key contains invalid config values.
ResetOption(string)
Resets an option identified by a key to its default value.
public void ResetOption(string key)
Parameters
key
stringThe key of the option to reset.
Exceptions
- KeyNotFoundException
key
is invalid.
Save(bool)
Saves the options to a config file in a default location.
public void Save(bool machineWide = false)
Parameters
machineWide
booltrue
to save in a machine-wide location;false
to save in the user profile.
Remarks
This method performs an atomic write operation when possible.
Exceptions
- IOException
A problem occurred while writing the file.
- UnauthorizedAccessException
Write access to the file is not permitted.
Save(string)
Saves the options to a config file.
public void Save(string path)
Parameters
path
string
Remarks
This method performs an atomic write operation when possible.
Exceptions
- IOException
A problem occurred while writing the file.
- UnauthorizedAccessException
Write access to the file is not permitted.
SetOption(string, string)
Sets an option identified by a key.
public void SetOption(string key, string value)
Parameters
Exceptions
- KeyNotFoundException
key
is invalid.- FormatException
value
is invalid.- UnauthorizedAccessException
This option is controlled by a group policy and can therefore not be modified.
ToIniData()
Converts the options into an in-memory representation of an INI file.
public IniData ToIniData()
Returns
- IniData