0

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)
{
  ...
}
almog.ori
  • 7,839
  • 1
  • 35
  • 49

1 Answers1

5

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.

Community
  • 1
  • 1
Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443