Class TypeHelper
Type helper.
public static class TypeHelper
- Inheritance
-
objectTypeHelper
Fields
MAX_NAME_LENGTH
Maximal length of the node document name.
public const int MAX_NAME_LENGTH = 100
Field Value
- int
Properties
MaxCodeNameLength
Maximal length of the node document name.
public static int MaxCodeNameLength { get; set; }
Property Value
- int
Methods
EnsureMaxCodeNameLength(string, int)
Ensures maximal allowed code name length.
public static string EnsureMaxCodeNameLength(string codeName, int maxLength)
Parameters
codeNamestringOriginal name
maxLengthintMaximum code name length, if not set (0), cuts the code name to the general MaxCodeNameLength
Returns
- string
GetMaxCodeNameLength(int)
Gets the maximum code name length
public static int GetMaxCodeNameLength(int maxLength)
Parameters
maxLengthintMaximum code name length, if not set (0), returns MaxCodeNameLength
Returns
- int
GetNiceName(string)
Gets nice name from the given object type
public static string GetNiceName(string name)
Parameters
namestringName to convert to nice name
Returns
- string
GetNiceObjectTypeName(string, string, ILocalizationService, IConversionService)
Gets the nice object type name for this type
public static string GetNiceObjectTypeName(string objectType, string culture = null, ILocalizationService localizationService = null, IConversionService conversionService = null)
Parameters
objectTypestringType to localize
culturestringCulture code
localizationServiceILocalizationServiceLocalization service instance. If not provided, the instance is loaded from service collection.
conversionServiceIConversionServiceConversion service instance. If not provided, the instance is loaded from service collection.
Returns
- string
GetObjectTypeResourceKey(string, IConversionService)
Gets the resource key for the name of the object type. Name of type should be in singular form.
public static string GetObjectTypeResourceKey(string objectType, IConversionService conversionService = null)
Parameters
objectTypestringObject type
conversionServiceIConversionServiceConversion service instance. If not provided, the instance is loaded from service collection.
Returns
- string
GetPlural(string)
Gets the plural for the given name
public static string GetPlural(string name)
Parameters
namestringName to convert
Returns
- string
NewList(params ICollection[])
Returns a new list created from the given values
public static List<string> NewList(params ICollection[] names)
Parameters
namesICollection[]Values
Returns
- List<string>