Table of Contents

Class InterfacePreferences

Namespace
ZeroInstall.Model.Preferences
Assembly
ZeroInstall.Model.dll

Stores user-specific preferences for an interface.

[Equatable]
public sealed class InterfacePreferences : XmlUnknown, IEquatable<XmlUnknown>, ICloneable<InterfacePreferences>, IEquatable<InterfacePreferences>
Inheritance
InterfacePreferences
Implements
Inherited Members

Properties

Feeds

Zero ore more additional feeds containing implementations of this interface.

[OrderedEquality]
public List<FeedReference> Feeds { get; }

Property Value

List<FeedReference>

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

Stability

Uri

The URI of the interface to be configured.

[Browsable(false)]
public required FeedUri Uri { get; set; }

Property Value

FeedUri

Methods

Clone()

Creates a deep copy of this InterfacePreferences instance.

public InterfacePreferences Clone()

Returns

InterfacePreferences

The new copy of the InterfacePreferences.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

LoadFor(FeedUri)

Loads InterfacePreferences for a specific interface.

public static InterfacePreferences LoadFor(FeedUri interfaceUri)

Parameters

interfaceUri FeedUri

The 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.

public static InterfacePreferences LoadForSafe(FeedUri interfaceUri)

Parameters

interfaceUri FeedUri

The 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.

public void SaveFor(FeedUri interfaceUri)

Parameters

interfaceUri FeedUri

The 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

string

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

left InterfacePreferences

The left object

right InterfacePreferences

The 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

left InterfacePreferences

The left object

right InterfacePreferences

The right object

Returns

bool

true if the objects are not equal; otherwise, false.