Click or drag to resize
CoreUtilsMakeCLSCompliantName Method (String, 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. Will capitalize the first character.

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

Parameters

nameToConvert
Type: SystemString
The name to convert
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