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

Stores user-specific preferences for a Feed. More...

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

Public Member Functions

void Normalize ()
 Removes superfluous entries from Implementations.
 
void SaveFor (FeedUri feedUri)
 Saves these FeedPreferences for a specific feed. More...
 
FeedPreferences Clone ()
 Creates a deep copy of this FeedPreferences instance. More...
 
override string ToString ()
 Returns the preferences in the form "FeedPreferences: LastChecked". Not safe for parsing!
 
bool Equals (FeedPreferences? 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< FeedPreferences >
FeedPreferences Clone ()
 

Static Public Member Functions

static FeedPreferences LoadFor (FeedUri feedUri)
 Loads FeedPreferences for a specific feed. More...
 
static FeedPreferences LoadForSafe (FeedUri feedUri)
 Tries to load FeedPreferences for a specific feed. Automatically falls back to defaults on errors. More...
 

Properties

UnixTime LastChecked [getset]
 The point in time this feed was last checked for updates.
 
long LastCheckedUnix [getset]
 Used for XML serialization. More...
 
List< ImplementationPreferencesImplementations = new() [get]
 A list of implementation-specific user-overrides.
 
ImplementationPreferences this[string id] [get]
 Retrieves an existing entry from Implementations by ID or creates a new one if no appropriate one exists. More...
 

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 a Feed.

Member Function Documentation

◆ Clone()

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

Creates a deep copy of this FeedPreferences instance.

Returns
The new copy of the FeedPreferences.

◆ LoadFor()

static FeedPreferences ZeroInstall.Model.Preferences.FeedPreferences.LoadFor ( FeedUri  feedUri)
inlinestatic

Loads FeedPreferences for a specific feed.

Parameters
feedUriThe feed to load the preferences for.
Returns
The loaded FeedPreferences.
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 FeedPreferences ZeroInstall.Model.Preferences.FeedPreferences.LoadForSafe ( FeedUri  feedUri)
inlinestatic

Tries to load FeedPreferences for a specific feed. Automatically falls back to defaults on errors.

Parameters
feedUriThe feed to load the preferences for.
Returns
The loaded FeedPreferences or default value if there was a problem.

◆ SaveFor()

void ZeroInstall.Model.Preferences.FeedPreferences.SaveFor ( FeedUri  feedUri)
inline

Saves these FeedPreferences for a specific feed.

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

Property Documentation

◆ LastCheckedUnix

long ZeroInstall.Model.Preferences.FeedPreferences.LastCheckedUnix
getset

Used for XML serialization.

See also
LastChecked

◆ this[string id]

ImplementationPreferences ZeroInstall.Model.Preferences.FeedPreferences.this[string id]
get

Retrieves an existing entry from Implementations by ID or creates a new one if no appropriate one exists.

Parameters
idThe ImplementationPreferences.ID to search for.
Returns
The found or newly created ImplementationPreferences.

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