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

#
public MetaName(bool transformable, params string[] elements)
obsoleteUse MetaName.Create() instead.
Create a new name from a collection of strings.
transformable (bool)Transformable flag.
elements (params string[])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.

MetaName

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

MetaName

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

MetaName

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

MetaName

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

Fields

Separator

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

TransformHint

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

Properties

Count

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

IsTransformable

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

IsTransient

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

Indexers

this[]

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

Methods

AppendElement

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

CompareTo

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

Create

#
public static MetaName Create(bool transformable, params string[] elements)
Gets a name made from a collection of strings.
transformable (bool)Transformable flag.
elements (params string[])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

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

Create

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

Create

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

Equals

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

Equals

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

GetHashCode

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

MakeImmovable

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

MakePermanent

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

MakeTransformable

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

MakeTransient

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

Match

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

Parse

#
public static MetaName Parse(string path)
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.
path (string)Path to parse.
Name that represents the path.

RemoveLastElement

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

Store

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

ToArray

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

ToString

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

TryParse

#
public static Result<MetaName> TryParse(string path)
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.
path (string)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).