Class FeedPreferences
- Namespace
- ZeroInstall.Model.Preferences
- Assembly
- ZeroInstall.Model.dll
Stores user-specific preferences for a Feed.
[Equatable]
public sealed class FeedPreferences : XmlUnknown, IEquatable<XmlUnknown>, ICloneable<FeedPreferences>, IEquatable<FeedPreferences>
- Inheritance
-
FeedPreferences
- Implements
- Inherited Members
Properties
Implementations
A list of implementation-specific user-overrides.
[OrderedEquality]
public List<ImplementationPreferences> Implementations { get; }
Property Value
this[string]
Retrieves an existing entry from Implementations by ID or creates a new one if no appropriate one exists.
public ImplementationPreferences this[string id] { get; }
Parameters
Property Value
- ImplementationPreferences
The found or newly created ImplementationPreferences.
LastChecked
The point in time this feed was last checked for updates.
public UnixTime LastChecked { get; set; }
Property Value
Methods
Clone()
Creates a deep copy of this FeedPreferences instance.
public FeedPreferences Clone()
Returns
- FeedPreferences
The new copy of the FeedPreferences.
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
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
LoadFor(FeedUri)
Loads FeedPreferences for a specific feed.
public static FeedPreferences LoadFor(FeedUri feedUri)
Parameters
feedUri
FeedUriThe feed to load the preferences for.
Returns
- FeedPreferences
The loaded FeedPreferences.
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 FeedPreferences for a specific feed. Automatically falls back to defaults on errors.
public static FeedPreferences LoadForSafe(FeedUri feedUri)
Parameters
feedUri
FeedUriThe feed to load the preferences for.
Returns
- FeedPreferences
The loaded FeedPreferences or default value if there was a problem.
Normalize()
Removes superfluous entries from Implementations.
public void Normalize()
SaveFor(FeedUri)
Saves these FeedPreferences for a specific feed.
public void SaveFor(FeedUri feedUri)
Parameters
feedUri
FeedUriThe feed 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 "FeedPreferences: LastChecked". Not safe for parsing!
public override string ToString()
Returns
Operators
operator ==(FeedPreferences?, FeedPreferences?)
Indicates whether the object on the left is equal to the object on the right.
public static bool operator ==(FeedPreferences? left, FeedPreferences? right)
Parameters
left
FeedPreferencesThe left object
right
FeedPreferencesThe right object
Returns
- bool
true if the objects are equal; otherwise, false.
operator !=(FeedPreferences?, FeedPreferences?)
Indicates whether the object on the left is not equal to the object on the right.
public static bool operator !=(FeedPreferences? left, FeedPreferences? right)
Parameters
left
FeedPreferencesThe left object
right
FeedPreferencesThe right object
Returns
- bool
true if the objects are not equal; otherwise, false.