Class FileTypeExtension
- Namespace
- ZeroInstall.Model.Capabilities
- Assembly
- ZeroInstall.Model.dll
A specific file extension used to identify a file type.
[Serializable]
[Equatable]
public class FileTypeExtension : XmlUnknown, IEquatable<XmlUnknown>, ICloneable<FileTypeExtension>, IEquatable<FileTypeExtension>
- Inheritance
-
FileTypeExtension
- Implements
- Inherited Members
Fields
TypeApplication
Canonical PerceivedType.
public const string TypeApplication = "application"
Field Value
TypeAudio
Canonical PerceivedType.
public const string TypeAudio = "audio"
Field Value
TypeCompressed
Canonical PerceivedType.
public const string TypeCompressed = "compressed"
Field Value
TypeContacts
Canonical PerceivedType.
public const string TypeContacts = "contacts"
Field Value
TypeDocument
Canonical PerceivedType.
public const string TypeDocument = "document"
Field Value
TypeFolder
Canonical PerceivedType.
public const string TypeFolder = "folder"
Field Value
TypeGameMedia
Canonical PerceivedType.
public const string TypeGameMedia = "gamemedia"
Field Value
TypeImage
Canonical PerceivedType.
public const string TypeImage = "image"
Field Value
TypeSystem
Canonical PerceivedType.
public const string TypeSystem = "system"
Field Value
TypeText
Canonical PerceivedType.
public const string TypeText = "text"
Field Value
TypeVideo
Canonical PerceivedType.
public const string TypeVideo = "video"
Field Value
Properties
MimeType
The MIME type associated with the file extension.
public string? MimeType { get; set; }
Property Value
PerceivedType
Defines the broad category of file types this extension falls into. Well-known values on Windows are: folder, text, image, audio, video, compressed, document, system, application
public string? PerceivedType { get; set; }
Property Value
Value
The file extension including the leading dot (e.g., ".jpg").
public required string Value { get; set; }
Property Value
Methods
Clone()
Creates a deep copy of this FileTypeExtension instance.
public FileTypeExtension Clone()
Returns
- FileTypeExtension
The new copy of the FileTypeExtension.
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
Equals(FileTypeExtension?)
protected bool Equals(FileTypeExtension? other)
Parameters
other
FileTypeExtension
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Normalize()
Converts legacy elements, sets default values, etc..
public void Normalize()
Exceptions
- InvalidDataException
A required property is not set or invalid.
ToString()
Returns the extension in the form "Value (MimeType)". Not safe for parsing!
public override string ToString()
Returns
Operators
operator ==(FileTypeExtension?, FileTypeExtension?)
Indicates whether the object on the left is equal to the object on the right.
public static bool operator ==(FileTypeExtension? left, FileTypeExtension? right)
Parameters
left
FileTypeExtensionThe left object
right
FileTypeExtensionThe right object
Returns
- bool
true if the objects are equal; otherwise, false.
operator !=(FileTypeExtension?, FileTypeExtension?)
Indicates whether the object on the left is not equal to the object on the right.
public static bool operator !=(FileTypeExtension? left, FileTypeExtension? right)
Parameters
left
FileTypeExtensionThe left object
right
FileTypeExtensionThe right object
Returns
- bool
true if the objects are not equal; otherwise, false.