Table of Contents

Class NameUtil

Namespace
Hi.Common
Assembly
HiGeom.dll

Utility class for handling object names and display names.

public static class NameUtil
Inheritance
NameUtil
Inherited Members

Fields

UnsetText

Default text used when a name is not set.

public const string UnsetText = "Unset"

Field Value

string

Methods

GetSelectionName(object)

Gets the selection name for an object, using custom implementation if available, or falling back to type display name or type name.

public static string GetSelectionName(this object src)

Parameters

src object

The source object to get the name for

Returns

string

The selection name for the object

GetSelectionName(Type)

Gets the selection name for a type, using its DisplayName attribute if available, or falling back to the type name.

public static string GetSelectionName(this Type type)

Parameters

type Type

The type to get the name for

Returns

string

The selection name for the type

SpacePascalWords(string)

Spaces a PascalCase member name into display words: an underscore suffix is dropped and a space is inserted before each capital that starts a new word, so MachiningResolution_mm becomes “Machining Resolution” and ReadOnFirstOrWrite becomes “Read On First Or Write”. Consecutive capitals stay one word.

public static string SpacePascalWords(string name)

Parameters

name string

The member name to space.

Returns

string

The spaced display words.