Class ContentId

Namespace
FTK2.ModAPI.Content
Assembly
FTK2.ModAPI.dll

Canonical ASCII lowercase owner:local identity. Never use a hash as a saved identity.

public sealed class ContentId : IEquatable<ContentId>
Inheritance
ContentId
Implements
Inherited Members

Properties

LocalName

public string LocalName { get; }

Property Value

string

Namespace

public string Namespace { get; }

Property Value

string

Methods

Equals(ContentId?)

public bool Equals(ContentId? other)

Parameters

other ContentId

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

IsOwnedBy(string)

public bool IsOwnedBy(string owner)

Parameters

owner string

Returns

bool

Parse(string)

Parses a canonical owner-qualified content ID.

public static ContentId Parse(string text)

Parameters

text string

An ID such as author.mod:flame_cleave.

Returns

ContentId

The normalized lowercase content ID.

Exceptions

FormatException

The value does not satisfy the content-ID grammar.

ToString()

public override string ToString()

Returns

string

TryParse(string?, out ContentId?, out string?)

Attempts to parse and normalize an owner-qualified content ID without throwing for invalid syntax.

public static bool TryParse(string? text, out ContentId? id, out string? error)

Parameters

text string

Candidate owner-qualified ID.

id ContentId

The parsed ID when successful.

error string

A validation explanation when unsuccessful.

Returns

bool

true when parsing succeeds.

Operators

operator ==(ContentId?, ContentId?)

public static bool operator ==(ContentId? left, ContentId? right)

Parameters

left ContentId
right ContentId

Returns

bool

operator !=(ContentId?, ContentId?)

public static bool operator !=(ContentId? left, ContentId? right)

Parameters

left ContentId
right ContentId

Returns

bool