Skip to content

Class ImportSidecar

Namespace: Apogee.Content.Assets
Assembly: Apogee.Content.dll

The UID in a <asset>.import.xml: the uid attribute of its <Import> root (<Import uid="uid://4k2m9x7q1w3ze" srgb="false"/>). Anything that rewrites a sidecar (a settings panel) has to keep it: ImportSidecar.SetUid(newText, ImportSidecar.ReadUid(oldText)). The import settings and the import key ignore it (), so a UID never makes an asset import again.

public static class ImportSidecar

Inheritance

object ← ImportSidecar

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Fields

RootName

The name of the root element.

public const string RootName = "Import"

Field Value

string

Suffix

The suffix that makes the sidecar's name from the asset's.

public const string Suffix = ".import.xml"

Field Value

string

Methods

ReadUid(string)

The UID in the sidecar's text, or when there is none, the text is empty, is not an <Import> or the attribute is not a valid UID. It never throws.

public static AssetUid ReadUid(string sidecarText)

Parameters

sidecarText string

Returns

AssetUid

SetUid(string, AssetUid)

The sidecar's text with uid as its UID: replaced in place when there is one, added to the root tag otherwise, and nothing else changed (comments, other attributes, quotes and line endings stay). From the empty text it makes <Import uid="…"/> and a new line.

public static string SetUid(string sidecarText, AssetUid uid)

Parameters

sidecarText string

uid AssetUid

Returns

string

Exceptions

ContentException

The text is not an <Import> document the edit can be made in.