Table of Contents

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

string

TypeAudio

Canonical PerceivedType.

public const string TypeAudio = "audio"

Field Value

string

TypeCompressed

Canonical PerceivedType.

public const string TypeCompressed = "compressed"

Field Value

string

TypeContacts

Canonical PerceivedType.

public const string TypeContacts = "contacts"

Field Value

string

TypeDocument

Canonical PerceivedType.

public const string TypeDocument = "document"

Field Value

string

TypeFolder

Canonical PerceivedType.

public const string TypeFolder = "folder"

Field Value

string

TypeGameMedia

Canonical PerceivedType.

public const string TypeGameMedia = "gamemedia"

Field Value

string

TypeImage

Canonical PerceivedType.

public const string TypeImage = "image"

Field Value

string

TypeSystem

Canonical PerceivedType.

public const string TypeSystem = "system"

Field Value

string

TypeText

Canonical PerceivedType.

public const string TypeText = "text"

Field Value

string

TypeVideo

Canonical PerceivedType.

public const string TypeVideo = "video"

Field Value

string

Properties

MimeType

The MIME type associated with the file extension.

public string? MimeType { get; set; }

Property Value

string

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

string

Value

The file extension including the leading dot (e.g., ".jpg").

public required string Value { get; set; }

Property Value

string

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 object

The object to compare with the current object.

Returns

bool

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

Equals(FileTypeExtension?)

protected bool Equals(FileTypeExtension? other)

Parameters

other FileTypeExtension

Returns

bool

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

string

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 FileTypeExtension

The left object

right FileTypeExtension

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

The left object

right FileTypeExtension

The right object

Returns

bool

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