Class InterfacePreferences
- Namespace
- ZeroInstall.Model.Preferences
- Assembly
- ZeroInstall.Model.dll
Stores user-specific preferences for an interface.
public sealed class InterfacePreferences : XmlUnknown, ICloneable<InterfacePreferences>, IEquatable<InterfacePreferences>
- Inheritance
-
objectInterfacePreferences
- Implements
- Inherited Members
Constructors
InterfacePreferences()
public InterfacePreferences()
Properties
Feeds
Zero ore more additional feeds containing implementations of this interface.
public List<FeedReference> Feeds { get; }
Property Value
StabilityPolicy
Implementations at this stability level or higher are preferred. Lower levels are used only if there is no other choice.
public Stability StabilityPolicy { get; set; }
Property Value
Uri
The URI of the interface to be configured.
[Browsable(false)]
public required FeedUri Uri { get; set; }
Property Value
Methods
Clone()
Creates a deep copy of this InterfacePreferences instance.
public InterfacePreferences Clone()
Returns
- InterfacePreferences
The new copy of the InterfacePreferences.
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
LoadFor(FeedUri)
Loads InterfacePreferences for a specific interface.
[RequiresDynamicCode("XML serialization requires runtime code generation.")]
public static InterfacePreferences LoadFor(FeedUri interfaceUri)
Parameters
interfaceUriFeedUriThe interface to load the preferences for.
Returns
- InterfacePreferences
The loaded InterfacePreferences.
Exceptions
- IOException
A problem occurred while reading the file.
- UnauthorizedAccessException
Read access to the file is not permitted.
- InvalidDataException
A problem occurred while deserializing an XML file.
LoadForSafe(FeedUri)
Tries to load InterfacePreferences for a specific interface. Automatically falls back to defaults on errors.
[RequiresDynamicCode("XML serialization requires runtime code generation.")]
public static InterfacePreferences LoadForSafe(FeedUri interfaceUri)
Parameters
interfaceUriFeedUriThe interface to load the preferences for.
Returns
- InterfacePreferences
The loaded InterfacePreferences or default value if there was a problem.
SaveFor(FeedUri)
Saves these InterfacePreferences for a specific interface.
[RequiresDynamicCode("XML serialization requires runtime code generation.")]
public void SaveFor(FeedUri interfaceUri)
Parameters
interfaceUriFeedUriThe interface to save the preferences for.
Exceptions
- IOException
A problem occurred while writing the file.
- UnauthorizedAccessException
Write access to the file is not permitted.
ToString()
Returns the preferences in the form "InterfacePreferences: Uri". Not safe for parsing!
public override string ToString()
Returns
Operators
operator ==(InterfacePreferences?, InterfacePreferences?)
Indicates whether the object on the left is equal to the object on the right.
public static bool operator ==(InterfacePreferences? left, InterfacePreferences? right)
Parameters
leftInterfacePreferencesThe left object
rightInterfacePreferencesThe right object
Returns
- bool
true if the objects are equal; otherwise, false.
operator !=(InterfacePreferences?, InterfacePreferences?)
Indicates whether the object on the left is not equal to the object on the right.
public static bool operator !=(InterfacePreferences? left, InterfacePreferences? right)
Parameters
leftInterfacePreferencesThe left object
rightInterfacePreferencesThe right object
Returns
- bool
true if the objects are not equal; otherwise, false.