Zero Install .NET API 2.20.0
ZeroInstall.Model.Preferences.InterfacePreferences Class Reference

Stores user-specific preferences for an interface. More...

Inheritance diagram for ZeroInstall.Model.Preferences.InterfacePreferences:
ZeroInstall.Model.XmlUnknown NanoByte.Common.ICloneable< InterfacePreferences >

Public Member Functions

void SaveFor (FeedUri interfaceUri)
 Saves these InterfacePreferences for a specific interface. More...
 
InterfacePreferences Clone ()
 Creates a deep copy of this InterfacePreferences instance. More...
 
override string ToString ()
 Returns the preferences in the form "InterfacePreferences: Uri". Not safe for parsing!
 
bool Equals (InterfacePreferences? other)
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 
- Public Member Functions inherited from ZeroInstall.Model.XmlUnknown
string ToShortXml ()
 Returns a shortened XML representation (with attributes but without child elements). More...
 
override int GetHashCode ()
 
- Public Member Functions inherited from NanoByte.Common.ICloneable< InterfacePreferences >
InterfacePreferences Clone ()
 

Static Public Member Functions

static InterfacePreferences LoadFor (FeedUri interfaceUri)
 Loads InterfacePreferences for a specific interface. More...
 
static InterfacePreferences LoadForSafe (FeedUri interfaceUri)
 Tries to load InterfacePreferences for a specific interface. Automatically falls back to defaults on errors. More...
 

Properties

FeedUri Uri = default! [getset]
 The URI of the interface to be configured.
 
string? UriString [getset]
 Used for XML serialization and PropertyGrid. More...
 
Stability StabilityPolicy = Stability.Unset [getset]
 Implementations at this stability level or higher are preferred. Lower levels are used only if there is no other choice.
 
List< FeedReferenceFeeds = new() [get]
 Zero ore more additional feeds containing implementations of this interface.
 

Additional Inherited Members

- Public Attributes inherited from ZeroInstall.Model.XmlUnknown
XmlAttribute?[] UnknownAttributes
 Contains any unknown additional XML attributes.
 
XmlElement?[] UnknownElements
 Contains any unknown additional XML elements.
 
- Protected Member Functions inherited from ZeroInstall.Model.XmlUnknown
void EnsureAttribute (object? value, string attributeName)
 Ensures that a value deserialized from an XML attribute is set (not null). More...
 
void EnsureAttributeSafeID (string? value, string attributeName)
 Ensures that a value deserialized from an XML attribute is set (not null) and only contains alphanumeric characters, spaces ( ), dots (.), underscores (_), hyphens (-) and plus signs (+). More...
 
bool Equals (XmlUnknown? other)
 

Detailed Description

Stores user-specific preferences for an interface.

Member Function Documentation

◆ Clone()

InterfacePreferences ZeroInstall.Model.Preferences.InterfacePreferences.Clone ( )
inline

Creates a deep copy of this InterfacePreferences instance.

Returns
The new copy of the InterfacePreferences.

◆ LoadFor()

static InterfacePreferences ZeroInstall.Model.Preferences.InterfacePreferences.LoadFor ( FeedUri  interfaceUri)
inlinestatic

Loads InterfacePreferences for a specific interface.

Parameters
interfaceUriThe interface to load the preferences for.
Returns
The loaded InterfacePreferences.
Exceptions
IOExceptionA problem occurred while reading the file.
UnauthorizedAccessExceptionRead access to the file is not permitted.
InvalidDataExceptionA problem occurred while deserializing the XML data.

◆ LoadForSafe()

static InterfacePreferences ZeroInstall.Model.Preferences.InterfacePreferences.LoadForSafe ( FeedUri  interfaceUri)
inlinestatic

Tries to load InterfacePreferences for a specific interface. Automatically falls back to defaults on errors.

Parameters
interfaceUriThe interface to load the preferences for.
Returns
The loaded InterfacePreferences or default value if there was a problem.

◆ SaveFor()

void ZeroInstall.Model.Preferences.InterfacePreferences.SaveFor ( FeedUri  interfaceUri)
inline

Saves these InterfacePreferences for a specific interface.

Parameters
interfaceUriThe interface to save the preferences for.
Exceptions
IOExceptionA problem occurred while writing the file.
UnauthorizedAccessExceptionWrite access to the file is not permitted.

Property Documentation

◆ UriString

string? ZeroInstall.Model.Preferences.InterfacePreferences.UriString
getset

Used for XML serialization and PropertyGrid.

See also
Uri

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