There is no consolidated logic for checking label validity, meaning different kinds of invalid input can be presented and accepted at different edit points. Bits of the checking code are implemented in
The logic in AreAllValidAlphaNumericChars() methods is a partial duplication of NewTemplateDataGrid_CellEditEnding()'s regex checks and EnsureDataLabelsAndLabelsNotEmpty()'s String.IsNullOrWhitespace() checks. One approach or the other should be applied consistently. Also, for consistency and encapsulation the checking should likely be owned by TemplateDatabase rather than EditorWindow.
If Regex is selected consider use of durable, compiled regexes rather than recreating the same expressions each time a data label cell edit completes.
There is no consolidated logic for checking label validity, meaning different kinds of invalid input can be presented and accepted at different edit points. Bits of the checking code are implemented in
The logic in AreAllValidAlphaNumericChars() methods is a partial duplication of NewTemplateDataGrid_CellEditEnding()'s regex checks and EnsureDataLabelsAndLabelsNotEmpty()'s String.IsNullOrWhitespace() checks. One approach or the other should be applied consistently. Also, for consistency and encapsulation the checking should likely be owned by TemplateDatabase rather than EditorWindow.
If Regex is selected consider use of durable, compiled regexes rather than recreating the same expressions each time a data label cell edit completes.