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.1.0.0 (5.1.0)
Syntax public static string MakeCLSCompliantName(
string nameToConvert,
bool capitalizeFirstCharacter,
bool makeElementNamePascalCasing,
bool removeUnderscoresFromElementName
)
Public Shared Function MakeCLSCompliantName (
nameToConvert As String,
capitalizeFirstCharacter As Boolean,
makeElementNamePascalCasing As Boolean,
removeUnderscoresFromElementName As Boolean
) As String
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:
StringA CLS compliant equivalent for the passed in name.
Exceptions Exception | Condition |
---|
ArgumentException | when nameToConvert is an empty string or solely contains whitespace or is not convertable
to a CLS compliant name. |
See Also