Click or drag to resize

CoreUtilsMakeCLSCompliantName Method (String, Boolean, Boolean, Boolean)

Converts the given name into a string that is usable as a CLS compliant name. All names are PasCal cased, which means the first character is made uppercase. It tries to comply the to identifier syntaxis for C#, with 1 exception, it will not allow a '@' character nor '_' at the front of the name. See section 2.4.2 of the C# standard for details. When the name starts with a numeric digit, a '_' is added as a prefix. This way the name is always CLS compliant. If the resulting name is empty, an exception is thrown.

Namespace:  SD.LLBLGen.Pro.Core
Assembly:  SD.LLBLGen.Pro.Core (in SD.LLBLGen.Pro.Core.dll) Version: 5.6.0.0 (5.6.19.0117)
Syntax
public static string MakeCLSCompliantName(
	string nameToConvert,
	bool capitalizeFirstCharacter,
	bool makeElementNamePascalCasing,
	bool removeUnderscoresFromElementName
)

Parameters

nameToConvert
Type: SystemString
The name to convert
capitalizeFirstCharacter
Type: SystemBoolean
If true, the first character will be capitalized
makeElementNamePascalCasing
Type: SystemBoolean
will make the name pascal casing
removeUnderscoresFromElementName
Type: SystemBoolean
will remove underscores from name

Return Value

Type: String
A CLS compliant equivalent for the passed in name.
Exceptions
ExceptionCondition
ArgumentExceptionwhen nameToConvert is an empty string or solely contains whitespace or is not convertable to a CLS compliant name.
See Also