Question

Im working on a system that allows one to define data types (types that have only public properties) on the fly (undercovers using reflection.emit), i want my new types to also be CLS compliant, what would a validator that validates member names need to take into account in order to be CLS compliant, im only interested in what a function would validate in order to determine if the entered name is ok..

something like

bool IsValidMemberName(string name)
{
  ...
}
Was it helpful?

Solution

Have a look here for the rules: Why is this name with an underscore not CLS Compliant?. Now you simply need to build a regex that checks for those rules. Shouldn't be too hard.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top