MetaName

References
[IoId("00000000-b73f-472f-82f8-36e0cfdab6f4")] public sealed class MetaName : IComparable<MetaName>, IEquatable<MetaName>, IStorable
Represents an immutable data name. We recommend not constructing new names all the time, but instead to have a collection of static names which are used over and over again. This will both result in performance increases and fewer naming mistakes.

Constructors

MetaName

#
Create a new name from a collection of strings.
public MetaName(
transformable,
Transformable flag.
params string[]
elements
Elements of name. The elements may not contain periods or the wildcard symbols '*' and '?'. We recommend, but do not enforce, using CamelCase alpha-numeric characters without whitespace.
)
obsoleteUse MetaName.Create() instead.

MetaName

#
Create a new name from a single name element.
public MetaName(
transformable,
Transformable flag.
element
One and only element of name. The element may not contain periods or the wildcard symbols '*' and '?'.
)
obsoleteUse MetaName.Create() instead.

MetaName

#
Deserialization constructor.
public MetaName(
reader
Reader object.
)

MetaName

#
Create a new non-transformable name from a collection of strings.
public MetaName(
params string[]
elements
Elements of name. The elements may not contain periods or the wildcard symbols '*' and '?'. We recommend using CamelCase alpha-numeric characters without whitespace.
)
obsoleteUse MetaName.Create() instead.

MetaName

#
Create a new non-transformable name from a single name element.
public MetaName(
element
One and only element of name. The element may not contain periods or the wildcard symbols '*' and '?'.
)
obsoleteUse MetaName.Create() instead.

Fields

Separator

#
Defines the separator character.
public const char Separator = '.'

TransformHint

#
Defines the transformable hint in a meta data name. Names ending with this character will be treated as transformable whenever possible.
public const char TransformHint = '#'

Properties

Count

#
Gets the number of elements.
public int Count { get; }

IsTransformable

#
Gets whether this name has transformable hinting.
public bool IsTransformable { get; }

IsTransient

#
Get whether this name is considered transient.
public bool IsTransient { get; }

Indexers

this[]

#
Gets the element at the given index.
public string this[
index
Index of element to retrieve.
] { get; }
Element at the given index.

Methods

AppendElement

#
Create a new name whch is similar to this one plus an extra element.
public MetaName AppendElement(
element
Element to append.
)
New name.

CompareTo

#
Comparison test. This test ignores the IsTransformable property.
public int CompareTo(
other
Name to compare to.
)
Comparison result.

Create

#
Gets a name made from a collection of strings.
public static MetaName Create(
transformable,
Transformable flag.
params string[]
elements
Elements of name. The elements may not contain periods or the wildcard symbols '*' and '?'. We recommend, but do not enforce, using CamelCase alpha-numeric characters without whitespace.
)

Create

#
Gets a name made from a single name element.
public static MetaName Create(
transformable,
Transformable flag.
element
One and only element of name. The element may not contain periods or the wildcard symbols '*' and '?'.
)

Create

#
Gets a non-transformable name made from a collection of strings.
public static MetaName Create(
params string[]
elements
Elements of name. The elements may not contain periods or the wildcard symbols '*' and '?'. We recommend using CamelCase alpha-numeric characters without whitespace.
)

Create

#
Gets a non-transformable name made from a single name element.
public static MetaName Create(
element
One and only element of name. The element may not contain periods or the wildcard symbols '*' and '?'.
)

Equals

#
Test for equality. This test ignores the IsTransformable property.
public bool Equals(
other
UserDataName to compare against.
)
True if objects are equal, false if not.

Equals

#
Test for equality.
public override bool Equals(
obj
TextElements to compare against.
)
True if objects are equal, false if not.
Object.Equals

GetHashCode

#
Gets the hash code for this name.
public override int GetHashCode()

MakeImmovable

#
Remove the transformable hint to this name.
public MetaName MakeImmovable()

MakePermanent

#
Remove the transient state from this name.
public MetaName MakePermanent()

MakeTransformable

#
Append the transformable hint to this name, if it isn't already there.
public MetaName MakeTransformable()

MakeTransient

#
Create a transient version of this name.
public MetaName MakeTransient()

Match

#
Test to see whether this name matches a pattern. Matching is always case-insensitive.
public bool Match(
pattern
Pattern to match.
)
True if pattern matches this name.

Parse

#
Creates a new name from a full path. Periods in the path will be used as splitting indices. The path should not contain consecutive periods or the wildcard symbols '*' and '?'. We recommend using CamelCase alpha-numeric characters without whitespace.
public static MetaName Parse(
path
Path to parse.
)
Name that represents the path.

RemoveLastElement

#
Create a new name which is similar to this one minus the last element. Names with only one element cannot be reduced.
public MetaName RemoveLastElement()
New name.

Store

#
Serialization method.
public void Store(
writer
Writer object.
)
Store

ToArray

#
Gets an array of strings which mimics the elements in this name.
public string[] ToArray()
Array of name element.

ToString

#
Gets the string representation of these elements.
public override string ToString()
Object.ToString

TryParse

#
Creates a new name from a full path. Periods in the path will be used as splitting indices. The path should not contain consecutive periods or the wildcard symbols '*' and '?'. We recommend using CamelCase alpha-numeric characters without whitespace.
public static Result<MetaName> TryParse(
path
Path to parse.
)
Name that represents the path.

Operators

OperationResultDescription
MetaName==MetaNamebool
MetaName!=MetaNamebool

Convertors

OperationResultDescription
implicitstringMetaNameConvert a string into a MetaName, using TryParse(string).