Zero Install .NET API 2.20.0
ZeroInstall.Model.XmlUnknown Class Reference

Abstract base class for XML serializable classes that are intended to retain any unknown XML elements or attributes loaded from an XML file. More...

Inheritance diagram for ZeroInstall.Model.XmlUnknown:
ZeroInstall.DesktopIntegration.AccessPoints.AccessPoint ZeroInstall.DesktopIntegration.AccessPoints.AccessPointList ZeroInstall.DesktopIntegration.AppEntry ZeroInstall.DesktopIntegration.AppList ZeroInstall.Model.Capabilities.AutoPlayEvent ZeroInstall.Model.Capabilities.Capability ZeroInstall.Model.Capabilities.CapabilityList ZeroInstall.Model.Capabilities.FileTypeExtension ZeroInstall.Model.Capabilities.KnownProtocolPrefix ZeroInstall.Model.Capabilities.Verb ZeroInstall.Model.Catalog ZeroInstall.Model.Feed ZeroInstall.Model.FeedElement ZeroInstall.Model.Preferences.FeedPreferences ZeroInstall.Model.Preferences.ImplementationPreferences ZeroInstall.Model.Preferences.InterfacePreferences ZeroInstall.Model.Selection.Selections

Public Member Functions

string ToShortXml ()
 Returns a shortened XML representation (with attributes but without child elements). More...
 
override int GetHashCode ()
 

Public Attributes

XmlAttribute?[] UnknownAttributes
 Contains any unknown additional XML attributes.
 
XmlElement?[] UnknownElements
 Contains any unknown additional XML elements.
 

Protected Member Functions

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

Abstract base class for XML serializable classes that are intended to retain any unknown XML elements or attributes loaded from an XML file.

Inheriting from this class will prevent the XmlSerializer.UnknownElement event from being triggered.

Member Function Documentation

◆ EnsureAttribute()

void ZeroInstall.Model.XmlUnknown.EnsureAttribute ( object?  value,
string  attributeName 
)
inlineprotected

Ensures that a value deserialized from an XML attribute is set (not null).

Parameters
valueThe mapped value to check.
attributeNameThe name of the XML attribute.
Exceptions
InvalidDataExceptionvalue is null.

◆ EnsureAttributeSafeID()

void ZeroInstall.Model.XmlUnknown.EnsureAttributeSafeID ( string?  value,
string  attributeName 
)
inlineprotected

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 (+).

Parameters
valueThe mapped value to check.
attributeNameThe name of the XML attribute.
Exceptions
InvalidDataExceptionvalue is invalid.

◆ ToShortXml()

string ZeroInstall.Model.XmlUnknown.ToShortXml ( )
inline

Returns a shortened XML representation (with attributes but without child elements).

Intended for use in error messages. Not suitable for parsing. Use XmlStorage.ToXmlString<T> instead if you need a full XML representation.


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